Global API
...
Requests
Item

Update

1min
the following is an example of updating an item where we are changing some of the fields (see item docid\ uwajnf0exxeygtmse4uve for all available fields) the netsuite item id (internalid) and item type (itemtype) are required to update the item note breadwinner supports multiple item updates in one request, but it is still in the beta stage the response returns the complete item information, but we have shortened the response in our example for ease of reading pass skipdml as true in the request to skip the dml operation in salesforce request map\<string, object> nsitem = new map\<string, object>(); nsitem put('internalid', '7718'); nsitem put('itemtype', 'noninventorysaleitem'); nsitem put('displayname', 'leather jacket'); nsitem put('location', new map\<string, object>{'internalid'=>'10'}); nsitem put('salesdescription', 'black color leather jacket'); // initializing the item custom fields list\<object> itemcustomfieldlist = new list\<object>(); map\<string, object> itemcustomfield = new map\<string, object>(); itemcustomfield put('fieldtype', 'select'); itemcustomfield put('scriptid', 'custitem category'); itemcustomfield put('valuelookup', new map\<string, object>{'internalid'=>'2'}); itemcustomfieldlist add(itemcustomfield); map\<string, object> itemcustomfield1 = new map\<string, object>(); itemcustomfield1 put('fieldtype', 'boolean'); itemcustomfield1 put('scriptid', 'custitem available'); itemcustomfield1 put('value','true'); itemcustomfieldlist add(itemcustomfield1); // adding the item custom fields nsitem put('customfieldlist', new map\<string, object>{'customfield'=>itemcustomfieldlist}); map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('items', new list\<object>{nsitem}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'updateitem'); reqobj put('skipdml', false); reqobj put('requestjson', reqjson); // placing a request to breadwinner global api map\<string, object> resp = breadwinner ns breadwinnernetsuiteapi call(reqobj); system debug(resp); response { action=updateitem, timestamp=1606829457729, validrequest=true, version=1 0, responsejson={ "status" "200", "errors" \[], "items" \[ { "usemarginalrates" false, "unitstype" null, "taxschedule" { "name" "default tax schedule", "internalid" "1" }, "subsidiarylist" { "recordref" \[ { "type" null, "name" "parent company", "internalid" "1", "externalid" null } ] }, "shippingcost" null, "salesforceid" "a082w0000072u8haae", "salesdescription" "black color leather jacket", "rate" null, "quantitypricingschedule" null, "purchasedescription" null, "pricingmatrix" null, "pricinggroup" null, "preferredlocation" null, "parent" null, "overallquantitypricingtype" " bylinequantity", "minimumquantity" null, "memberlist" null, "maximumquantity" null, "matrixtype" null, "locationslist" null, "location" { "name" "new york", "internalid" "10" }, "lastmodifieddate" 1606829455, "itemtype" "noninventorysaleitem", "itemid" "leather jacket", "isinactive" false, "internalid" "7718", "incomeaccount" { "type" null, "name" "sales", "internalid" "54", "externalid" null }, "includechildren" true, "handlingcost" null, "externalid" null, "expenseaccount" { "type" null, "name" "expenses", "internalid" "58", "externalid" null }, "displayname" null, "description" null, "department" null, "customform" { "type" null, "name" "custom non inventory part form", "internalid" "5", "externalid" null }, "customfieldlist" { "customfield" \[ { "valuelookup" { "type" null, "name" "retailer", "internalid" "2", "externalid" null }, "value" null, "scriptid" "custitem category", "internalid" "457", "fieldtype" null }, { "valuelookup" null, "value" "true", "scriptid" "custitem available", "internalid" "250", "fieldtype" null } ] }, "currencyvalue" "1", "createddate" 1606829455, "cost" null, "cogsaccount" null, "classification" null, "assetaccount" null, "account" null } ] } }