1Map<String, Object> nsItem = new Map<String, Object>();
2 nsItem.put('internalId', '7718');
3 nsItem.put('itemType', 'nonInventorySaleItem');
4 nsItem.put('displayname', 'Leather Jacket');
5 nsItem.put('location', new Map<String, Object>{'internalId'=>'10'});
6 nsItem.put('salesDescription', 'Black Color Leather Jacket');
7
8 // Initializing the Item Custom Fields
9 List<Object> itemCustomFieldList = new List<Object>();
10 Map<String, Object> itemCustomField = new Map<String, Object>();
11 itemCustomField.put('fieldType', 'select');
12 itemCustomField.put('scriptId', 'custitem_category');
13 itemCustomField.put('valueLookup', new Map<String, Object>{'internalId'=>'2'});
14 itemCustomFieldList.add(itemCustomField);
15 Map<String, Object> itemCustomField1 = new Map<String, Object>();
16 itemCustomField1.put('fieldType', 'boolean');
17 itemCustomField1.put('scriptId', 'custitem_available');
18 itemCustomField1.put('value','true');
19 itemCustomFieldList.add(itemCustomField1);
20
21 // Adding the Item Custom Fields
22 nsItem.put('customFieldList', new Map<String, Object>{'customField'=>itemCustomFieldList});
23
24Map<String, Object> requestJSONMap = new Map<String, Object>();
25 requestJSONMap.put('items', new List<Object>{nsItem});
26 String reqJSON = JSON.serialize(requestJSONMap);
27
28Map<String, Object> reqObj = new Map<String, Object>();
29 reqObj.put('version', '1.0');
30 reqObj.put('action', 'updateItem');
31 reqObj.put('skipDML', false);
32 reqObj.put('requestJSON', reqJSON);
33
34// Placing a request to Breadwinner Global API
35Map<String, Object> resp = breadwinner_ns.BreadwinnerNetSuiteAPI.call(reqObj);
36System.debug(resp);