NetSuite RESTlet Examples
About RESTlet examples
You can accomplish various NetSuite processes using Advanced Inventory RESTlets.
These examples provide details for how to use specific Advanced Inventory RESTlets contained in the Advanced Inventory NetSuite Connector Bundle.
Advanced Bin & Lot/Serial Number Management
This example shows how the Advanced Bin & Lot/Serial Number Management NetSuite process can be accomplished using Advanced Inventory RESTlets.
The inventorydetails is the sub-record used by NetSuite to hold information for Advanced Bin & Lot/Serial Numbers. The field subrecordname is used when the internal name is not “inventorydetail” (ex: countdetail). Generally, the only values needed in the inventorydetails array are item, quantity and the inventoryassignment array. The inventoryassignment array records the bin, tobin, inventory number, quantity and expiration date. When the inventory number is a serial number, the quantity of the inventory assignment must be one.
Note: The total of all inventory assignments must equal the quantity in inventorydetail.
Edit inventory details
Example using DSI_RecordUpdate
{ "internalid": "21156", "recordtype": "transferorder", "tranid": "", "mc_user": "Cadet.Stimpy@dsiglobal.com", "updatefields": [{ "fieldid": "memo", "newvalue": "Updated from REST" }], "updatecolumns": [{ "sublistid": "item", "subrecordname":"inventorydetail", "lines": [{ "line": "1", "remove": "", "nvpair": [{ "columnid": "quantity", "newvalue": "4" }], "inventorydetail": { "item":"", "location":"", "tolocation":"", "quantity": "4", "unit": "", "inventoryassignment": [{ "line": "1", "binnumber": "", "binid": "", "tobinnumber": "", "tobinid": "", "quantity": "2", "inventorynumber": "L-Alpha1", "inventorynumberid": "", "expirationdate":"" },{ "line": "2", "binnumber": "", "binid": "", "tobinnumber": "", "tobinid": "", "quantity": "2", "inventorynumber": "L-Alpha2", "inventorynumberid": "", "expirationdate":"8/20/2017" }] } }] }] }
Find transaction containing a Lot/Serial Number
To find transactions where an item in a sublist (join) has a particular lot or serial number, use the inventorynumber or inventorynumberid fields in the searchcolumns array.
Example using DSI_RecordLookup
{ "recordtype": "itemfulfillment", "searchcolumns": [{ "join": "item", "inventorynumber":"CSA0000000001", "inventorynumberid":"835" }] }
The equivalent lookup can be performed with DSI_RunSearch using the loadrecords option.
Example using DSI_RunSearch
{ "searchtype": "transaction", "loadrecords":"T", "searchfilters": [{ "fieldid": "inventorynumber", "searchvalue": "CSA0000000003", "join": "itemnumber" },{ "fieldid": "recordtype", "searchvalue": "itemfulfillment" }], "searchcolumns": [] }
Find all Lot/Serial numbers for an item
To find the inventory numbers (lot/serial numbers) for a particular item, use the Run Search RESTlet with searchtype equal to “inventorynumber” and a filter, in the searchfilters array, for “item.”
Example using DSI_RunSearch
{ "searchtype": "inventorynumber" "searchfilters": [{ "fieldid": "item", "operator": "anyof", "searchvalue": "2022" },{ "fieldid": "location", "searchvalue": "2" }], "searchcolumns": [{ "fieldid": "location" },{ "fieldid": "inventorynumber" },{ "fieldid": "quantityavailable" },{ "fieldid": "quantityonhand" },{ "fieldid": "quantityintransit" }] }
A similar lookup can be performed using DSI_RecordLookup.
Example using DSI_RecordLookup
{ "recordtype": "inventorynumber", "searchfields": [{ "fieldid": "inventorynumber" "searchvalue": "CSA0000000003" }] }
Find an Item with a Specific Lot/Serial Number
To find an item with a specified inventory number (lot/serial number), use the Run Search RESTlet with searchtype equal to “inventorynumber” and a filter, in the searchfilters array, for “inventorynumber” set to the text name, not internal id, of the low/serial number.
Example Using DSI_RunSearch
{ "searchtype": "inventorynumber", "searchfilters": [{ "fieldid": "inventorynumber", "operator": "is", "searchvalue": "CSA0000000003" }], "searchcolumns": [{ "fieldid": "item" },{ "fieldid": "location" },{ "fieldid": "quantityavailable" },{ "fieldid": "quantityonhand" },{ "fieldid": "quantityintransit" }] }
Find a record with inventory details as a BODY field
Some records, such as assembly build, assembly unbuild and work order completion, have a body level inventory details subrecord. To find an item with a specified inventory number (lot/serial number), use the searchfields array rather than the searchcolumns array. Omit the fieldid and searchvalue an put the value for which you are searching in the inventorynumber field of the inventorydetail object. As usual, the operator defaults to “is.”
Example using DSI_RunSearch
{ "recordtype": "assemblyunbuild", "includeinactive": "", "searchfields": [{ "operator": "", "inventorydetail": { "binnumber": "", "inventorynumber": "CGSP00001" } }] }
The equivalent lookup can be performed with DSI_RunSearch.
Example using DSI_RunSearch
{ "searchtype": "transaction", "sortedbyinternalid":"", "loadrecords":"T", "searchfilters": [{ "fieldid": "inventorynumber", "operator": "is", "searchvalue": "CGSP00001", "join": "itemnumber" },{ "fieldid": "mainline", "operator": "", "searchvalue": "T" },{ "fieldid": "recordtype", "operator": "", "searchvalue": "assemblyunbuild" }], "searchcolumns": [{ "fieldid": "tranid", "join": "" }] }
Advanced Inventory Management
This example shows how the Advanced Inventory Management NetSuite process can be accomplished using Advanced Inventory RESTlets.
NetSuite's Advanced Inventory Management feature automates demand-based inventory replenishment. Based on the Reorder Point replenishment method and inventory management settings on item records, NetSuite can anticipate future demand for the item and adjust suggested item ordering. Based on previous purchases and sales of items, NetSuite can auto calculate appropriate reorder points and preferred stock levels for items.
Auto reorder point
The reorder point is calculated by NetSuite based on the demand, lead time, and safety stock level.If the safety stock level is expressed in units, the calculation is (lead time * demand / time) + safety stock.If the safety stock level is expressed in days, the calculation is demand / time * (lead time + safety stock).
Example using DSI_RecordUpdate
{ "internalid": "98", "recordtype": "inventoryitem", "mc_user": "dagwood.bumstead@dsiglobal.com", "updatefields": [{ "fieldid": "autoreorderpoint", "newvalue": "T" },{ "fieldid": "reordermultiple", "newvalue": "25" }] }
Manual reorder point
The reorder point can be set manually by unchecking the auto-calculate box and entering a value for reorderpoint.
If the multiple locations feature is enabled, the reorder point must be set for each location. Each location can have a different reorder point.
Example using DSI_RecordUpdate
{ "internalid": "98", "recordtype": "inventoryitem", "mc_user": "julius.dithers@dsiglobal.com", "updatefields": [{ "fieldid": "autoreorderpoint", "newvalue": "F" },{ "fieldid": "reordermultiple", "newvalue": "25" }], "updatecolumns": [{ "sublistid": "locations", "subrecordname":"", "lines": [{ "line": "1", "remove": "", "nvpair": [{ "columnid": "reorderpoint", "newvalue": "100" }] },{ "line": "4", "remove": "", "nvpair": [{ "columnid": "reorderpoint", "newvalue": "50" }] }] }] }
Without multiple locations
Example using DSE_RecordUpdate
{ "internalid": "98", "recordtype": "inventoryitem", "mc_user": "cora.dithers @dsiglobal.com", "updatefields": [{ "fieldid": "autoreorderpoint", "newvalue": "F" },{ "fieldid": "reorderpoint", "newvalue": "100" },{ "fieldid": "reordermultiple", "newvalue": "25" }] }
Set safety stock level
Safety Stock Level can be set either in units or days. Setting either one erases the value from the other; e.g. an item's safety stock level is set to 10 units, but when 30 is entered in the days field, the units field become blank.
Safety Stock Level in units
Example using DSI_RecordUpdate
{ "internalid": "98", "recordtype": "inventoryitem", "mc_user": "herb.woodley@dsiglobal.com", "updatefields": [{ "fieldid": "safetystocklevel", "newvalue": "10" }] }
Safety Stock Level in days
Example using DSI_RecordUpdate
{ "internalid": "98", "recordtype": "inventoryitem", "mc_user": "daisy.bumstead@dsiglobal.com", "updatefields": [{ "fieldid": "safetystockleveldays", "newvalue": "30" }] }
Preferred stock level
The preferred stock level is the optimum quantity to maintain in stock of an item. The quantity you enter here is used to determine your replenishment needs on the Order Items page. It is the quantity you want to have in stock after an order is placed.
Auto preferred stock level
Set the autopreferredstocklevel to “T” if you want NetSuite to calculate the preferred stock level based on demand for the item. The preferred stock level is calculated as: (daily demand * number of days in the preferredstockleveldays field). If no preferred stock level is specified, then the default preferred stock level is used from the Set Up Inventory Management page.
Example using DSI_RecordUpdate
{ "internalid": "98", "recordtype": "inventoryitem", "mc_user": "tootsie.woodley@dsiglobal.com", "updatefields": [{ "fieldid": "autopreferredstocklevel", "newvalue": "T" },{ "fieldid": "preferredstockleveldays", "newvalue": "14" }] }
Manual preferred stock level
Set the autopreferredstocklevel field to “F” to manually enter the preferred stock level quantity. >If the multiple locations feature is enabled, the preferred stock quantity must be set for each location. Each location can have a different preferred stock quantity.
Example using DSI_RecordUpdate
{ "internalid": "98", "recordtype": "inventoryitem", "mc_user": "cookie.bumstead@dsiglobal.com", "updatefields": [{ "fieldid": "autopreferredstocklevel", "newvalue": "F" },{ "fieldid": "preferredstockleveldays", "newvalue": "" }], "updatecolumns": [{ "sublistid": "locations", "subrecordname":"", "lines": [{ "line": "1", "remove": "", "nvpair": [{ "columnid": "preferredstocklevel", "newvalue": "20" }] },{ "line": "4", "remove": "", "nvpair": [{ "columnid": "preferredstocklevel", "newvalue": "5" }] }] }] }
Without multiple locations
Example using DSI_RecordUpdate
{ "internalid": "98", "recordtype": "inventoryitem", "mc_user": "blondie.boopadoop@dsiglobal.com", "updatefields": [{ "fieldid": "autopreferredstocklevel", "newvalue": "F" },{ "fieldid": "preferredstockleveldays", "newvalue": "" },{ "fieldid": "preferredstocklevel", "newvalue": "25" }] }
Lead time
Lead time is the average number of days between ordering this item from the vendor and receiving it.
Auto lead time
Check the Auto-Calculate box (autoleadtime = “T”) if you want NetSuite to calculate the lead time based on the most recent order history of this item. Lead time is calculated by taking the number of days between the order entry and receipt on the three most recent purchase orders, and dividing by three. If more than three purchase orders exist, all purchase orders within the period specified in the Order Analysis Interval field on the Inventory Management Preferences dialog will be used.
-
If there are multiple receipts for the item against the same purchase order, the calculation is made using the difference between the purchase order and the last receipt (the receipt that fully receives the order).
-
Lead time calculation is not weighted by number of units received.
-
More recent purchase orders without receipts are ignored.
Example using DSI_RecordUpdate
{ "internalid": "98", "recordtype": "inventoryitem", "mc_user": "alexander.bumstead@dsiglobal.com", "updatefields": [{ "fieldid": "autoleadtime", "newvalue": "T" }] }
Manual lead time
Clear the Auto-Calculate box (autoleadtime = "F") to manually enter a lead time value in days. If the Auto-Calculate box is cleared and no value is entered, then the default value from the Set Up Inventory Management page is used.
Example using DSI_RecordUpdate
{ "internalid": "98", "recordtype": "inventoryitem", "mc_user": "blondie.bumstead@dsiglobal.com", "updatefields": [{ "fieldid": "autoleadtime", "newvalue": "F" },{ "fieldid": "leadtime", "newvalue": "25" }] }
Assembly
This example shows how the Assembly NetSuite process can be accomplished using Advanced Inventory RESTlets.
Assembly build from work order
No bins
Example Using DSI_TransformTransaction
{ "transform": [{ "mc_user": "quckdraw.mcgraw@dsiglobal.com", "fromrecordtype": "workorder", "fromrecordid": "33691", "torecordtype": "assemblybuild", "sourcefields": [{ "fieldid": "memo", "value": "Built 4, 8 more to go." }], "targetfields": [{ "fieldid": "quantity", "value": "4" }] }] }
With simple bins for both components and the assembly.
Example Using DSI_TransformTransaction
{
"transform": [{
"mc_user": "Daphne.Blake@dsiglobal.com",
"fromrecordtype": "workorder",
"fromrecordid": "1743",
"torecordtype": "assemblybuild",
"sourcefields": [{
"fieldid": "memo",
"value": "Built by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "quantity",
"value": "1"
},{
"fieldid": "binnumbers",
"value": "Beta-1(1)"
}],
"sublists": [{
"sublistid": "component",
"subrecordname":"",
"lines": [{
"linenum": "1",
"item": "105",
"qty": "1",
"binnumbers": "Beta-2(1)",
"serialnumbers": "",
"refnum":"",
"nvpair": [{
"columnid": "",
"value": ""
}]
},{
"linenum": "2",
"item": "106",
"qty": "1",
"binnumbers": "Alpha-1(1)",
"serialnumbers": "",
"refnum":"",
"nvpair": [{
"columnid": "",
"value": ""
}]
}]
}]
}]
}
Assembly build - Standalone
A standalone build, not necessarily from a work order. The targetfields member, item, is the internalid of the assembly item to be built.
Example Using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "I.R.Babboon@dsiglobal.com", "recordtype": "assemblybuild", "location": "2", "subsidiary":"1", "targetfields": [{ "fieldid": "item", "value": "950" },{ "fieldid": "quantity", "value": "2" }] }] }
Assembly unbuild
The targetfields member, item, is the internalid of the assembly item to be unbuilt.
Example Using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "I.R.Babboon@dsiglobal.com", "recordtype": "assemblyunbuild", "location": "2", "subsidiary":"1", "targetfields": [{ "fieldid": "item", "value": "950" },{ "fieldid": "quantity", "value": "2" }] }] }
Assembly unbuild advanced bin/inventory numbers
To unbuild an assembly that has a lot/serial number, or an advanced bin, you must specify a BODY level inventorydetails in the targetfields array. The inventorydetails in the sublists array is for the bin/inventory number of the components of the assembly.
Example Using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "octo.octavius@dsiglobal.com", "recordtype": "assemblyunbuild", "sublists": [{ "sublistid": "", "subrecordname":"", "lines": [{ "nvpair": [{ "columnid": "", "newvalue": "" }], "inventorydetail": { "location":"", "tolocation":"", "quantity": "", "unit": "", "inventoryassignment": [{ "line": "", "binnumber": "", "binid": "", "tobinnumber": "", "tobinid": "", "quantity": "", "inventorynumber": "", "inventorynumberid": "", "expirationdate":"" }] } }] }], "targetfields": [{ "fieldid": "quantity", "value": "2" },{ "fieldid": "item", "value": "2022" },{ "fieldid": "", "value": "", "inventorydetail": { "item":"2022", "unit": "", "inventoryassignment": [{ "line": "NEW", "binnumber": "", "binid": "", "quantity": "1", "inventorynumber": "CGSP00001", "inventorynumberid": "" },{ "line": "NEW", "binnumber": "", "binid": "", "quantity": "1", "inventorynumber": "CGSP00002", "inventorynumberid": "" }] } }] }] }
Assembly unbuild to undo a specific build
To counter a specific Assembly Build, transform the build into an unbuild.
Example Using DSI_TransactionTransform
{ "transform": [{ "mc_user": "wile.e.coyote@dsiglobal.com", "fromrecordtype": "assemblybuild", "fromrecordid": "26949", "torecordtype": "assemblyunbuild", "tolocation": "2" }] }
Attach/Detach Record
This example shows how the Attach/Detach Record NetSuite process can be accomplished using Advanced Inventory RESTlets.
Attach to a custom record
Example using DSI_AttachRecord
{ "childtype": "customrecord_dsi_bol", "childid": "303", "parenttype": "customrecord_dsi_bol", "parentid": "302", "mc_user": "Sulu@Enterprise.com", "role": "", "field": "custrecord_dsi_bol_childbol", "detach": "" }
Detach from a custom record
Example using DSI_AttachRecord
{ "childtype": "customrecord_dsi_bol", "childid": "303", "parenttype": "customrecord_dsi_bol", "parentid": "302", "mc_user": "Scotty@Enterprise.com", "role": "", "field": "custrecord_dsi_bol_childbol", "detach": "T" }
Bill of Lading
This example shows how the Bill of Lading NetSuite process can be accomplished using Advanced Inventory RESTlets.
The Bill of Lading number has the internal id, "name".
Create Bill of Lading record
The Bill of Lading (BOL) record is used to contain data about a shipment and is the parent record of two custom records which form the Products list and Orders list needed for the BOL.
Once all desired fields have been set, submit the request; making a note of the internal id of the new record. Then use the new internal id to set the parent field of the BOL Product and BOL Order as they are created.
Example using DSI_RecordCreate
{ "recordcategory": "custom", "create": [{ "mc_user": "Hamfast.Gamgee@HobbitonGardeners.com", "recordtype": "customrecord_dsi_bol", "targetfields": [{ "fieldid": "name", "value": "7/29/1954JRRT", "text": "" }, { "fieldid": "custrecord_dsi_bol_shipfrom", "value": "No. 3 Bagshot Row, The Hill, Hobbition", "text": "" }, { "fieldid": "custrecord_dsi_bol_shipto", "value": "The Inn of the Prancing Pony, Bree", "text": "" }, { "fieldid": "custrecord_dsi_bol_trailer", "value": "Bill The Pony", "text": "" }, { "fieldid": "custrecord_dsi_bol_carrier", "value": "Rohirrim Riders", "text": "" }, { "fieldid": "custrecord_dsi_bol_billto", "value": "Gandalf The Gray", "text": "" }, { "fieldid": "custrecord_dsi_bol_freight_terms", "value": "2", "text": "" }] }] }
Create a Bill of Lading order record
Example using DSI_RecordCreate
{ "recordcategory": "custom", "create": [{ "mc_user": "Saruman.Of.Many.Colors@Isengard.com", "recordtype": "customrecord_dsi_bol_order", "tranid": "", "itemid": "", "entityid": "", "location": "", "transferlocation": "", "account": "", "subsidiary": "", "targetfields": [{ "fieldid": "custrecord_dsi_bol_order_parent", "value": "102" }, { "fieldid": "custrecord_dsi_bol_order_so", "value": "4071" }, { "fieldid": "custrecord_dsi_bol_order_numpackage", "value": "7" }, { "fieldid": "custrecord_dsi_bol_order_weight", "value": "622" }] }] }
Create BOL Product Record
Example using DSI_RecordCreate
{ "recordcategory": "custom", "create": [{ "mc_user": "Saruman.Of.Many.Colors@Isengard.com", "recordtype": "customrecord_dsi_bol_product", "targetfields": [{ "fieldid": "custrecord_dsi_bol_product_parent", "value": "102" }, { "fieldid": "custrecord_dsi_bol_product_unitqty", "value": "4" }, { "fieldid": "custrecord_dsi_bol_product_unittype", "value": "pallet" }, { "fieldid": "custrecord_dsi_bol_product_packageqty", "value": "7" }, { "fieldid": "custrecord_dsi_bol_product_packagetype", "value": "crate" }, { "fieldid": "custrecord_dsi_bol_product_weight", "value": "622" }, { "fieldid": "custrecord_dsi_bol_product_commodity", "value": "Furniture" }] }] }
Lookup a BOL record
Example using DSI_RecordLookup
{ "internalid": "", "recordtype": "customrecord_dsi_bol", "filterexpression":"", "searchfields": [{ "fieldid": "name", "operator": "is", "searchvalue": "123456789" }] }
Search for BOL with Child records
Example using DSI_RunSearch
{ "searchtype": "customrecord_dsi_bol", "loadrecords":"", "filterexpression":"", "searchfilters": [{ "fieldid": "name", "operator": "is", "searchvalue": "123456789", "searchvalue2": "", "join": "" }], "searchcolumns": [{ "fieldid": "name" },{ "fieldid": "custrecord_dsi_bol_order_number", "join": "custrecord_dsi_bol_order_parent" },{ "fieldid": "custrecord_dsi_bol_order_so", "join": "custrecord_dsi_bol_order_parent" },{ "fieldid": "custrecord_dsi_bol_product_weight", "join": "custrecord_dsi_bol_product_parent" }] }
Search for BOL product from specific BOL
Example using DSI_RunSearch
{ "searchtype": "customrecord_dsi_bol_product", "loadrecords":"", "filterexpression":"", "searchfilters": [{ "fieldid": "custrecord_dsi_bol_product_parent", "operator": "anyof", "searchvalue": "1", "searchvalue2": "", "join": "" }], "searchcolumns": [{ "fieldid": "custrecord_dsi_bol_product_parent" },{ "fieldid": "custrecord_dsi_bol_product_packageqty" },{ "fieldid": "custrecord_dsi_bol_product_packagetype" },{ "fieldid": "custrecord_dsi_bol_product_weight" }] }
Search for BOL order from specific BOL
Example using DSI_RunSearch
{ "searchtype": "customrecord_dsi_bol_order", "loadrecords":"", "filterexpression":"", "searchfilters": [{ "fieldid": "custrecord_dsi_bol_order_parent", "operator": "anyof", "searchvalue": "1", "join": "" }], "searchcolumns": [{ "fieldid": "custrecord_dsi_bol_order_number" },{ "fieldid": "custrecord_dsi_bol_order_weight" }] }
Billing Schedule
This example shows how the Billing Schedule NetSuite process can be accomplished using Advanced Inventory RESTlets.
Billing schedule type
Important: The schedule type, schedtype, is a required field and must be set using initvalue NOT targetfields when creating a billing schedule.
In the initvalues array, the schedtype field takes the following values.
Schedule type | schedtype internal ID |
---|---|
Standard | STD |
Charge-based | CB |
Fixed bid, Interval | FBI |
Fixed bid, Milestone | FBM |
Time and materials | TM |
Project billing schedule
Once a billing type is selected, you can then assign a billing schedule record, by internalid, to the billingschedule field. Billing Schedules must already exist before they can be assigned to a project.
Values for frequency and the allowed values for repeatevery.
Frequency | repeatevery |
---|---|
Hourly | 6 or 12 |
Weekly | 1, 2, or 4 |
Monthly | 1, 2, 3, or 6 |
Annually | 1, 2, or 3 |
Create billing schedule
Standard
The Recurrence sublist is available only when schedule type is set to Standard and frequency to Custom.
Example Using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "charles.koch@dsiglobal.com", "recordtype": "billingschedule", "initvalues": [{ "fieldid": "schedtype", "value": "STD" }], "targetfields": [{ "fieldid": "name", "value": "STDrecord1", "text":"" },{ "fieldid": "frequency", "value": "MONTHLY", "text":"" },{ "fieldid": "initialamount", "value": "10%", "text":"" },{ "fieldid": "subsidiary", "value": "1", "text":"" },{ "fieldid": "billingentity", "value": "4371", "text":"" },{ "fieldid": "numberremaining", "value": "4", "text":"" }] }] }
Charge-based
The frequency field can take the value, DAILY, for charged-based schedules.
Example Using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "mark.zuckerberg@dsiglobal.com", "recordtype": "billingschedule", "sublists": [{ "sublistid": "", "subrecordname":"", "lines": [{ "nvpair": [{ "columnid": "", "newvalue": "" }] }] }], "initvalues": [{ "fieldid": "schedtype", "value": "CB" }], "targetfields": [{ "fieldid": "name", "value": "CBrecord1", "text":"" },{ "fieldid": "frequency", "value": "DAILY", "text":"" },{ "fieldid": "dayperiod", "value": "3", "text":"" }] }] }
Fixed bid interval
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "leona.helmsley@dsiglobal.com", "recordtype": "billingschedule", "initvalues": [{ "fieldid": "schedtype", "value": "FBI" }], "targetfields": [{ "fieldid": "name", "value": "FBI schedule", "text":"" },{ "fieldid": "initialamount", "value": "10%", "text":"" },{ "fieldid": "frequency", "value": "WEEKLY", "text":"" },{ "fieldid": "repeatevery", "value": "2", "text":"" }] }] }
Fixed bid milestone
With this schedule type, you must identify an existing project record. You do so using the initvalues array.
Important: The field project must be set using initvalue NOT targetfields.
Then, to create a link between the project and the new billing schedule, you must update the project record - this relationship is not established automatically when you create the billing schedule. The Milestone sublist is available only when schedule type is set to Fixed Bid Milestone.
Example Using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "larry.page@dsiglobal.com", "recordtype": "billingschedule", "sublists": [{ "sublistid": "milestone", "lines": [{ "nvpair": [{ "columnid": "milestoneamount", "newvalue": "10%" },{ "columnid": "milestonedate", "newvalue": "2/7/2017" },{ "columnid": "projecttask", "newvalue": "103314" }] },{ "nvpair": [{ "columnid": "milestoneamount", "newvalue": "80%" },{ "columnid": "milestonedate", "newvalue": "2/21/2017" },{ "columnid": "projecttask", "newvalue": "103315" }] }] }], "initvalues": [{ "fieldid": "project", "value": "3759", "text":"" },{ "fieldid": "schedtype", "value": "FBM" }], "targetfields": [{ "fieldid": "name", "value": "FBM schedule", "text":"" },{ "fieldid": "initialamount", "value": "10%", "text":"" }] }] }
Update the project (job) to create a link between the project and the new billing schedule. The jobbillingtype of the project must match the schedtype of the schedule.
Example User DSI_RecordUpdate
{ "internalid": "3759", "recordtype": "job", "mc_user": "nelson.rockefeller@dsiglobal.com", "updatefields": [{ "fieldid": "jobbillingtype", "newvalue": "FBM" },{ "fieldid": "billingschedule", "newvalue": "13" }] }
Time and materials
Example User DSI_RecordUpdate
{ "recordcategory": "entity", "create": [{ "mc_user": "warren.buffett@dsiglobal.com", "recordtype": "billingschedule", "initvalues": [{ "fieldid": "schedtype", "value": "TM" }], "targetfields": [{ "fieldid": "name", "value": "TM schedule", "text":"" },{ "fieldid": "frequency", "value": "HOURLY", "text":"" },{ "fieldid": "repeatevery", "value": "1", "text":"" }] }] }
Bin
This example shows how the Bin NetSuite process can be accomplished using Advanced Inventory RESTlets.
Basic bins format
The format for binnumbers field is BIN(Qty) BIN(Qty). The list is space delimited and the sum of the quantities must match the absolute value of adjustqtyby or quantity. Even when adjusting a negative number, the Qty in the bin must be positive.
Create a bin
A bin record must be created before it can be associated with an item.
Example using DSI_RecordCreate
{ "recordcategory": "event", "create": [{ "mc_user": "Leo.Davinci@dsiglobal.com", "recordtype": "bin", "location": "1", "subsidiary": "1", "targetfields": [{ "fieldid": "binnumber", "value": "Beta-2" },{ "fieldid": "location", "value": "2" }] }] }
Associate bins with an item at item creation
A bin record must already exist before it can be associated with an item.
Example using DSI_RecordCreate
{ "recordcategory": "item", "create": [{ "mc_user": "William.Parmenter@fortcourage.gov", "recordtype": "inventoryitem", "itemid": "F Tent", "location": "1", "subsidiary": "1", "sublists": [{ "sublistid": "binnumber", "subrecordname":"", "lines": [{ "nvpair": [{ "columnid": "binnumber", "newvalue": "217" }] }] }], "targetfields": [{ "fieldid": "usebins", "value": "T" }], "pricematrix": [{ "row": "1", "column": "1", "currencyid": "1", "newprice": "29.95" }] }] }
Associate bins with an existing item
A bin record must already exist before it can be associated with an item.
Example using DSI_RecordUpdate
{ "mc_user": "rob@dsiglobal.com", "internalid": "1314", "recordtype": "inventoryitem", "itemid": "", "location": "1", "subsidiary": "1", "updatefields": [{ "fieldid": "usebins", "newvalue": "T" }], "updatecolumns": [{ "sublistid": "binnumber", "lines": [{ "line": "NEW", "remove": "", "nvpair": [{ "columnid": "binnumber", "newvalue": "117" }] },{ "line": "NEW", "remove": "", "nvpair": [{ "columnid": "binnumber", "newvalue": "118" }] }] }] }
Disassociate bin from an existing item
Example using DSI_RecordUpdate
{ "mc_user": "rob@dsiglobal.com", "internalid": "1314", "recordtype": "inventoryitem", "itemid": "", "location": "1", "subsidiary": "1", "updatefields": [{ "fieldid": "", "newvalue": "" }], "updatecolumns": [{ "sublistid": "binnumber", "lines": [{ "line": "2", "remove": "T", "nvpair": [{ "columnid": "", "newvalue": "" }] }] }] }
List items in a specific bin
Example using DSI_RecordUpdate
{ "recordtype": "inventoryitem", "location": "", "subsidiary": "", "searchcolumns": [{ "join": "binnumber", "fieldid": "binnumber", "searchvalue": "Beta-1" }] }
Example using DSI_RunSearch
{ "searchtype": "item", "searchfilters": [{ "fieldid": "binnumber", "operator": "is", "searchvalue": "Beta-2" }], "searchcolumns": [{ "fieldid": "itemid" },{ "fieldid": "salesdescription" },{ "fieldid": "inventorynumber", "join":"inventorydetail" }] }
List bins for a specific item
An array of bins is included in the standard output of DSI_RecordLookup.
Bin transfer basic
Use this method when Advanced Bins & Lot/Serial Numbers is not enabled. The bins must be associated with the item before the transfer can be created.
Example using DSI_RecordCreate
{
"recordcategory": "transaction",
"create": [{
"mc_user": "Charles.Babbage@dsiglobal.com",
"recordtype": "bintransfer",
"location": "",
"subsidiary": "",
"sublists": [{
"sublistid": "inventory",
"lines": [{
"nvpair": [{
"columnid": "item",
"newvalue": "105"
},{
"columnid": "quantity",
"newvalue": "5"
},{
"columnid": "frombins",
"newvalue": "Beta-1"
},{
"columnid": "tobins",
"newvalue": "Beta-2"
}]
}]
}],
"targetfields": [{
"fieldid": "memo",
"value": "Bin Transfer by Advanced Inventory"
}]
}]
}
Bin transfer advanced
Use this method when Advanced Bins & Lot/Serial Numbers is enabled. Any bin can be used whether it is associated or not.
Note:An item's preferred bin must be associated, even with Advanced Bins.
Example using DSI_RecordCreate
Notes.
-
Location is required, subsidiary is not required.
-
Each member of the lines array has a new sub-array called inventorydetails. One or more is required.
-
The inventory number, from bin, and to bin can be specified either by value or internalid (internalid is always faster).
-
The quantity in the lines array must be the total of the quantities of all the inventory details.
{ "recordcategory": "transaction", "create": [{ "mc_user": "Charles.Babbage@dsiglobal.com", "recordtype": "bintransfer", "location": "2", "sublists": [{ "sublistid": "inventory", "subrecordname":"inventorydetails", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "678" }, { "columnid": "quantity", "newvalue": "125" }], "inventorydetail": [{ "binnumber": "Alpha-1", "binid": "117", "tobinnumber": "Alpha-2", "tobinid": "118", "quantity": "25", "inventorynumber": "L-Alpha1", "inventorynumberid": "622", "location":"2" },{ "binnumber": "Alpha-1", "binid": "117", "tobinnumber": "2001", "tobinid": "", "quantity": "100", "inventorynumber": "L-Alpha1", "inventorynumberid": "622", "location":"2" }] }] }], "targetfields": [{ "fieldid": "", "value": "" }] }] }
List items needing bin put-away
Example using DSI_BinPutaway
{ "lookup":"T", "location":"2" }
Bin put-away
Example using DSI_BinPutaway
{ "lookup":"", "location":"2", "trandate":"", "memo":"12345678901234567890", "lines":[{ "item":"1314", "bins":[{ "binnumber":"", "binid":"117", "quantity":"1" , "inventorynumber":"", "inventorynumberid":"" },{ "binnumber":"Alpha-2", "binid":"", "quantity":"1" , "inventorynumber":"", "inventorynumberid":"" }] },{ "item":"942", "bins":[{ "binnumber":"Alpha-3", "binid":"", "quantity":"1" , "inventorynumber":"", "inventorynumberid":"" }] }] }
Bin put-away with lot/serial number
Note:Serial number is simply a lot number with quantity one.
Example using DSI_BinPutaway { "lookup":"", "location":"2", "trandate":"", "memo":"12345678901234567890", "lines":[{ "item":"678", "bins":[{ "binnumber":"Alpha-2", "binid":"", "quantity":"100", "inventorynumber":"L-Alpha2", "inventorynumberid":"623" }] }] }
Bins on inventory adjustment
Refer to Basic bins on Inventory Adjustment.
Bins on item receipt
Advanced bins with lot/serial number
Bin and inventory number can be specified by either internalid or number/name.
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "Bubba.Gump@dsiglobal.com",
"fromrecordtype": "purchaseorder",
"fromrecordid": "21179",
"torecordtype": "itemreceipt",
"tolocation": "2",
"location": "",
"sourcefields": [{
"fieldid": "memo",
"value": "Received by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "memo",
"value": "I did this"
}],
"lines": [{
"item": "678",
"qty": "20",
"inventorydetail": {
"tolocation":"2",
"quantity": "20",
"unit": "",
"inventoryassignment":[{
"line": "",
"binnumber": "",
"binid": "117",
"quantity": "10",
"inventorynumber": "NewLot002",
"inventorynumberid": "",
"expirationdate":""
},{
"line": "",
"binnumber": "Alpha-2",
"binid": “",
"quantity": "10",
"inventorynumber": "",
"inventorynumberid": "734",
"expirationdate":""
}]
}]
}]
}
Advanced bins and NO lot/serial number
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "Bubba.Smith@dsiglobal.com",
"fromrecordtype": "purchaseorder",
"fromrecordid": "21992",
"torecordtype": "itemreceipt",
"tolocation": "1",
"sourcefields": [{
"fieldid": "memo",
"value": "Received by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "memo",
"value": "Bins but no inventory number"
}],
"lines": [{
"item": "1314",
"qty": "10",
"inventorydetail": {
"tolocation":"1",
"quantity": "10",
"unit": "",
"inventoryassignment": [{
"line": "",
"binnumber": "Beta-1",
"binid": "",
"quantity": "10"
}]
}
}]
}]
}
Basic bin
If the binnumbers field is blank, NetSuite receives to the item's preferred bin if there is one.
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "ana@dsiglobal.com",
"fromrecordtype": "transferorder",
"tranid": "",
"fromrecordid": "22719664",
"torecordtype": "itemreceipt",
"tolocation": "2",
"sourcefields": [{
"fieldid": "memo",
"value": "Received by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "memo",
"value": "Created with the preferred bin"
}],
"sublists": [{
"sublistid": "item",
"lines": [{
"linenum": "2",
"item": "3524",
"qty": "20",
"binnumbers": "B15108-N(20)",
"serialnumbers": "",
"nvpair": [{
"columnid": "",
"value": ""
}]
}]
}]
}]
}
Change basic bin
Example using DSI_RecordUpdate
{ "internalid": "22720282", "recordtype": "itemreceipt", "entityid": "", "mc_user": "sheil@dsiglobal.com", "updatefields": [{ "fieldid": "memo", "newvalue": "finally in the right bin" }], "updatecolumns": [{ "sublistid": "item", "subrecordname":"", "lines": [{ "line": "1", "remove": "", "nvpair": [{ "columnid": "binnumbers", "newvalue": "Receiving-H(20)" }] }] }] }
Calendar
This example shows how the Calendar NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create calendar even
The example below creates an event for two employees to make a field service call in regards to a supportcase. It could also have been attached to a transaction. A resource (the repair van) is reserved, a start and end time have been set (Pacific time) and the time will be blocked out in their calendars using timedevent. The company and contact have been specified so that the address will auto fill.
If we are doing this with our generic DSI_Rest_User, it is best practice to set the organizer and owner to an actual person rather than defaulting to DSI_Rest_User.
Values for status: TENTATIVE, CONFIRMED, COMPLETED, and CANCELED.
Values for accesslevel: PUBLIC, PRIVATE, and BUSY.
Example using DSI_RecordCreate
{ "recordcategory": "event", "create": [{ "mc_user": "j.jonah.jameson.jr@dsiglobal.com", "recordtype": "calendarevent", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "attendee", "lines": [{ "nvpair": [{ "columnid": "attendee", "newvalue": "1644" },{ "columnid": "sendemail", "newvalue": "T" }] },{ "nvpair": [{ "columnid": "attendee", "newvalue": "1647" }] }] },{ "sublistid": "resource", "lines": [{ "nvpair": [{ "columnid": "resource", "newvalue": "5" }] }] }], "targetfields": [{ "fieldid": "title", "value": "Service Mrs. Douglas' Tent" },{ "fieldid": "organizer", "value": "1647" },{ "fieldid": "owner", "value": "1647" },{ "fieldid": "startdate", "value": "10/25/2016" },{ "fieldid": "starttime", "value": "11:00 AM" },{ "fieldid": "enddate", "value": "10/25/2016" },{ "fieldid": "endtime", "value": "12:00 PM" },{ "fieldid": "timedevent", "value": "T" },{ "fieldid": "company", "value": "2956" },{ "fieldid": "contact", "value": "2655" },{ "fieldid": "supportcase", "value": "101696" },{ "fieldid": "status", "value": "TENTATIVE" }] }] }
Lookup calendar event
Example using DSI_RecordLookup
{ "internalid": "102804", "recordtype": "calendarevent" }
Edit calendar event
This example shows some common edits/updates including mark all attendees' response accepted, change the visibility of the event to public, and remove one of the attendees.
Example using DSI_RecordUpdate
{ "internalid": "103004", "recordtype": "calendarevent", "mc_user": "pepper.potts@dsiglobal.com", "updatefields": [{ "fieldid": "status", "newvalue": "CONFIRMED" },{ "fieldid": "accesslevel", "newvalue": "PUBLIC" }], "updatecolumns": [{ "sublistid": "attendee", "lines": [{ "line": "ALL", "nvpair": [{ "columnid": "response", "newvalue": "ACCEPTED" }] },{ "line": "1", "remove": "T" }] }] }
Complete / bill calendar event
This example marks the event as complete and records time for the employees who worked on it.
Example using DSI_RecordUpdate
{ "internalid": "103004", "recordtype": "calendarevent", "mc_user": "pepper.potts@dsiglobal.com", "updatefields": [{ "fieldid": "status", "newvalue": "COMPLETE" }], "updatecolumns": [{ "sublistid": "timeitem", "lines": [{ "line": "NEW", "nvpair": [{ "columnid": "employee", "newvalue": "1644" },{ "columnid": "hours", "newvalue": "1:45" },{ "columnid": "location", "newvalue": "2" },{ "columnid": "customer", "newvalue": "4062" },{ "columnid": "item", "newvalue": "2024" }] },{ "line": "NEW", "nvpair": [{ "columnid": "employee", "newvalue": "1647" },{ "columnid": "hours", "newvalue": "2:05" },{ "columnid": "location", "newvalue": "2" },{ "columnid": "customer", "newvalue": "2956" },{ "columnid": "item", "newvalue": "2024" },{ "columnid": "rate", "newvalue": "20.35" }] }] }] }
Create work calendar
Required fields: name, starthour, workhoursperday.
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "roudolph.r.deer@dsiglobal.com", "recordtype": "workcalendar", "location": "2", "subsidiary":"1", "targetfields": [{ "fieldid": "name", "value": "Half Day" },{ "fieldid": "workhoursperday", "value": "8" },{ "fieldid": "starthour", "value": "1:00 pm" },{ "fieldid": "sunday", "value": "F" },{ "fieldid": "monday", "value": "T" },{ "fieldid": "tuesday", "value": "T" },{ "fieldid": "wednesday", "value": "T" },{ "fieldid": "thursday", "value": "T" },{ "fieldid": "friday", "value": "T" },{ "fieldid": "saturday", "value": "F" }] }] }
Cash Refund
This example shows how the Cash Refund NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create cash refund
Cash Refund can be created by transforming from cashsale or returnauthorization.
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "josey.pussycats@dsiglobal.com", "fromrecordtype": "cashsale", "fromrecordid": "25648", "torecordtype": "cashrefund", "tolocation": "", "sourcefields": [{ "fieldid": "memo", "value": "refunded by Advanced Inventory" }], "targetfields": [{ "fieldid": "memo", "value": "created by Advanced Inventory" }], "lines": [{ "item": "1314", "qty": "1" }] }] }
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "jem@dsiglobal.com",
"fromrecordtype": "returnauthorization",
"fromrecordid": "30071",
"torecordtype": "cashrefund",
"tolocation": "",
"sourcefields": [{
"fieldid": "memo",
"value": "refunded by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "memo",
"value": "Truly, truly outrageous"
},{
"fieldid": "account",
"value": "1"
}],
"lines": [{
"item": "1314",
"qty": "1"
}]
}]
}
Create standalone cash refund
While not best practice, you can also create a standalone cash refund.
Example using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "h.k.phooey@dsiglobal.com", "recordtype": "cashrefund", "entityid": "2956", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "item", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "1314" },{ "columnid": "quantity", "newvalue": "1" }] }] }], "targetfields": [{ "fieldid": "customer", "value": "2956" },{ "fieldid": "account", "value": "1" }] }] }
Cash Sale
This example shows how the Cash Sale NetSuite process can be accomplished using Advanced Inventory RESTlets.Cash sale is a combined order and fulfillment usually used at point of sale. If applicable, any bin/lot/serial number info is required.
Create a stand-alone cash sale
Example using DSI_RecordCreate
Required fields:
-
Subsidiary
-
Location
-
Entity (customer)
-
One or more item lines with item and quantity
{
"recordcategory": "transaction",
"create": [{
"mc_user": "I.M.Weasel@dsiglobal.com",
"recordtype": "cashsale",
"location": "2",
"subsidiary":"1",
"entityid":"2956",
"sublists": [{
"sublistid": "item",
"lines": [{
"nvpair": [{
"columnid": "item",
"newvalue": "1314"
},{
"columnid": "quantity",
"newvalue": "2"
}],
"inventorydetail": {
"item":"1314",
"location":"2",
"quantity": "2",
"unit": "",
"inventoryassignment": [{
"line": "",
"binnumber": "Alpha-1",
"binid": "",
"quantity": "2",
"inventorynumber": "",
"inventorynumberid": ""
}]
}
},{
"nvpair": [{
"columnid": "item",
"newvalue": "1008"
},{
"columnid": "quantity",
"newvalue": "1"
}]
},{
"nvpair": [{
"columnid": "item",
"newvalue": "1009"
},{
"columnid": "quantity",
"newvalue": "1"
}]
}]
}],
"targetfields": [{
"fieldid": "memo",
"value": "Cash sale created by Advanced Inventory"
},{
"fieldid": "entity",
"value": "2956"
}]
}]
}
Create cash sale from a sales order
When the payment method on the sales order is cash or credit card, bill the order with a Cash Sale.
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "I.R.Babboon@dsiglobal.com", "fromrecordtype": "salesorder", "tranid": "", "fromrecordid": "22707", "torecordtype": "cashsale", "sourcefields": [{ "fieldid": "memo", "value": "Processed by Advanced Inventory" }], "targetfields": [{ "fieldid": "memo", "value": "Cash Sale Created by Advanced Inventory" }] }] }
Create cash sale from customer
Example using DSI_TransactionTransform
Since a Cash Sale acts as its own fulfillment, any bin or serial/lot numbers must be specified.
{
"transform": [{
"mc_user": "Nyota.Uhura@dsiglobal.com",
"fromrecordtype": "customer",
"tranid": "",
"fromrecordid": "2956",
"torecordtype": "cashsale",
"tolocation": "2",
"location": "2",
"sourcefields": [{
"fieldid": "",
"value": ""
}],
"targetfields": [{
"fieldid": "memo",
"value": "Transformed by Advanced Inventory"
}
"lines": [{
"linenum": "1",
"item": "1314",
"qty": "2",
"binnumbers": "",
"serialnumbers": "",
"inventorydetail": {
"item": "1314",
"tolocation": "2",
"unit": "",
"inventoryassignment": [{
"line": "",
"binnumber": "Alpha-2",
"binid": "",
"quantity": "2",
"inventorynumber": "",
"inventorynumberid": "",
"expirationdate": ""
}]
}
}]
}]
}
Create cash sale from an estimate
The line level taxcode is required when transforming from an estimate.
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "Nyota.Uhura@dsiglobal.com",
"fromrecordtype": "estimate",
"tranid": "",
"fromrecordid": "25330",
"torecordtype": "cashsale",
"tolocation": "2",
"location": "2",
"sourcefields": [{
"fieldid": "memo",
"value": "Cash Sale by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "memo",
"value": "Hailing frequency open"
}],
"lines": [{
"linenum": "1",
"item": "1314",
"qty": "1",
"binnumbers": "",
"serialnumbers": "",
"nvpair": [{
"columnid": "taxcode",
"value": "638"
}],
"inventorydetail": {
"item": "1314",
"tolocation": "2",
"quantity": "1",
"unit": "",
"inventoryassignment": [{
"binnumber": "Alpha-1",
"binid": "",
"quantity": "1",
"inventorynumber": "",
"inventorynumberid": ""
}]
}
}]
}]
}
Create cash sale from an opportunity
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "Harold.Wormser@dsiglobal.com", "fromrecordtype": "opportunity", "tranid": "", "fromrecordid": "22913", "torecordtype": "cashsale", "tolocation": "2", "sourcefields": [{ "fieldid": "memo", "value": "Processed by Advanced Inventory" }], "targetfields": [{ "fieldid": "memo", "value": "Cash Sale Created by Advanced Inventory" }], "lines": [{ "linenum": "1", "item": "1314", "qty": "5", "inventorydetail": { "item": "1314", "quantity": "5", "unit": "", "inventoryassignment": [{ "binnumber": "Alpha-1", "binid": "", "tobinnumber": "", "tobinid": "", "quantity": "5", "inventorynumber": "", "inventorynumberid": "", "expirationdate": "" }] } }] }] }
Update / edit a cash sale
Refer to DSI_RecordUpdate for more detailed updates using the record type "cashsale".
Note:The status of a cash sale depends on the existence of other records such as deposits and cannot be changed from the RESTlet.
Close or reopen a cash sale
Example using DSI_RecordUpdate
Set Isclosed to “T” to close or “F” to open. Set line to “ALL” to apply the change to all lines.
{
"internalid": "22813",
"recordtype": "cashsale",
"tranid": "",
"mc_user": "Booger.Dawson@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "Closed by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "item",
"lines": [{
"line": "ALL",
"nvpair": [{
"columnid": "isclosed",
"newvalue": "T"
}]
}]
}]
}
Close or reopen a line on a sales order
Example using DSI_RecordUpdate
Set Isclosed to “T” to close or “F” to open. Set line to the line number, counting from 1.
{
"internalid": "22813",
"recordtype": "cashsale",
"tranid": "",
"mc_user": "Lamar.Latrell@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "Line 1 closed by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "item",
"lines": [{
"line": "1",
"nvpair": [{
"columnid": "isclosed",
"newvalue": "T"
}]
}]
}]
}
Contact
This example shows how the Contact NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create contact
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "William.Gates@dsiglobal.com", "recordtype": "contact", "location": "", "subsidiary": "1", "sublists": [{ "sublistid": "addressbook", "lines": [{ "nvpair": [{ "columnid": "addr1", "newvalue": "1 Haney Place" },{ "columnid": "city", "newvalue": "Hooterville" },{ "columnid": "state", "newvalue": "IL" }], "inventorydetail": { } }] }], "targetfields": [ { "fieldid": "entityid", "value": "Oliver W Douglas" }, { "fieldid": "firstname", "value": "Oliver" }, { "fieldid": "middlename", "value": "Wendell" }, { "fieldid": "lastname", "value": "Douglas" }, { "fieldid": "salutation", "value": "Mr." }, { "fieldid": "title", "value": "Owner" }, { "fieldid": "comments", "value": "Sucker, will buy anything" }] }] }
Credit Memo
This example shows how the Cash Memo NetSuite process can be accomplished using Advanced Inventory RESTlets. A credit memo is a paying transaction that can be used to pay for something else: aka store credit. It could be issued as a non-cash refund, a promotion, or goodwill. Credit memos require the enhanced permission role.
Create credit memo from invoice - full credit
From Invoice fully credit whole invoice.
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "arthur.pendragon@dsiglobal.com",
"fromrecordtype": "invoice",
"fromrecordid": "25634",
"torecordtype": "creditmemo",
"location": "2",
"sourcefields": [{
"fieldid": "",
"value": ""
}],
"targetfields": [{
"fieldid": "memo",
"value": "Credit Memo created by Advanced Inventory"
}]
}]
}
Create credit memo from invoice - partial credit
To credit just specific line(s) and/or less than full amount on line. Note, another linenum field must be specified in the lines nvpair; this is the line number of the item being credited on the invoice.
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "arthur.pendragon@dsiglobal.com", "fromrecordtype": "invoice", "fromrecordid": "25634", "torecordtype": "creditmemo", "location": "2", "sourcefields": [{ "fieldid": "credited by Arthur", "value": "" }], "targetfields": [{ "fieldid": "approvalstatus", "value": "2" }], "sublists": [{ "sublistid": "apply", "subrecordname":"", "lines": [{ "linenum": "1", "serialnumbers": "", "nvpair": [{ "columnid": "amount", "value": "12.99" },{ "columnid": "linenum", "value": "1" }] }] }] }] }
Create credit memo from return authorization (RMA)
From Return Authorization (RMA), the credit memo is not applied to anything. It is created for all the item lines on the RMA; to be applied to a later purchase.
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "Merlin.Ambrosius@dsiglobal.com", "fromrecordtype": "returnauthorization", "fromrecordid": "30071", "torecordtype": "creditmemo", "location": "2", "sourcefields": [{ "fieldid": "", "value": "" }], "targetfields": [{ "fieldid": "approvalstatus", "value": "2" }] }] }
Create standalone credit memo
You can create a stand-alone credit memo associated with an entity (customer) with no transaction.
An unapplied credit memo must have at least one item in the item sublist. NetSuite provides special item types that may be appropriate; such as non-inventory item, other charge, markup, or discount. You can set the rate of an item to credit different amounts.
Example using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "h.k.phooey@dsiglobal.com", "recordtype": "creditmemo", "entityid": "2956", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "item", "subrecordname":"", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "1008" },{ "columnid": "quantity", "newvalue": "1" },{ "columnid": "rate", "newvalue": "125.50" }], }] }], "targetfields": [{ "fieldid": "memo", "value": "credit for 1 Spacely Sprocket" }] }] }
Apply standalone credit memo
The credit must then be “applied” to one or more transactions later using DSI_RecordUpdate. You must specify the linenum of the transaction on the credit memo's apply sublist (use DSI_RecordUpdate or DSI_RunSearch).
Example using DSI_RecordUpdate
{ "internalid": "32777", "recordtype": "creditmemo", "tranid": "", "mc_user": "guinevere.pendragon@dsiglobal.com", "updatefields": [{ "fieldid": "memo", "newvalue": "Applied to INV10000006" }], "updatecolumns": [{ "sublistid": "apply", "subrecordname":"", "lines": [{ "line": "1", "nvpair": [{ "columnid": "apply", "newvalue": "T" },{ "columnid": "amount", "newvalue": "24.50" }] },{ "line": "2", "nvpair": [{ "columnid": "apply", "newvalue": "T" },{ "columnid": "amount", "newvalue": "75.50" }] }] }] }
CSV Download
This example shows how the CSV Download NetSuite process can be accomplished using Advanced Inventory RESTlets.
Refer to Generate a CSV file from search results.
CSV Import
This example shows how the CSV Import NetSuite process can be accomplished using Advanced Inventory RESTlets.
Import a Sales Order as a CSV String
Example using DSI_Import CSV
{ "mapping": "16", "csvString": "external ID,Date,Customer,Location,Order No,Expected Ship Date,item,qty,customform~DSI20170320-5,3/21/2017,2956,2,,6/12/2017,95,1,174~DSI20170320-5,3/21/2017,2956,2,,6/12/2017,113,1,174~DSI20170320-5,3/21/2017,2956,2,,6/12/2017,123,2,174", "jobName": "Thursday Import" }
Import a Sales Order from a CSV File
Example using DSI_ImportCSV
{ "mapping": "16", "csvFileid": "17717", "jobName": "" }
Customer
This example shows how the Customer NetSuite process can be accomplished using Advanced Inventory RESTlets.
Attach primary contact to customer
Example using DSI_RecordUpdate
{ "internalid": "2956", "recordtype": "customer", "mc_user": "Bill.Gates@dsiglobal.com", "entityid": "", "updatefields": [{ "fieldid": "contact", "newvalue": "2555" }] }
Create customer
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "William.Gates@dsiglobal.com", "recordtype": "customer", "entityid": "", "location": "", "subsidiary": "1", "sublists": [{ "sublistid": "addressbook", "subrecordname":"inventorydetails", "lines": [{ "nvpair": [{ "columnid": "addr1", "newvalue": "1 Haney Place" }, { "columnid": "city", "newvalue": "Hooterville" }, { "columnid": "state", "newvalue": "IL" }], "inventorydetail": { } }] }], "targetfields": [{ "fieldid": "companyname", "value": "Douglas Farm" }, { "fieldid": "isperson", "value": "F" }, { "fieldid": "email", "value": "lovefarming421@douglasfarm.com" }, { "fieldid": "title", "value": "Mr." }, { "fieldid": "contact", "value": "2555" }, { "fieldid": "contact", "value": "2655" }, { "fieldid": "comments", "value": "Sucker, will buy anything" }] }] }
Customer statement
Refer to Print via NetSuite examples.
Customer Payment
This example shows how the Customer Payment NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create payment from invoice
Refer to the Invoice examples.
-
Apply full payment
-
Apply partial payment
Create payment from customer
When the invoice to pay is known, the call is similar to creating the payment from an invoice.
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "nobody@dsiglobal.com",
"fromrecordtype": "customer",
"fromrecordid": "2956",
"torecordtype": "customerpayment",
"sourcefields": [{
"fieldid": "memo",
"value": "payment processed by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "approvalstatus",
"value": "2"
}],
"sublists": [{
"sublistid": "apply",
"subrecordname":"",
"lines": [{
"linenum": "",
"refnum":"INV10000006",
"nvpair": [{
"columnid": "amount",
"value": "24.03"
}]
}]
}]
}]
}
Create payment from customer - no invoice
When not applying the payment as it is created, the target field, payment, is required The payment must then be “applied” to one or more transactions later using DSI_RecordUpdate.
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "everybody@dsiglobal.com",
"fromrecordtype": "customer",
"fromrecordid": "2956",
"torecordtype": "customerpayment",
"sourcefields": [{
"fieldid": "memo",
"value": "payment processed by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "payment",
"value": "24.03"
},{
"fieldid": "approvalstatus",
"value": "2"
}]
}]
}
The payment must then be “applied” to one or more transactions later using DSI_RecordUpdate.
Example using DSI_RecordUpdate
{ "internalid": "32077", "recordtype": "customerpayment", "tranid": "", "mc_user": "guy.smiley@dsiglobal.com", "updatefields": [{ "fieldid": "memo", "newvalue": "Applied to INV10000006" }], "updatecolumns": [{ "sublistid": "apply", "subrecordname":"", "lines": [{ "line": "1", "nvpair": [{ "columnid": "apply", "newvalue": "T" },{ "columnid": "amount", "newvalue": "24.03" }] }] }] }
Email / Message
This example shows how the Email/Message NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create a message
-
The author field must be an entity's (customer, employee etc.) internalid; it can be omitted if an email address is specified in authoremail.
-
The recipient field must be an entity's internal id; it can be omitted if an email address is specified in recipientemail.
-
The cc and bcc fields can contain multiple, comma separated, email addresses. (NOT internalid).
-
The message field can be plain text or HTML.
-
Attachments are specified by internalid in the mediaitem sublist.
Example using DSI_RecordCreate
{ "recordcategory": "event", "create": [{ "mc_user": "Arnold.Poindexter@dsiglobal.com", "recordtype": "message", "sublists": [{ "sublistid": "mediaitem", "lines": [{ "nvpair": [{ "columnid": "mediaitem", "newvalue": "6858" }] }] }], "targetfields": [ "fieldid": "recipient", "value": "1647" },{ "fieldid": "recipientemail", "value": "rob.grier@dsiglobal.com" },{ "fieldid": "author", "value": "1648" },{ "fieldid": "authoremail", "value": "dsi_rest@dsiglobal.com" },{ "fieldid": "subject", "value": "Notice" },{ "fieldid": "message", "value":"<HTML><HEAD><meta http-equiv='Content-Type' content='text/html;charset=UTF-8'><HEAD><BODY>This is a notification. Picture attached.</BODY></HTML>" },{ "fieldid": "cc", "value": "Lewis.Skolnick@trilambda.com,Gilbert.Lowell@trilambda.com,Judy.Lowell@OmegaMu.com" },{ "fieldid": "bcc", "value": "Ogre.Palowakski@AlphaBeta.com,Stan.Gable@AlphaBeta.com,Betty.Childs@PiDeltaPi.com" }] }] }
Email Template
This example shows how the Email Template NetSuite process can be accomplished using Advanced Inventory RESTlets.
All email campaigns must meet the terms of the NetSuite Anti-spamming policy and may not exceed 50KB per email. Email templates can be scriptable templates that use Freemarker language. Example: ${salesRep.MESSAGE_SIGNATURE}.
Note: Email templates that use external files (mediaitem field) cannot be created from RESTlets.
Create a email template
Required fields:
-
name
-
addunsubscribelink (must be “T” per NetSuite Anit-spam policy for email marketing campaign)
Other commonly used fields:
-
addcompanyadress
-
subject
-
content
-
recordtype - the associated record type for Freemarker tag insertion
Example using DSI_RecordCreate
{ "recordcategory": "event", "create": [{ "mc_user": "dewey.duck@dsiblobal.com", "recordtype": "emailtemplate", "targetfields": [{ "fieldid": "name", "value": "Tent Sale Blast" },{ "fieldid": "recordtype", "value": "ENTITY" },{ "fieldid": "addunsubscribelink", "value": "T" },{ "fieldid": "addcompanyaddress", "value": "T" },{ "fieldid": "subject", "value": "New Customer Discount" },{ "fieldid": "content", "value": "<p style='font-face:verdana'>Welcome new customers. Use the promo code BOGO for a special discount.</p><p='font-face:verdana'>Looking forward to working with you!<br>Welcome aboard,</br>${salesRep.MESSAGE_SIGNATURE}</p>" }] }] }
Lookup an email template
Email Template records can be looked up using DSI_RecordLookup with an internalid only. This is because searches for the emailtemplate record type are not allowed by NetSuite.
Example using DSI_RecordLookup
{ "internalid": "17", "recordtype": "emailtemplate" }
Update an email template
Email Template records can be updated using DSI_RecordUpdate with an internalid only. This is because searches for the emailtemplate record type are not allowed by NetSuite.
Example using DSI_RecordUpdate
{ "internalid": "17", "recordtype": "emailtemplate", "mc_user": "daisy.duck@dsiglobal.com", "updatefields": [{ "fieldid": "subject", "newvalue": "January Customer Appreciation Invitation" }] }
Employee
This example shows how the Employee NetSuite process can be accomplished using Advanced Inventory RESTlets.
Edit time
Example using DSI_RecordUpdate
{
"internalid": "2796",
"recordtype": "timebill",
"mc_user": "jp.morgan@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "Updated by Advanced Inventory"
},{
"fieldid": "hours",
"newvalue": "2:45"
}]
}
Update an employee
This example demonstrates updating the employee's contact information including the addressbook sub-record.
Note: To add an address rather than edit an existing one, use “NEW” in place of the line number in updatecolumns[].lines[].line
Example using DSI_RecordUpdate
{ "internalid": "1652", "recordtype": "employee", "entityid": "", "mc_user": "howard.hughes@dsiglobal.com", "updatefields": [{ "fieldid": "firstname", "newvalue": "Kirk" },{ "fieldid": "lastname", "newvalue": "Hasenzahl" },{ "fieldid": "phone", "newvalue": "(816)416-5200" },{ "fieldid": "officephone", "newvalue": "(816)416-5201" },{ "fieldid": "mobilephone", "newvalue": "(816)416-5202" },{ "fieldid": "homephone", "newvalue": "(816)416-5203" },{ "fieldid": "fax", "newvalue": "(816)416-5204" }], "updatecolumns": [{ "sublistid": "addressbook", "subrecordname":"addressbookaddress", "lines": [{ "line": "1", "remove": "", "nvpair": [{ "columnid": "defaultshipping", "newvalue": "T" },{ "columnid": "defaultbilling", "newvalue": "T" },{ "columnid": "label", "newvalue": "Main Address" },{ "columnid": "isresidential", "newvalue": "T" }], "subrecorddetail": { "nvpair": [{ "columnid": "country", "newvalue": "US" },{ "columnid": "attention", "newvalue": "Kirk" },{ "columnid": "addressee", "newvalue": "Kirk Hasenzahl" },{ "columnid": "addrphone", "newvalue": "(816)416-5205" },{ "columnid": "addr1", "newvalue": "501 N. Main" },{ "columnid": "addr2", "newvalue": "Ste. 202" },{ "columnid": "addr3", "newvalue": "" },{ "columnid": "city", "newvalue": "Wichita" },{ "columnid": "dropdownstate", "newvalue": "KS" },{ "columnid": "zip", "newvalue": "67201" }] } }] }] }
Enter expense report
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "upton.sinclair@dsiglobal.com", "recordtype": "expensereport", "location": "", "account":"", "subsidiary":"", "targetfields": [{ "fieldid": "entity", "value": "1652" },{ "fieldid": "status", "value": "F" },{ "fieldid": "memo", "value": "Client Lunch" }], "sublists": [{ "sublistid": "expense", "subrecordname":"", "lines": [{ "nvpair": [{ "columnid": "expensedate", "newvalue": "11/22/2016" },{ "columnid": "category", "newvalue": "2" },{ "columnid": "currency", "newvalue": "1" },{ "columnid": "amount", "newvalue": "173.59" },{ "columnid": "receipt", "newvalue": "T" },{ "columnid": "memo", "newvalue": "Wine and Dine" }] },{ "nvpair": [{ "columnid": "expensedate", "newvalue": "11/22/2016" },{ "columnid": "category", "newvalue": "3" },{ "columnid": "currency", "newvalue": "1" },{ "columnid": "amount", "newvalue": "44.63" },{ "columnid": "receipt", "newvalue": "T" },{ "columnid": "memo", "newvalue": "Drive to Wichita" }] }] }] }] }
Edit expense report
Requires the enhanced permissions role.
Example using DSI_RecordUpdate
{ "internalid": "37238", "recordtype": "expensereport", "mc_user": "dougie.howser@dsiglobal.com", "updatefields": [{ "fieldid": "trandate", "newvalue": "11/30/2016" }], "updatecolumns": [{ "sublistid": "expense", "subrecordname":"", "lines": [{ "line": "1", "remove": "", "nvpair": [{ "columnid": "expensedate", "newvalue": "12/02/2016" }] },{ "line": "2", "remove": "", "nvpair": [{ "columnid": "memo", "newvalue": "207 miles to Wichita" }] }] }] }
Entity Group
This example shows how the Entity Group NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create an entity group
Initialization Fields are important.
The group type, grouptype, and dynamic flag, dynamic, are required fields and must be set using initvalue NOT targetfields when creating an entity group. Values for grouptype include: CustJob, Employee, and SalesTeam.
Required initialization fields:
-
grouptype
-
dynamic
Billing group
To create a billing group, set the billinggroup field to T. This is the only difference between billing groups and other entity groups.
Required fields (targetfields array):
-
groupname
-
groupowner (an employee internal id)
-
entitygrouptype
-
savedsearch (when dynamic is T)
-
one or more groupmembers lines (when dynamic is F)
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "junior.samples@dsiglobal.com", "recordtype": "entitygroup", "initvalues": [{ "fieldid": "grouptype", "value": "CustJob" },{ "fieldid": "dynamic", "value": "T" }], "targetfields": [{ "fieldid": "groupowner", "value": "1647" },{ "fieldid": "entitygrouptype", "value": "Customer" },{ "fieldid": "comments", "value": "Sample Sales" },{ "fieldid": "groupname", "value": "BR549" },{ "fieldid": "savedsearch", "value": "10" },{ "fieldid": "billinggroup", "value": "T" }] }] }
Update an Entity Group
Entity Groups can be updated using DSI_RecordUpdate like any other entity.
Example using DSI_RecordUpdate
{ "internalid": "5473", "recordtype": "entitygroup", "mc_user": "grandps.jones@dsiglobal.com", "updatefields": [{ "fieldid": "comments", "newvalue": "call BR-549" },{ "fieldid": "billinggroup", "newvalue": "F" }], "updatecolumns": [{ "sublistid": "", "lines": [{ "line": "", "remove": "", "nvpair": [{ "columnid": "", "newvalue": "" }] }] }] }
Estimate / Quote
This example shows how the Estimate/Quote NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create an estimate
Required fields:
-
subsidiary
-
location
-
entityid (customer)
-
One or more item lines with item and quantity
-
Probability
Example using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "Kelly.Garrett@dsiglobal.com", "recordtype": "estimate", "tranid": "", "entityid": "2956", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "item", "subrecordname":"", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "113" },{ "columnid": "quantity", "newvalue": "2" }] },{ "nvpair": [{ "columnid": "item", "newvalue": "124" },{ "columnid": "quantity", "newvalue": "1" },{ "columnid": "rate", "newvalue": "409.00" }] }] }], "targetfields": [{ "fieldid": "probability", "value": "50" },{ "fieldid": "expectedclosedate", "value": "11/15/2016" },{ "fieldid": "leadsource", "value": "100026" }] }] }
Create estimate from opportunity
The sales process can start with an opportunity from which one or more estimates can be created.
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "Jill.Munroe@dsiglobal.com", "fromrecordtype": "opportunity", "tranid": "", "fromrecordid": "22913", "torecordtype": "estimate", "tolocation": "2", "sourcefields": [{ "fieldid": "memo", "value": "Processed by Advanced Inventory" }], "targetfields": [{ "fieldid": "memo", "value": "Quote Created by Advanced Inventory" }], "lines": [{ "linenum": "1", "item": "1314", "qty": "5" }] }] }
Look up an estimate
Estimates can be looked up using DSI_RecordLookup like any other transaction. Below is a simple example.
Example using DSI_RecordLookup
{ "internalid": "29467", "recordtype": "estimate", "tranid": "QUO00001141" }
Update an estimate
Estimates can be updated using DSI_RecordUpdate like any other transaction. Below is a simple example.
Example using DSI_RecordUpdate
{
"internalid": "29367",
"recordtype": "estimate",
"tranid": "QUO00001140",
"mc_user": "Sabrina.Duncan@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "updated by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "item",
"lines": [{
"line": "1",
"nvpair": [{
"columnid": "quantity",
"newvalue": "3"
}],
}]
}]
}
Delete an estimate
Estimates can be deleted using DSI_RecordDelete like any other transaction. Below is a simple example.
Example using DSI_RecordDelete
{ "internalid": "29467", "recordtype": "estimate", "tranid": "QUO00001141" }
Files
This example shows how the Files NetSuite process can be accomplished using Advanced Inventory RESTlets.
Upload a file
This example uploads a JPG image to the default images folder, and attaches it to a customer record.
Example using DSI_UploadFile
{ "mc_user": "bruce.banner@dsiglobal.com", "filename": "Broken Part", "filetype": "JPGIMAGE", "filefolder": "-4", "attachto": "2956", "attachtype": "customer", "description": "This is a drawing of the ends of asparagus", "requirelogin": "", "data": "[TEXT or BASE 64 ENCODED]" }
Attach an existing file
Example using DSI_AttachFile
{ "mc_user": "b4ugogo@dsiglobal.com", "fileid": "6860", "attachto": "2956", "attachtype": "customer" }
Download a file
Example using DSI_DownloadFile
{ "fileid": "8370" }
Create and save a CSV or PDF file from search results
The DSI_RunSearch restlet can create files from it's results. Refer to Generate a CSV file from search results and Generate an inventory file from search results.
Fixed Assets
This example shows how the Fixed Assets NetSuite process can be accomplished using Advanced Inventory RESTlets.
All Fixed Asset functions require the Enhance Permission role, which has the extra custom record permissions.
Create asset type
Example using DSI_RecordCreate
{ "recordcategory": "custom", "create": [{ "mc_user": "River.Tamm@dsiglobal.com", "recordtype": "customrecord_ncfar_assettype", "targetfields": [{ "fieldid": "name", "value": "Atmosphere" },{ "fieldid": "custrecord_assettypedescription", "value": "Air" },{ "fieldid": "custrecord_assettypeaccmethod", "value": "2" },{ "fieldid": "custrecord_assettyperesidperc", "value": "50" },{ "fieldid": "custrecord_assettypelifetime", "value": "12" },{ "fieldid": "custrecord_assettypedepractive", "value": "2" },{ "fieldid": "custrecord_assettyperevisionrules", "value": "2" },{ "fieldid": "custrecord_assettypedeprrules", "value": "1" },{ "fieldid": "custrecord_assettypedeprperiod", "value": "1" }] }] }
Create asset record manually
Example using DSI_RecordCreate
{ "recordcategory": "custom", "create": [{ "mc_user": "Kaylee.Frye@dsiglobal.com", "recordtype": "customrecord_ncfar_asset", "targetfields": [{ "fieldid": "altname", "value": "Nitrogen" },{ "fieldid": "custrecord_assettype", "value": "6" },{ "fieldid": "custrecord_assetdescr", "value": "78% of atmosphere" },{ "fieldid": "custrecord_assetdeprperiod", "value": "1" },{ "fieldid": "custrecord_assetcost", "value": "500" },{ "fieldid": "custrecord_assetresidualvalue", "value": "250" },{ "fieldid": "custrecord_assetaccmethod", "value": "3" },{ "fieldid": "custrecord_assettyperevisionrules", "value": "2" },{ "fieldid": "custrecord_assetlifetime", "value": "60" }] }] }
Create asset proposal for PO
Example using DSI_RecordCreate
{ "recordcategory": "custom", "create": [{ "mc_user": "Malcolm.Reynolds@dsiglobal.com", "recordtype": "customrecord_ncfar_assetproposal", "targetfields": [{ "fieldid": "altname", "value": "Nitrogen" },{ "fieldid": "custrecord_propassettype", "value": "6" },{ "fieldid": "custrecord_propstatus", "value": "1" },{ "fieldid": "custrecord_propassetdescr", "value": "Office Air" },{ "fieldid": "custrecord_propassetlifetime", "value": "60" },{ "fieldid": "custrecord_assetresidualvalue", "value": "250" },{ "fieldid": "custrecord_propsubsidiary", "value": "3" },{ "fieldid": "custrecord_proplocation", "value": "6" },{ "fieldid": "custrecord_propdeprperiod", "value": "1" },{ "fieldid": "custrecord_assetlifetime", "value": "60" },{ "fieldid": "custrecord_proppurchaseorder", "value": "40651" },{ "fieldid": "custrecord_propmainacc", "value": "16" },{ "fieldid": "custrecord_propdepracc", "value": "19" }] }] }
Update/Edit asset record manually
Example using DSI_RecordUpdate
{ "internalid": "155", "recordtype": "customrecord_ncfar_asset", "mc_user": "Zoe.Washburne@dsiglobal.com", "updatefields": [{ "fieldid": "custrecord_assetdescr", "newvalue": "77.95% of atmosphere" },{ "fieldid": "custrecord_assetcost", "newvalue": "555.95" }] }
Asset split
To split an asset into two assets, simply update the quantity of the existing asset, then create a new asset with the difference in quantity. In this example, asset 158 has a 10 quantity. At the end, asset 158 has 8 quantity and asset 159 has 2 quantity.
Example using DSI_RecordUpdate
{ "internalid": "158", "recordtype": "customrecord_ncfar_asset", "mc_user": "Simon.Tamm@dsiglobal.com", "updatefields": [{ "fieldid": "custrecord_ncfar_quantity", "newvalue": "8" }] }
Example using DSI_RecordCreate
{ "recordcategory": "custom", "create": [{ "mc_user": "Simon.Tamm@dsiglobal.com", "recordtype": "customrecord_ncfar_asset", "targetfields": [{ "fieldid": "altname", "value": "Carbon Dioxide 2" },{ "fieldid": "custrecord_ncfar_quantity", "value": "2" },{ "fieldid": "custrecord_assettype", "value": "6" },{ "fieldid": "custrecord_assetdescr", "value": "0.1% of atmosphere" },{ "fieldid": "custrecord_assetdeprperiod", "value": "1" },{ "fieldid": "custrecord_assetcost", "value": "0.72" },{ "fieldid": "custrecord_assetresidualvalue", "value": "0" },{ "fieldid": "custrecord_assetaccmethod", "value": "2" },{ "fieldid": "custrecord_assetlifetime", "value": "600" }] }] }
Inventory Adjustment
This example shows how the Inventory Adjustment NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create inventory adjustment
Example using DSI_RecordCreate
{
"recordcategory": "transaction",
"create": [{
"mc_user": "I.M.Weasel@dsiglobal.com",
"recordtype": "inventoryadjustment",
"entityid": "",
"location": "2",
"subsidiary":"1",
"sublists": [{
"sublistid": "inventory",
"lines": [{
"nvpair": [{
"columnid": "item",
"newvalue": "1314"
},{
"columnid": "adjustqtyby",
"newvalue": "2"
}],
"inventorydetail": {
"item":"1314",
"unit": "",
"inventoryassignment": [{
"line": "",
"binnumber": "Alpha-2",
"binid": "",
"quantity": "2",
"inventorynumber": "",
"inventorynumberid": ""
}]
}
},{
"nvpair": [{
"columnid": "item",
"newvalue": "1009"
},{
"columnid": "adjustqtyby",
"newvalue": "1"
}]
}]
}],
"targetfields": [{
"fieldid": "memo",
"value": "Adjustment created by Advanced Inventory"
}]
}]
}
Basic bins on inventory adjustment
Basic bins utilize the binnumbers column in the item list. Bins are entered in the format BINNAME(QTY) and can have more than one bin, space delimited.
Example using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "stimpson.j.cat@dsiglobal.com", "recordtype": "inventoryadjustment", "tranid": "", "location": "2", "account": "133", "subsidiary": "", "sublists": [{ "sublistid": "inventory", "subrecordname": "", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "3524" }, { "columnid": "adjustqtyby", "newvalue": "-10" }, { "columnid": "memo", "newvalue": "Adjustment line created by Advanced Inventory" }, { "columnid": "location", "newvalue": "2" }, { "columnid": "binnumbers", "newvalue": "RECEIVING-H(10)" }] }] }], "targetfields": [{ "fieldid": "memo", "value": "Created by Advanced Inventory" }] }] }
Inventory (Cycle) Count
This example shows how the Inventory (Cycle) Count NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create inventory count
Example using DSI_RecordCreate
Notes:
-
The subsidiary and location are required.
-
If no Default Inventory Count Account has been set up, the account field (internal id) is required.
-
If counting an item in more than one bin, each bin must be on a separate line.
{ "recordcategory": "transaction", "create": [{ "mc_user": "michael.mouse@dsiglobal.com", "recordtype": "inventorycount", "tranid": "", "location": "2", "subsidiary": "1", "sublists": [{ "sublistid": "item", "lines": [{ "junk": "Bug work-around for App Studio", "nvpair": [{ "columnid": "item", "newvalue": "1214" }] },{ "junk": " Bug work-around for App Studio", "nvpair": [{ "columnid": "item", "newvalue": "678" },{ "columnid": "binnumber", "newvalue": "117" }] },{ "junk": " Bug work-around for App Studio", "nvpair": [{ "columnid": "item", "newvalue": "678" },{ "columnid": "binnumber", "newvalue": "118" }] }] }], "targetfields": [{ "fieldid": "sortrowsbybin", "value": "T" },{ "fieldid": "countbinswithzeroqty", "value": "T" },{ "fieldid": "invcountstartdate", "value": "" },{ "fieldid": "invcountenddate", "value": "" },{ "fieldid": "transactionnumber", "value": "" },{ "fieldid": "memo", "value": "RESTlet did this" }] }] }
Look up inventory count
Example using DSI_RecordLookup
Refer to DSI_RecordLookup for more detailed searching.
{ "internalid": "", "recordtype": "inventorycount", "tranid": "" }
Enter inventory counts
Example using DSI_RecordUpdate
Non-advanced Bin/Lot/Serial items only.
{
"internalid": "21056",
"recordtype": "inventorycount",
"tranid": "",
"mc_user": "Bill.Gates@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "Updated by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "item",
"lines": [{
"line": "3",
"nvpair": [{
"columnid": "countquantity",
"newvalue": "12"
}]
}]
}]
}
Invoice
This example shows how the Invoice NetSuite process can be accomplished using Advanced Inventory RESTlets.
From customer, estimate, opportunity, salesorder, project.
approvalstatus values: 1 = pending approval, 2 = approved
Create invoice
A standalone invoice not directly connected to an order.
Example using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "shaggy.rogers@dsiglobal.com", "recordtype": "invoice", "entityid": "2956", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "item", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "950" },{ "columnid": "quantity", "newvalue": "1" },{ "columnid": "createdfrom", "newvalue": "26547" }] }] }], "targetfields": [{ "fieldid": "approvalstatus", "value": "2" }] }] }
Create invoice - from order
Fully Bill
Fully billing/invoicing everything not already billed.
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "e.scrooge@dsiglobal.com", "fromrecordtype": "salesorder", "fromrecordid": "26547", "torecordtype": "invoice" , "targetfields": [{ "fieldid": "approvalstatus", "value": "2" }] }] }
Partial Bill
Partial billing/invoicing either partial quantities or partial lines requires the sublist object. Generally bins and lot/serial numbers will be inherited from the sales order and don't need to be specified in the invoice.
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "bob.cratchet@dsiglobal.com", "fromrecordtype": "salesorder", "fromrecordid": "28956", "torecordtype": "invoice", "sourcefields": [{ "fieldid": "memo", "value": "invoiced line 1 and qty 1 of 10 line 3" }], "targetfields": [{ "fieldid": "memo", "value": "partial invoice from SLS00000664" },{ "fieldid": "approvalstatus", "value": "2" }], "sublists": [{ "sublistid": "item", "subrecordname":"", "lines": [{ "linenum": "1", "item": "2022", "qty": "1", "nvpair": [{ "columnid": "", "value": "" }] },{ "linenum": "3", "item": "505", "qty": "1", "nvpair": [{ "columnid": "class", "value": "3" }] }] }] }] }
Bill invoice - payment
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "nobody@dsiglobal.com",
"fromrecordtype": "invoice",
"fromrecordid": "30976",
"torecordtype": "customerpayment",
"sourcefields": [{
"fieldid": "memo",
"value": "payment processed by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "approvalstatus",
"value": "2"
}
}],
"sublists": [{
"sublistid": "apply",
"lines": [{
"refnum":"INV10000012",
"nvpair": [{
"columnid": "amount",
"value": "100.00"
}]
}]
}]
}]
}
Item
This example shows how the Item NetSuite process can be accomplished using Advanced Inventory RESTlets.
Required fields for all items: itemid, taxschedule.
Required for all assembly, kit, and group: member sublist with at least one name-value pair.
Create inventory item
Example using DSI_RecordCreate
{ "recordcategory": "item", "create": [{ "mc_user": "Charles.Babbage@dsiglobal.com", "recordtype": "inventoryitem", "itemid": "My Other Restful Item", "location": "2", "subsidiary": "1", "sublists": [{ "sublistid": "", "subrecordname":"", "lines": [{ "nvpair": [{ "columnid": "", "newvalue": "" }], "inventorydetail": { } }] }], "targetfields": [{ "fieldid": "displayname", "value": "Other Item of Restful Goodness" },{ "fieldid": "featureddescription", "value": "Other Item of Restful Goodness: So there!" },{ "fieldid": "salesdescription", "value": "Other Item of Restful Goodness: Buy it, it's restful." },{ "fieldid": "isonline", "value": "T" }], "pricematrix": [{ "row": "1", "column": "1", "currencyid": "1", "newprice": "24.95" },{ "row": "1", "column": "1", "currencyid": "2", "newprice": "10.00" }] }] }
Create assembly / kit / group item
Example using DSI_RecordCreate
{ "recordcategory": "item", "create": [{ "mc_user": "Charles.Babbage@dsiglobal.com", "recordtype": "assemblyitem", "itemid": "My Restful Assembly", "location": "2", "subsidiary": "1", "sublists": [{ "sublistid": "member", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "1314" },{ "columnid": "quantity", "newvalue": "2" }], "inventorydetail": { } },{ "nvpair": [{ "columnid": "item", "newvalue": "1214" },{ "columnid": "quantity", "newvalue": "1" }] }] }], "targetfields": [{ "fieldid": "displayname", "value": "Assembly Item of Restful Goodness" },{ "fieldid": "featureddescription", "value": "Assembly Item of Restful Goodness: So there!" },{ "fieldid": "salesdescription", "value": "Assembly Item of Restful Goodness: Buy it, it's restful and good." },{ "fieldid": "taxschedule", "value": "1" }] }] }
Item Fulfillment
This example shows how the Item Fulfillment NetSuite process can be accomplished using Advanced Inventory RESTlets.
Refer to Fulfill a sales order.
Item Supply Plan
This example shows how the Item Supply Plan NetSuite process can be accomplished using Advanced Inventory RESTlets.
The DSI_MobileClient_User_Enhanced_Permission role is required to create or edit a supply plan. The standard DSI_MobileClient_User role only has access to view supply plans.
Create supply plan
In the order sublist, ordertype values are one of the following: PurchOrd, WorkOrd, or TrnfrOrd.
Required Fields
-
Body
-
item
-
subsidiary (required if One World account)
-
location (required if Multilocation is enabled)
-
-
Order Sublist
-
orderdate
-
ordertype
-
quantity
-
receiptdate (cannot be earlier than the orderdate)
-
sourcelocation (required if ordertype is TrnfrOrd)
-
Example using DSI_RecordCreate
{
"recordcategory": "transaction",
"create": [{
"mc_user": "bruce.banner@dsiglobal.com",
"recordtype": "itemsupplyplan",
"location": "2",
"subsidiary":"1",
"sublists": [{
"sublistid": "order",
"lines": [{
"junk":"MEP bug work around",
"nvpair": [{
"columnid": "orderdate",
"newvalue": "12/14/2016"
},{
"columnid": "ordertype",
"newvalue": "WorkOrd"
},{
"columnid": "quantity",
"newvalue": "10"
},{
"columnid": "receiptdate",
"newvalue": "12/15/2016"
},{
"columnid": "sourcelocation",
"newvalue": ""
}]
}]
}],
"targetfields": [{
"fieldid": "item",
"value": "993"
},{
"fieldid": "units",
"value": ""
},{
"fieldid": "memo",
"value": "Created by Advanced Inventory"
}]
}]
}
Update/edit an item supply plan
See the Required fields above. The item, location, and units body fields cannot be changed in update operations.
Example using DSI_RecordUpdate
{
"internalid": "155",
"recordtype": "itemsupplyplan",
"mc_user": "david.banner@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "Updated by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "order",
"lines": [{
"line": "1",
"remove": "",
"nvpair": [{
"columnid": "ordertype",
"newvalue": "TrnfrOrd"
},{
"columnid": "sourcelocation",
"newvalue": "1"
}]
}]
}]
}
Lead
This example shows how the Lead NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create a lead
The entityid is generated from the required companyname field. If this is a NetSuite OneWorld account, subsidiary is also required.
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "patros.chronos@dsiglobal.com", "recordtype": "lead", "subsidiary":"1", "sublists": [{ "sublistid": "addressbook", "subrecordname":"inventorydetails", "lines": [{ "nvpair": [{ "columnid": "addr1", "newvalue": "1201 Boardwalk" }, { "columnid": "city", "newvalue": "Monopolyville" }, { "columnid": "state", "newvalue": "NJ" }] }] }], "targetfields": [{ "fieldid": "companyname", "value": "The Dude Abides Inc." },{ "fieldid": "email", "value": "dude@abides.com" },{ "fieldid": "phone", "value": "(913) 555-1212" },{ "fieldid": "salesrep", "value": "4066" }] }] }
Look up a lead
Lead records can be looked up using DSI_RecordLookup or DSI_RunSearch. Below are simple examples.
Example using DSI_RecordLookup
{ "internalid": "", "recordtype": "lead", "searchfields": [{ "fieldid": "email", "operator": "startswith", "searchvalue": "dude" }] }
Example using DSI_RunSearch
{ "searchtype": "lead", "searchfilters": [{ "fieldid": "entityid", "operator": "startswith", "searchvalue": "The Dude Abides", "searchvalue2": "", "join": "" }], "searchcolumns": [{ "fieldid": "email" },{ "fieldid": "phone" }] }
Update a lead
Lead records can be updated up using DSI_RecordUpdate. Below is a simple example.
Example using DSI_RecordUpdate
{ "internalid": "4268", "recordtype": "lead", "entityid": "", "updatefields": [{ "fieldid": "altemail", "newvalue": "dudette@abides.com" }] }
Marketing Campaign
This example shows how the Marketing Campaign NetSuite process can be accomplished using Advanced Inventory RESTlets.
Campaign records are used to manage marketing initiatives in both online marketing as well as offline efforts. Campaigns also manage email marketing messages, manage paid keywords, snail mail, and promo codes. Campaigns can also be used to track leads, lead sources and the effectiveness of search engine keywords.
All access to create, lookup, update or delete a campaign requires the Advanced Inventory Enhanced Permission role.
Campaign record
See the NetSuite records browser for a full list of fields.
Required fields.
-
title
-
startdate
Other commonly used fields.
-
owner (filter manager) - manager in charge of this campaign (internal ID of employee record)
-
enddate
-
keyword and the associated searchengine and family (internal ID of campaign family record)
-
landing page url
-
category (internal ID of campaign category record)
-
audience (internal ID of campaign audience record)
-
vertical (internal ID of campaign vertical record)
-
promotioncode and an array of item to which it applies
A marketing campaign can have additional email, drip/lead nurturing, and direct mail campaigns added to it. To add them at create, use the same structure as the DSI_RecordUpdate examples below.
Create a campaign
Example using DSI_RecordCreate
{ "recordcategory": "event", "create": [{ "mc_user": "scrooge.mcduck@dsiglobal.com", "recordtype": "campaign", "targetfields": [{ "fieldid": "title", "value": "Hatchling's Tent Campaign" },{ "fieldid": "owner", "value": "4066" },{ "fieldid": "startdate", "value": "1/9/2017" },{ "fieldid": "enddate", "value": "1/13/2017" },{ "fieldid": "item", "value": ["1314","1920"] },{ "fieldid": "keyword", "value": "TENT" },{ "fieldid": "category", "value": "-11" },{ "fieldid": "promotioncode", "value": "15" },{ "fieldid": "url", "value": "http://www.tentbogo.com" },{ "fieldid": "basecost", "value": "10000" },{ "fieldid": "vertical", "value": "2" },{ "fieldid": "audience", "value": "1" }] }] }
Look up a campaign
Campaign records can be looked up using DSI_RecordLookup or DSI_RunSearch. Below are simple examples.
Example using DSI_RecordLookup
Return an array of all campaigns managed by employee 4066.
{ "internalid": "", "recordtype": "campaign", "searchfields": [{ "fieldid": "manager", "operator": "anyof", "searchvalue": "4066" }] }
Example using DSI_RunSearch
Return the title, id, manager, and ending date of all campaigns still in progress.
{ "searchtype": "campaign", "searchfilters": [{ "fieldid": "enddate", "operator": "onorafter", "searchvalue": "daysago0", "searchvalue2": "", "join": "" }], "searchcolumns": [{ "fieldid": "title" },{ "fieldid": "campaignid" },{ "fieldid": "owner" },{ "fieldid": "enddate" }] }
Update a campaign
Lead records can be updated up using DSI_RecordUpdate. Below is a simple example.
Example using DSI_RecordUpdate
Change the manager of campaign with ID 103212.
{ "internalid": "103213", "recordtype": "campaign", "mc_user": "hewey.duck@dsiglobal.com", "updatefields": [{ "fieldid": "owner", "newvalue": "1647" }] }Example using DSI_RecordMassUpdate
Change the manager of all unfinished campaigns from employee 1647 to employee 4066.
{ "recordtype": "campaign", "mc_user": "louis.duck@dsiblogal.com", "includeinactive": "", "filterexpression":"", "searchfields": [{ "fieldid": "manager", "operator": "anyof", "searchvalue": "1647" },{ "fieldid": "enddate", "operator": "onorafter", "searchvalue": "daysago0" }], "updatefields": [{ "fieldid": "owner", "newvalue": "4066" }] }
Automation and tracking
NetSuite provides several possible ways to track and even automate marketing tasks. These tasks can be found on various sublists of the campaign record.
Campaign channel internal IDs
The default Campaign Channels have negative id numbers.
Channel | Internal ID (negative number) |
---|---|
Default event | -1 |
-2 | |
Direct mail | -3 |
Phone | -4 |
Print Ad | -5 |
Misc | -6 |
Drip/Lead nurturing | -7 |
Add email campaign
NetSuite will automatically perform a mail merge, using a template, and send emails, to the target group, on the date provided.
Update the campaignemail sublist with DSI_RecordUpdate using the keyword NEW as the line. If you are making a change to an existing email, use the actual line number.
Example using DSI_RecordUpdate
{ "internalid": "103213", "recordtype": "campaign", "mc_user": "dewy.duck@dsiglobal.com", "updatefields": [{ "fieldid": "message", "newvalue": "March Email Blast" }], "updatecolumns": [{ "sublistid": "campaignemail", "lines": [{ "line": "NEW", "remove": "", "nvpair": [{ "columnid": "campaigngroup", "newvalue": "4370" },{ "columnid": "channel", "newvalue": "-2" },{ "columnid": "datescheduled", "newvalue": "3/1/2017" },{ "columnid": "description", "newvalue": "New Customer Blast" },{ "columnid": "subscription", "newvalue": "1" },{ "columnid": "template", "newvalue": "320" },{ "columnid": "cost", "newvalue": "5000" },{ "columnid": "promocode", "newvalue": "5" },{ "columnid": "timescheduled", "newvalue": "9:00 am" },{ "columnid": "testcell", "newvalue": "" }] }] }] }
Add dip campaign (lead nurturing)
NetSuite will automatically send follow-up emails to leads who responded to previous emails. Several drip campaigns can be defined, to continue responding as the lead responds to each different email.
Update the campaigndrip sublist with DSI_RecordUpdate using the keyword NEW as the line. If you are making a change to an existing drip email, use the actual line number.
Example using DSI_RecordUpdate
{ "internalid": "103213", "recordtype": "campaign", "mc_user": "howard.duck@dsiglobal.com", "updatefields": [{ "fieldid": "message", "newvalue": "Email drip to leads and prospects" }], "updatecolumns": [{ "sublistid": "campaigndrip", "lines": [{ "line": "NEW", "remove": "", "nvpair": [{ "columnid": "channel", "newvalue": "-7" },{ "columnid": "datescheduled", "newvalue": "3/1/2017" },{ "columnid": "description", "newvalue": "New Customer Promotion" },{ "columnid": "subscription", "newvalue": "1" },{ "columnid": "template", "newvalue": "12" },{ "columnid": "cost", "newvalue": "400" },{ "columnid": "promocode", "newvalue": "2" }] }] }] }
Add direct mail campaign (snail mail)
Update the campaigndrirectemail sublist with DSI_RecordUpdate using the keyword NEW as the line. If you are making a change to an existing direct mailing, use the actual line number.
Example using DSI_RecordUpdate
{ "internalid": "103313", "recordtype": "campaign", "mc_user": "daffy.duck@dsiglobal.com", "updatefields": [{ "fieldid": "message", "newvalue": "Direct Mail to leads and prospects" }], "updatecolumns": [{ "sublistid": "campaigndirectmail", "lines": [{ "line": "NEW", "remove": "", "nvpair": [{ "columnid": "campaigngroup", "newvalue": "4370" },{ "columnid": "channel", "newvalue": "-3" },{ "columnid": "datescheduled", "newvalue": "2/1/2017" },{ "columnid": "description", "newvalue": "New Customer Junk Mail" },{ "columnid": "subscription", "newvalue": "1" },{ "columnid": "cost", "newvalue": "4000" },{ "columnid": "promocode", "newvalue": "2" }] }] }] }
Add phone calls and other events to campaign
The Other Events that can be tracked on a Marketing Campaign are phone calls(channel -4), print ads (channel -5) and miscellaneous or user defined events. The example below is a phone bank effort; other events are similar.
Update the campaignevent sublist with DSI_RecordUpdate using the keyword NEW as the line. If you are making a change to an existing event, use the actual line number.
Example using DSI_RecordUpdate
{ "internalid": "103313", "recordtype": "campaign", "mc_user": "daffy.duck@dsiglobal.com", "updatefields": [{ "fieldid": "message", "newvalue": "Use the Call Center" }], "updatecolumns": [{ "sublistid": "campaignevent", "lines": [{ "line": "NEW", "remove": "", "nvpair": [{ "columnid": "campaigngroup", "newvalue": "4370" },{ "columnid": "channel", "newvalue": "-4" },{ "columnid": "datescheduled", "newvalue": "2/1/2017" },{ "columnid": "description", "newvalue": "Phone Prospects" },{ "columnid": "subscription", "newvalue": "1" },{ "columnid": "cost", "newvalue": "4000" },{ "columnid": "promocode", "newvalue": "2" }] }] }] }
Opportunity
This example shows how the Opportunity NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create an opportunity
Required fields
-
subsidiary
-
location
-
entityid (customer)
-
One or more item lines with item and quantity
-
probability
Example using DSI_RecordCreate
This example creates an opportunity with three items with a 25% probability of being won. Some common optional fields such as expectedclosedate and custom price rate are set.
{ "recordcategory": "transaction", "create": [{ "mc_user": "Charles.Townsend@dsiglobal.com", "recordtype": "opportunity", "tranid": "", "entityid": "2956", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "item", "subrecordname":"", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "113" },{ "columnid": "quantity", "newvalue": "2" } },{ "nvpair": [{ "columnid": "item", "newvalue": "124" },{ "columnid": "quantity", "newvalue": "1" },{ "columnid": "rate", "newvalue": "409.00" }] },{ "nvpair": [{ "columnid": "item", "newvalue": "123" },{ "columnid": "quantity", "newvalue": "5" },{ "columnid": "rate", "newvalue": "299.00" }] }] } }], "targetfields": [{ "fieldid": "probability", "value": "25" },{ "fieldid": "title", "value": "Wheel Chair Assortment" },{ "fieldid": "expectedclosedate", "value": "11/1/2016" },{ "fieldid": "salesreadiness", "value": "3" },{ "fieldid": "leadsource", "value": "100026" }] }] }
Look up an opportunity
Opportunities can be looked up using DSI_RecordLookup like any other transaction. Below is a simple example.
Example using DSI_RecordLookup
{ "internalid": "25329", "recordtype": "opportunity", "tranid": "QUO00001139" }
Update an opportunity
Opportunities can be updated using DSI_RecordUpdate like any other transaction. Below is a simple example.
Example using DSI_RecordUpdate
{
"internalid": "25329",
"recordtype": "opportunity",
"tranid": "QUO00001139",
"mc_user": "Sabrina.Duncan@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "updated by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "item",
"lines": [{
"line": "1",
"nvpair": [{
"columnid": "quantity",
"newvalue": "3"
}],
}]
}]
}
Delete an opportunity
Opportunities can be deleted using DSI_RecordDelete like any other transaction. Below is a simple example.
Example using DSI_RecordDelete
{ "internalid": "25329", "recordtype": "opportunity", "tranid": "QUO00001139" }
Partner
This example shows how the Partner NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create a partner
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "William.Gates@dsiglobal.com", "recordtype": "partner", "entityid": "", "location": "", "subsidiary": "1", "sublists": [{ "sublistid": "addressbook", ""subrecordname":"", "lines": [{ "nvpair": [{ "columnid": "addr1", "newvalue": "101 Main St." }, { "columnid": "city", "newvalue": "Hooterville" }, { "columnid": "state", "newvalue": "IL" }], "inventorydetail": { } }] }], "targetfields": [{ "fieldid": "companyname", "value": "Drucker General Store" }, { "fieldid": "isperson", "value": "F" }, { "fieldid": "email", "value": "sam@drucker.com" }, { "fieldid": "comments", "value": "Retail, Newspaper, Constable, Justice of the Peace, Post Office " }] }] }
Print via NetSuite
This example shows how the Print via NetSuite process can be accomplished using Advanced Inventory RESTlets.
The type is always required and the formnumber is required for everything except transaction type. The record can be identified by either its internalid or by tranid and recordtype; internalid is always faster.
Print a transaction
The transaction can be specified by internal id or with tranid and recordtype. The PDF is created using the templates defined in NetSuite, based on the custom form. If the the formnumber field is left blank, NetSuite will default to the form marked preferred.
Example using DSI_RecordPrint
{ "internalid": "25636", "type": "TRANSACTION", "tranid": "", "recordtype": "", "formnumber": "98" } or { "internalid": "", "type": "TRANSACTION", "tranid": "SLS00000672", "recordtype": "salesorder", "formnumber": "" }
Print a packing slip
A packing slip can be created from a sales order, an invoice or an item fulfillment. If an order is used, the ship date will be the estimated ship date and the items will be only the fulfilled items. If a fulfillment or invoice is used, the ship date will be the date the fulfillment was created and the items will be all the items on the fulfillment or invoice.
Example using DSI_RecordPrint
{ "internalid": "28955", "type": "PACKINGSLIP", "tranid": "", "recordtype": "", "formnumber": "82" } or { "internalid": "", "type": "PACKINGSLIP", "tranid": "SLS00000672", "recordtype": "salesorder", "formnumber": "82" }
Print a picking ticket
You can use either the internalid or tranid and recordtype of the item fulfillment. If this fulfillment is for multiple shipping routes, the shipgroup and location fields will filter the data.
Example using DSI_RecordPrint
{ "internalid": "28953", "type": "PICKINGTICKET", "tranid": "", "recordtype": "", "formnumber": "83", "pickingticket": { "shipgroup": "", "location": "" } } or { "internalid": "", "type": "PICKINGTICKET", "tranid": "SHI00000414", "recordtype": "itemfulfillment", "formnumber": "83", "pickingticket": { "shipgroup": "5", "location": "2" } }
Print a bill of material
A bill of materials can only be created from an uncompleted work order.
Example using DSI_RecordPrint
{ "internalid": "34324", "type": "BILLOFMATERIAL", "tranid": "", "recordtype": "", "formnumber": "62" } or { "internalid": "", "type": "BILLOFMATERIAL", "tranid": "WRK00000302", "recordtype": "workorder", "formnumber": "62" }
Print a customer statement
This prints a financial statement for a customer. The customer's internalid is required. The optional statement fields will filter the print by the time period to be reported beginning on startdate and ending on statementdate. The openonly field toggles whether to show only unfinished transactions, value T of F.
Example using DSI_RecordPrint
{ "internalid": "2956", "type": "STATEMENT", "formnumber": "81", "statement": { "startdate": "", "statementdate": "", "openonly": "" } }
Project (Job)
This example shows how the Project NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create a project
Because a project is an entity, the name of the project is set with companyname (string) and the customer/company associated with the project is set with parent (internalid). Employees to be allocated as resources in the jobresources sublist, must have the “Project Resource” check box checked on their employee record.
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "Freddy.Jones@dsiglobal.com", "recordtype": "job", "entityid": "", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "jobresources", "subrecordname":"", "lines": [{ "nvpair": [{ "columnid": "jobresource", "newvalue": "114" },{ "columnid": "role", "newvalue": "-2" }] },{ "nvpair": [{ "columnid": "jobresource", "newvalue": "117" },{ "columnid": "role", "newvalue": "-3" }] }] }], "targetfields": [{ "fieldid": "parent", "value": "14" },{ "fieldid": "companyname", "value": "KC Tents: Weekend Camp" },{ "fieldid": "allowtime", "value": "T" }] }] }
Create transaction for project
Creating an opportunity, estimate or order for a project is exactly the same as creating any other transactions of those types. Simply include the project's internal id in the job field in addition to the other required fields. The following is an example estimate/quote; other transactions are similar.
Example using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "jay.garrick@dsiglobal.com", "recordtype": "estimate", "entityid": "2956", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "item", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "1314" },{ "columnid": "quantity", "newvalue": "1" }] }] }], "targetfields": [{ "fieldid": "job", "value": "4062" },{ "fieldid": "title", "value": "Sell stuff from project" },{ "fieldid": "opportunity", "value": "33382" }] }] }
Create project tasks
The fields, title and company, are required as well as subsidiary and location if applicable. In the assignee sublist, resource, serviceitem, estimatedwork, and unitcost are required.
Note:This has a recordcategory of event, not transaction.
Example using DSI_RecordCreate
{ "recordcategory": "event", "create": [{ "mc_user": "lana.lang@dsiglobal.com", "recordtype": "projecttask", "tranid": "RESTlet Task", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "assignee", "lines": [{ "nvpair": [{ "columnid": "resource", "newvalue": "1626" },{ "columnid": "serviceitem", "newvalue": "2024" },{ "columnid": "estimatedwork", "newvalue": "16" },{ "columnid": "unitcost", "newvalue": "15.00" }] },{ "nvpair": [{ "columnid": "resource", "newvalue": "1644" },{ "columnid": "serviceitem", "newvalue": "2024" },{ "columnid": "estimatedwork", "newvalue": "4" },{ "columnid": "unitcost", "newvalue": "65.00" }] }] }], "targetfields": [{ "fieldid": "title", "value": "RESTlet Task" },{ "fieldid": "company", "value": "4062" },{ "fieldid": "finishbydate", "value": "10/26/2016" }] }] }
Create project sub-tasks
The only difference between a task and a sub-task is a second sublist, predecessor. This sublist requires task and type; enddate and startdate are optional. Values for type: FS (Finish-To-Start), SS (Start-To-Start), FF (Finish-to-Finish), SF (Start-To-Finish).
Example using DSI_RecordCreate
{ "recordcategory": "event", "create": [{ "mc_user": "lana.lang@dsiglobal.com", "recordtype": "projecttask", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "assignee", "lines": [{ "nvpair": [{ "columnid": "resource", "newvalue": "1626" },{ "columnid": "serviceitem", "newvalue": "2024" },{ "columnid": "estimatedwork", "newvalue": "8" },{ "columnid": "unitcost", "newvalue": "15.00" }] }] },{ "sublistid": "predecessor", "lines": [{ "nvpair": [{ "columnid": "task", "newvalue": "101901" },{ "columnid": "type", "newvalue": "SS" },{ "columnid": "startdate", "newvalue": "10/24/2016" }] }] }], "targetfields": [{ "fieldid": "title", "value": "RESTlet SubTask" },{ "fieldid": "company", "value": "4062" },{ "fieldid": "finishbydate", "value": "10/26/2016" }] }] }
Project billing type
Billing types include the following.
-
Projects and Time and Materials Billing - Bill customers for actual project expenses, such as resource time and materials.
-
Fixed Bid, Interval Billing Schedules - Bill customers for work completed at predefined intervals.
-
Fixed Bid, Milestone Billing Schedules - Bill customers based on percent of work completed, or preset milestones.
-
Charge-Based Project Billing - If you use the Charge-Based Billing feature, you can create charge rules that provide added flexibility for calculating billable value on projects.
To set the billing type, use the jobbillintype field when either creating or updating a project.
Job billing type | jobbillingtype internal ID |
---|---|
Charge-based | CB |
Fixed bid, interval | FBI |
Fixed bid, milestone | FBM |
Time and materials | TM |
Project billing schedule
Once a billing type is selected, you can then assign a billing schedule record, by internalid, to the billingschedule field. Billing Schedules must already exist before they can be assigned to a project. Values for frequency and the allowed values for repeatevery.
Frequency | repeatevery |
---|---|
Hourly | 6 or 12 |
Weekly | 1, 2, or 4 |
Monthly | 1, 2, 3, or 6 |
Annually | 1, 2, or 3 |
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "quincy.magoo@dsiglobal.com", "recordtype": "billingschedule", "targetfields": [{ "fieldid": "name", "value": "Continuing Service for Douglas Farm" },{ "fieldid": "frequency", "value": "MONTHLY" },{ "fieldid": "inarrears", "value": "T" },{ "fieldid": "initialamount", "value": "0" },{ "fieldid": "numberremaining", "value": "6" },{ "fieldid": "repeatevery", "value": "1" },{ "fieldid": "public", "value": "F" }] }] }
Enter/bill time to a task
Time can also be added to the timeitem sublist of the task. Remember to use the keyword NEW in place of a line number. Note: timetype can take the values, P, A, .
Example using DSI_RecordUpdate
{ "internalid": "102302", "recordtype": "task", "mc_user": "fats.domino@dsiglobal.com", "updatefields": [{ "fieldid": "percentcomplete", "newvalue": "100" }], "updatecolumns": [{ "sublistid": "timeitem", "lines": [{ "line": "NEW", "remove": "", "nvpair": [{ "columnid": "customer", "newvalue": "4062" },{ "columnid": "employee", "newvalue": "1626" },{ "columnid": "hours", "newvalue": "3:45" },{ "columnid": "item", "newvalue": "2024" },{ "columnid": "location", "newvalue": "2" },{ "columnid": "isbillable", "newvalue": "T" },{ "columnid": "timetype", "newvalue": "A" },{ "columnid": "memo", "newvalue": "working a client site" }] }] }] }
Create project milestones
A project milestone is a special project task, with ismilestone set to “T,” that is used to mark a point in a project, usually completion of a set of tasks. Project milestones cannot have estimatedwork, assignees, or a Finish No Later Than (FNLT) constrainttype.
Example using DSI_RecordCreate
{ "recordcategory": "event", "create": [{ "mc_user": "lana.lang@dsiglobal.com", "recordtype": "projecttask", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "predecessor", "lines": [{ "nvpair": [{ "columnid": "task", "newvalue": "101901" },{ "columnid": "type", "newvalue": "SS" },{ "columnid": "startdate", "newvalue": "10/24/2016" }] }] }], "targetfields": [{ "fieldid": "title", "value": "RESTlet SubTask - Day 1" },{ "fieldid": "company", "value": "4062" },{ "fieldid": "ismilestone", "value": "T" },{ "fieldid": "enddate", "value": "10/24/2016" },{ "fieldid": "message", "value": "Completed Day 1" }] }] }
Create generic resources
A generic resource is a convenient placeholder for project planning. This is usually a back-office function, but the RESTlets can create them.
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "santa.claus@dsiglobal.com", "recordtype": "genericresource", "location": "2", "subsidiary":"1", "targetfields": [{ "fieldid": "entityid", "value": "Assembly Worker" },{ "fieldid": "laborcost", "value": "12.65" },{ "fieldid": "workcalendar", "value": "1" }] }] }
Enter cost budget
If the feature is enabled, the cost budget is stored in the cbudget sublist. This list has static lines and only the lines for labor, expense, supplier and other are editable. No lines are editable if Use Calculated Value for All Cost Budgets field ID cbudgetusecalculatedvalues, is checked.
Line numbers for editable lines are as follows.
-
1. Labor
-
4. Expense
-
6. Supplier
-
8. Other
Example using DSI_RecordUpdate
{ "internalid": "4062", "recordtype": "job", "entityid": "", "mc_user": "wile.coyote@dsiglobal.com", "updatefields": [{ "fieldid": "cbudgetusecalculatedvalues", "newvalue": "F" }], "updatecolumns": [{ "sublistid": "cbudget", "subrecordname":"", "lines": [{ "line": "1", "nvpair": [{ "columnid": "totalamount", "newvalue": "1000" }] },{ "line": "4", "nvpair": [{ "columnid": "totalamount", "newvalue": "100" }] },{ "line": "6", "nvpair": [{ "columnid": "totalamount", "newvalue": "12395.41" }] },{ "line": "8", "nvpair": [{ "columnid": "totalamount", "newvalue": "9.95" }] }] }] }
Enter billing budget
If the feature is enabled, the cost budget is stored in the bbudget sublist. This list has static lines and only the lines for labor, expense, supplier and other are editable. No lines are editable if Use Calculated Value for All Billing Budgets, field id bbudgetusecalculatedvalues, is checked.
Line numbers for editable lines are as follows.
-
1. Labor
-
3. Expense
-
5. Supplier
-
7. Other
Example using DSI_RecordUpdate
{ "internalid": "4062", "recordtype": "job", "entityid": "", "mc_user": "wile.coyote@dsiglobal.com", "updatefields": [{ "fieldid": "bbudgetusecalculatedvalues", "newvalue": "F" }], "updatecolumns": [{ "sublistid": "bbudget", "subrecordname":"", "lines": [{ "line": "1", "nvpair": [{ "columnid": "totalamount", "newvalue": "1000" }] },{ "line": "3", "nvpair": [{ "columnid": "totalamount", "newvalue": "100" }] },{ "line": "5", "nvpair": [{ "columnid": "totalamount", "newvalue": "12395.41" }] },{ "line": "7", "nvpair": [{ "columnid": "totalamount", "newvalue": "9.95" }] }] }] }
Purchase Order
This example shows how the Purchase Order NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create purchase order
To create a purchase order, call Record Create with the following required fields.
-
recordcategory: "transaction”In each member of the create array:
-
recordtype: “purchaseorder”
-
mc_user: name/userid of user logged into mobile client
-
subsidiary: internal id of the subsidiary (one world only, req)
-
location: internal id of the location (multi location only, req)
-
tranid: a string to override the tranid of the new record (optional)
-
entityid: internal id of the vendor (required)
-
targetfields array member (repeatable for additional body fields as desired)
-
fieldid
-
value
-
-
-
sublists: one member for each sublist, item sublist required
-
lines array: (repeatable for all items desired, at least one required)
-
nvpair: repeatable, one for each field on the line
-
columnid item: newvalue internal id of item to purchase
-
columnid qty: newvalue integer quantity to purchase
-
-
inventorydetail: repeatable, see the inventory detail section
-
Example using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "bulwinkle.j.moose@dsiglobal.com", "recordtype": "purchaseorder", "tranid": "", "entityid": "", "location": "", "subsidiary":"", "sublists": [{ "sublistid": "", "subrecordname":"inventorydetails", "lines": [{ "nvpair": [{ "columnid": "", "newvalue": "" }], "inventorydetail": { "item": "", "location": "", "tolocation": "", "quantity": "", "unit": "", "inventoryassignment": [{ "line": "", "binnumber": "", "binid": "", "tobinnumber": "", "tobinid": "", "quantity": "", "inventorynumber": "", "inventorynumberid": "", "expirationdate": "" }] } }] }], "targetfields": [{ "fieldid": "memo", "value": "" }] }] }
Approve purchase order
To approve a purchase order if NetSuite Approvals Workflow (bundle 10983) is enabled, use the Record Update RESTlet to change the supervisorapproval* field in the updatefields array.
*Values for the supervisorapproval field: 1 - Pending Approval, 2 - Approved, 3 - Rejected
Example using DSI_RecordUpdate
{ "internalid": "", "recordtype": "purchaseorder", "tranid": "", "updatefields": [{ "fieldid": "approvalstatus", "newvalue": "2" }] }
Receive purchase order
To receive a purchase order, putting the items into inventory, use the Record Transform RESTlet to both create an Item Receipt and change the status of the purchase order to “Received” or “Partially Received.”
Note: Omitting the lines array will receive all remaining quantity on all lines.
Example using DSI_TransactionTransform {
"transform": [{
"mc_user": "",
"fromrecordtype": "purchaseorder",
"tranid": "",
"fromrecordid": "",
"torecordtype": "itemreceipt",
"tolocation": "",
"pps": "",
"sourcefields": [{
"fieldid": "memo",
"value": "Received by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "memo",
"value": "Created from Mobile Client"
}],
"lines": [{
"linenum": "",
"item": "",
"qty": ""
}]
}]
}
Purchase Request
This example shows how the Purchase Request NetSuite process can be accomplished using Advanced Inventory RESTlets.
A purchase request is a specialized purchase order. The only substantive differences are that the document status, supervisorapproval, begins at Pending Approval, the employee field is populated with the internal id of the requester, and the document title is “Purchase Request” when viewed from the Employee Center role. Once the record is created, it behaves identically to a normal Purchase Order.
Create purchase request
Call Record Create as if creating a purchase order. In addition to the fields for a purchase order, a purchase request must specify both the employee and supervisorapproval* fields in the targetfields array.
*Values for the supervisorapproval field: 1 - Pending Approval, 2 - Approved, 3 - Rejected
Example using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "", "recordtype": "purchaseorder", "tranid": "", "entityid": "", "location": "", "subsidiary":"", "sublists": [{ "sublistid": "", "subrecordname":"inventorydetails", "lines": [{ "nvpair": [{ "columnid": "", "newvalue": "" }], "inventorydetail": { "item": "", "location": "", "tolocation": "", "quantity": "", "unit": "", "inventoryassignment": [{ "line": "", "binnumber": "", "binid": "", "tobinnumber": "", "tobinid": "", "quantity": "", "inventorynumber": "", "inventorynumberid": "", "expirationdate": "" }] } }] }], "targetfields": [{ "fieldid": "supervisorapproval", "value": "1" },{ "fieldid": "employee", "value": "" }] }] }
Return Authorization
This example shows how the Request Authorization NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create a return authorization from invoice or cash sale
Example using DSI_TransformTransaction
When creating an RMA from either a cash sale or invoice, all lines will be transferred to the RMA. If all lines were not needed, you must update the RMA to remove/edit the lines.
{
"transform": [{
"mc_user": "Logan.Howlett@dsiglobal.com",
"fromrecordtype": "cashsale",
"tranid": "",
"fromrecordid": "22813",
"torecordtype": "returnauthorization",
"location": "2",
"sourcefields": [{
"fieldid": "memo",
"value": "Refunded by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "orderstatus",
"value": "B"
},{
"fieldid": "memo",
"value": "I did this, bub."
}]
}]
}
Create a standalone return authorization
The customform can influence the future behavior of a return authorization. If a cash version (standard form 84) is used, only a cash refund can be created. If a credit version (standard form 85) is used, a credit memo can be created; which can later be turned into a refund or used to pay for another sale.
Example using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "Charles.Xavier@dsiglobal.com", "recordtype": "returnauthorization", "tranid": "", "entityid": "2956", "subsidiary":"1", "location": "2", "sublists": [{ "sublistid": "item", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "1214" },{ "columnid": "quantity", "newvalue": "2" },{ "columnid": "rate", "newvalue": "18.95" }] },{ "nvpair": [{ "columnid": "item", "newvalue": "1818" },{ "columnid": "quantity", "newvalue": "1" }] }] }], "targetfields": [{ "fieldid": "customform", "value": "85" },{ "fieldid": "orderstatus", "value": "A" }] }] }
Approve a return authorization (RMA)
Example using DSI_RecordUpdate
{ "internalid": "", "recordtype": "returnauthorization", "tranid": "RMA00000028", "mc_user": "Scott.Summers@dsiglobal.com", "updatefields": [{ "fieldid": "orderstatus", "newvalue": "B" }] }
Close or reopen a return authorization (RMA)
Example using DSI_RecordUpdate
Set Isclosed to “T” to close or “F” to open. Set line to “ALL” to apply the change to all lines.
{
"internalid": "24726",
"recordtype": "returnauthorization",
"tranid": "",
"mc_user": "Jean.Grey@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "Closed by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "item",
"lines": [{
"line": "ALL",
"nvpair": [{
"columnid": "isclosed",
"newvalue": "T"
}]
}]
}]
}
Void a return authorization (RMA)
Example using DSI_TransactionVoid
Note: A voided transaction can never be reopened.
{ "mc_user": "Hank.McCoy@dsiglobal.com", "tranid":"", "internalid": "24726", "recordtype": "returnauthorization", }
Update/Edit a return authorization (RMA)
Refer to DSI_RecordUpdate for more detailed updates using the record type "returnauthorization."
Receive a return authorization (RMA)
Example Using DSI_TransactionTransform
{
"transform": [{
"mc_user": "Ororo.Monroe@dsiglobal.com",
"fromrecordtype": "returnauthorization",
"tranid": "",
"fromrecordid": "24726",
"torecordtype": "itemreceipt",
"tolocation": "2",
"location": "",
"pps": "",
"sourcefields": [{
"fieldid": "memo",
"value": "Received by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "memo",
"value": "Storm did this"
}],
"lines": [{
"linenum": "1",
"item": "1214",
"qty": "2",
"binnumbers": "",
"serialnumbers": "",
"nvpair": [{
"columnid": "",
"newvalue": ""
}],
"inventorydetail": {
"item": "",
"barcode": "",
"location": "",
"tolocation": "",
"quantity": "",
"unit": "",
"inventoryassignment": [{
"line": "",
"binnumber": "",
"binid": "",
"tobinnumber": "",
"tobinid": "",
"quantity": "",
"inventorynumber": "",
"inventorynumberid": "",
"expirationdate": ""
}]
}
}]
}]
}
Example when fulling receiving simple items
When fully fulfilling all remaining lines on a return authorization that does not include items with bins or lot/serial numbers, the lines array can be omitted.
Example Using DSI_TransactionTransform
{
"transform": [{
"mc_user": "Magnus.Eisenhardt@dsiglobal.com",
"fromrecordtype": "returnauthorization",
"tranid": "",
"fromrecordid": "24726",
"torecordtype": "itemreceipt",
"tolocation": "2",
"location": "",
"pps": "",
"sourcefields": [{
"fieldid": "memo",
"value": "Received by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "memo",
"value": "Magneto did this"
}]
}]
}
Refund (Credit memo for) a return authorization
The example below issues a credit memo for one line of the RMA.
Requires DSI_MobileClient_User_Enhanced_Permission Role
Example Using DSI_TransactionTransform
{
"transform": [{
"mc_user": "Remy.LeBeau@dsiglobal.com",
"fromrecordtype": "returnauthorization",
"tranid": "",
"fromrecordid": "24726",
"torecordtype": "creditmemo",
"tolocation": "2",
"sourcefields": [{
"fieldid": "memo",
"value": "Received by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "memo",
"value": "Gambit did this"
}],
"lines": [{
"linenum": "1",
"item": "1214",
"qty": "2",
"binnumbers": "",
"serialnumbers": "",
"nvpair": [{
"columnid": "",
"newvalue": ""
}],
}]
}]
}
Refund (Cash refund) a vendor return authorization
Requires a cash account (example below 1000 Checking, internalid 1). The example below issues a cash refund for all lines.
Requires DSI_MobileClient_User_Enhanced_Permission Role
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "Tony.Stark@dsiglobal.com",
"fromrecordtype": "returnauthorization",
"tranid": "",
"fromrecordid": "24726",
"torecordtype": "cashrefund",
"tolocation": "2",
"location": "",
"pps": "",
"sourcefields": [{
"fieldid": "memo",
"value": "Received by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "account",
"value": "1"
},{
"fieldid": "memo",
"value": "Iron Man did this"
}]
}]
}
Run Search
This example shows how the Run Search NetSuite process can be accomplished using Advanced Inventory RESTlets.
Run an existing saved search as-is
Example using DSI_RunSearch
{ "searchtype": "customer", "searchid": "customsearch_dsi_walmart", "sortedbyinternalid":"F" } Or { "searchtype": "customer", "searchid": "1263", "sortedbyinternalid":"F" }
Run an existing saved search with additional filter/column
Any filters and columns defined this way are in addition to the ones in the saved search. The RESTlet will not remove a filter or columns from a saved search.
Example using DSI_RunSearch
{ "searchtype": "customer", "searchid": "customsearch_dsi_walmart", "sortedbyinternalid":"", "searchfilters": [{ "fieldid": "entityid", "operator": "startswith", "searchvalue": "James" }], "searchcolumns": [{ "fieldid": "phone" }] }
Run an ad hoc search
Run a search with user-defined filters and result columns. Example also demonstrates the use of join for both filter and column and using searchvalue2 for a range filter. For filtering by type or recordtype, refer to Record Types in the appendix for filter search values.
Example using DSI_RunSearch
{ "searchtype": "transaction", "searchid": "", "sortedbyinternalid":"T", "searchfilters": [{ "fieldid": "lastmodifieddate", "operator": "within", "searchvalue": "4/6/2016", "searchvalue2": "10/6/2016", "join": "" },{ "fieldid": "internalid", "operator": "", "searchvalue": "1314", "searchvalue2": "", "join": "item" },{ "fieldid": "type", "operator": "anyof", "searchvalue": "PurchOrd", "searchvalue2": "", "join": "" }], "searchcolumns": [{ "fieldid": "quantity", "join": "" },{ "fieldid": "amount", "join": "" },{ "fieldid": "location", "join": "" },{ "fieldid": "displayname", "join": "item" }] }
Run search with filter expression
This example demonstrates using AND, OR, and a SQL formula field. For a definition of filter expressions, refer to appendix Search filter expressions.
Note:The filter expression must use single quotes, not double; AND it cannot contain any control characters such as tab or new line (enter).
Example using DSI_RunSearch
{ "searchtype": "item", "searchid": "", "loadrecords":"", "containsjson":"", "filetype":"", "savefile":"", "filename":"", "folderid":"", "filterexpression":"[[['name','startswith','ACC'],'OR',['name','startswith','HDW']], 'AND',['type','noneof',['Assembly','Group','Kit']],'AND',['formulanumeric: CASE WHEN {quantityonhand} > {quantitycommitted} THEN 1 ELSE 0 END','equalto','1']]", "searchcolumns": [{ "fieldid": "itemid", "join": "", "text":"" }] }
Run search with summary columns
This example demonstrates the use of summaries. Summary values include GROUP, COUNT, SUM, MAX, MIN, and AVG. If a summary is included on any field, all fields must have summaries. Numeric summaries, such as SUM or AVG, will not work properly unless sortedbyinternalid is set to “F”.
Example using DSI_RunSearch
This search duplicates the Inventory Details tab on a lot/serial numbered inventory item with bins.
{ "searchtype": "item", "sortedbyinternalid":"F", "searchfilters": [{ "fieldid": "internalid", "operator": "anyof", "searchvalue": "678" }], "searchcolumns": [{ "fieldid": "binnumber", "join": "inventorynumberbinonhand", "summary":"GROUP" },{ "fieldid": "inventorynumber", "join": "inventorynumberbinonhand", "summary":"GROUP" },{ "fieldid": "quantityonhand", "join": "inventorynumberbinonhand", "summary":"GROUP" },{ "fieldid": "quantityavailable", "join": "inventoryNumberBinOnHand", "summary":"GROUP" }] }
Generate a CSV file from search results
Run a search with user-defined filters and result columns. Set filetype to ‘csv' to trigger the csv version.
-
Optional: To return the name of a field that normally returns an internal id, set the text field in that searchcolumns to ‘T'.
-
Optional: Provide a filename (without extension) for the saved file.
-
Optional: Provide a folder (by internal id) for the saved file with folderid. Defaults to Attachments Sent folder.
Example using DSI_RunSearch
{ "searchtype": "item", "searchid": "", "sortedbyinternalid":"", "filetype":"csv", "savefile":"T", "filename":"savethis", "folderid":"695", "searchfilters": [{ "fieldid": "created", "operator": "onorafter", "searchvalue": "1/1/2016", "searchvalue2": "", "join": "" }], "searchcolumns": [{ "fieldid": "itemid", "join": "", "text":"" },{ "fieldid": "description", "join": "", "text":"" },{ "fieldid": "storedisplayimage", "join": "", "text":"" },{ "fieldid": "storedisplayimage", "join": "", "text":"T" }] }
Sample JSON output
{ "RESULTS": [ { "file": { "fileid": 12385, "filename": "savethis.csv", "filesize": "911", "folderid": "-14", "encoding": "UTF-8", "isonline": "false" }, "csvdata": "BASE 64 ENCODED STRING” } ] }
Generate a PDF file from search results
Run a search with user-defined filters and result columns. Set filetype to ‘pdf to trigger the pdf version.
-
Optional: To return the name of a field that normally returns an internal id, set the text field in that searchcolumns to ‘T'.
-
Optional: Set the savefile field to ‘T' to save the pdf file to the file cabinet.
-
Optional: Provide a filename (without extension) for the saved file.
-
Optional: Provide a folder (by internal id) for the saved file with folderid. Defaults to Attachments Sent folder.
Example using DSI_RunSearch
{ "searchtype": "item", "searchid": "", "sortedbyinternalid":"", "filetype":"pdf", "savefile":"T", "filename":"itemsThatStartWithACC", "folderid":"", "filterexpression":"", "searchfilters": [{ "fieldid": "itemid", "operator": "startswith", "searchvalue": "ACC", "searchvalue2": "", "join": "" }], "searchcolumns": [{ "fieldid": "itemid", "join": "", "text":"" },{ "fieldid": "displayname", "join": "", "text":"" },{ "fieldid": "storedisplayimage", "join": "", "text":"T" }] }
Sample JSON output
{ "RESULTS": [ { "file": { "fileid": 12185, "filename": "itemsThatStartWithACC.pdf", "filesize": "3596", "folderid": "-14", "encoding": "UTF-8", "isonline": "false" }, "pdfdata": "BASE 64 ENCODED STRING” } ] }
Sales Order
This example shows how the Sales Order NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create a sales order
Example using DSI_RecordCreate
Required fields:
-
Subsidiary
-
Location
-
Entity
-
One or more item lines with item and quantity
{ "recordcategory": "transaction", "create": [{ "mc_user": "Stimpson.Cat@dsiglobal.com", "recordtype": "salesorder", "tranid": "", "entityid": "2956", "location": "2", "subsidiary":"1", "sublists": [{ "sublistid": "item", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "1214" },{ "columnid": "quantity", "newvalue": "2" }] },{ "nvpair": [{ "columnid": "item", "newvalue": "1008" },{ "columnid": "quantity", "newvalue": "1" }] },{ "nvpair": [{ "columnid": "item", "newvalue": "1009" },{ "columnid": "quantity", "newvalue": "1" }] }] }], "targetfields": [{ "fieldid": "orderstatus", "value": "A" }] }] }
Create sales order from an estimate
The line level taxcode is required when transforming from an estimate.
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "Red.Guy@dsiglobal.com",
"fromrecordtype": "estimate",
"tranid": "",
"fromrecordid": "25330",
"torecordtype": "salesorder",
"location": "2",
"sourcefields": [{
"fieldid": "memo",
"value": "Cash Sale by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "memo",
"value": "Mama had a chicken. Mama had a cow. "
}],
"lines": [{
"linenum": "1",
"item": "1314",
"qty": "1",
"nvpair": [{
"columnid": "taxcode",
"value": "638"
}]
}]
}]
}
Create sales order from customer
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "Nyota.Uhura@dsiglobal.com", "fromrecordtype": "customer", "tranid": "", "fromrecordid": "2956", "torecordtype": "salesorder", "tolocation": "2", "location": "2", "sourcefields": [{ "fieldid": "comments", "value": "This sucker will buy anything." }], "targetfields": [{ "fieldid": "otherrefnum", "value": "PO123456" },{ "fieldid": "orderstatus", "value": "B" }], "lines": [{ "linenum": "1", "item": "1314", "qty": "1" }] }] }
Create sales order from an opportunity
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "Loula.Belle@dsiglobal.com", "fromrecordtype": "opportunity", "tranid": "", "fromrecordid": "22913", "torecordtype": "salesorder", "tolocation": "2", "sourcefields": [{ "fieldid": "memo", "value": "Processed by Advanced Inventory" }], "targetfields": [{ "fieldid": "memo", "value": "Sales Order Created by Advanced Inventory" }], "lines": [{ "linenum": "1", "item": "1314", "qty": "5" }] }] }
Create drop ship sales order
In order to create a drop-ship order, the item to be drop-shipped must have a preferred vendor on the item record. If the item's record has Drop Ship Item checked, create the sales order normally as above. If the item is not a Drop Ship item but has a preferred vendor, set the column field createpo to "DropShip".
It is a best practice to set the custom form on the order to a drop-ship sales order form, in this case internalid 103. If one is defined in NetSuite, the purchase order will automatically be created with the drop-ship purchase order form.
NetSuite's drop ship process, to create a purchase order and link it to the order, is fired when a sales order, with correctly set-up items, is approved. Whether the order is approved at creation or a later time, the purchase order is created only when approval happens.
Example Using DSI_CreateRecord
In this example, the second item has Drop Ship checked and the first does not. The order is marked approved to cause the purchase order to be created immediately.
{ "recordcategory": "transaction", "create": [{ "mc_user": "rose.tylor@dsiglobal.com", "recordtype": "salesorder", "tranid": "", "itemid": "", "entityid": "2956", "location": "2", "transferlocation": "", "account":"", "subsidiary":"1", "sublists": [{ "sublistid": "item", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "1214" },{ "columnid": "quantity", "newvalue": "2" },{ "columnid": "createpo", "newvalue": "DropShip" }] },{ "nvpair": [{ "columnid": "item", "newvalue": "1818" },{ "columnid": "quantity", "newvalue": "1" }] }] }], "targetfields": [{ "fieldid": "customform", "value": "103" },{ "fieldid": "orderstatus", "value": "B" }] }] }
Create a special order item sales order
The process to sell a “special order” item is nearly identical to the drop-ship process above. The item can have “Special Order Item” checked or if the item is not a Special Order item, set the column field createpo to “SpecOrd”. In either case, the item must have a Preferred Vendor on its item record.
Create sales order with work order
To create a sales order and create a work order for an assembly on the one or more if its lines, set the column field createwo to “T”.
Example Using DSI_CreateRecord
{ "recordcategory": "transaction", "create": [{ "mc_user": "rose.tylor@dsiglobal.com", "recordtype": "salesorder", "tranid": "", "itemid": "", "entityid": "2956", "location": "2", "transferlocation": "", "account":"", "subsidiary":"1", "sublists": [{ "sublistid": "item", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "1214" },{ "columnid": "quantity", "newvalue": "2" },{ "columnid": "createpo", "newvalue": "DropShip" }] },{ "nvpair": [{ "columnid": "item", "newvalue": "1818" },{ "columnid": "quantity", "newvalue": "1" }] }] }], "targetfields": [{ "fieldid": "customform", "value": "103" },{ "fieldid": "orderstatus", "value": "B" }] }] }
Approve a sales order
Example using DSI_RecordUpdate
{ "internalid": "", "recordtype": "salesorder", "tranid": "SLS00000620", "mc_user": "Ren.Hoek@dsiglobal.com", "updatefields": [{ "fieldid": "orderstatus", "newvalue": "B" }] }
Close or reopen a sales order
Example using DSI_RecordUpdate
Set Isclosed to “T” to close or “F” to open. Set line to “ALL” to apply the change to all lines.
{
"internalid": "22707",
"recordtype": "salesorder",
"tranid": "",
"mc_user": "Haggis.McHaggis@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "Closed by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "item",
"lines": [{
"line": "ALL",
"nvpair": [{
"columnid": "isclosed",
"newvalue": "T"
}]
}]
}]
}
Close or reopen a line on a sales order
Example using DSI_RecordUpdate
Set Isclosed to “T” to close or “F” to open. Set line to the line number, counting from 1.
{
"internalid": "22707",
"recordtype": "salesorder",
"tranid": "",
"mc_user": "Haggis.McHaggis@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "Line 1 closed by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "item",
"lines": [{
"line": "1",
"nvpair": [{
"columnid": "isclosed",
"newvalue": "T"
}]
}]
}]
}
Void a sales order
Example using DSI_TransactionVoid
Note: A voided transaction can never be reopened.
{ "mc_user": "Hewey.Lewis@dsiglobal.com", "tranid":"SLS00000625", "internalid": "", "recordtype": "salesorder" }
Update/Edit a sales order
See DSI_RecordUpdate for more detailed updates using the record type “salesorder”. To substitute an item on a sales order, specify the line number, the new item's internalid, and all other information from the original line in the call to DSI_RecordUpdate. This will change the item without changing the order of the lines.
Fulfill a sales order
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "Sven.Hoek@dsiglobal.com", "fromrecordtype": "salesorder", "tranid": "", "fromrecordid": "21166", "torecordtype": "itemfulfillment", "tolocation": "2", "location": "2", "pps": "picked", "sourcefields": [{ "fieldid": "memo", "value": "Fulfilled by Advanced Inventory" }], "targetfields": [{ "fieldid": "memo", "value": "Created by Advanced Inventory" }], "sublists": [{ "sublistid": "item", "subrecordname":"", "lines": [{ "linenum": "", "item": "678", "qty": "100", "binnumbers": "", "serialnumbers": "", "refnum":"", "nvpair": [{ "columnid": "", "value": "" }], "inventorydetail": { "item": "678", "barcode": "", "location": "", "tolocation": "2", "quantity": "100", "unit": "", "inventoryassignment": [{ "binnumber": " Alpha-1", "binid": "", "tobinnumber": "", "tobinid": "", "quantity": "100", "inventorynumber": "L-Alpha1", "inventorynumberid": "", "expirationdate": "" }] } }] }] }] }
Example when fully fulling simple items
When fully fulfilling all remaining lines on a sales order that does not include items with bins or lot/serial numbers, the lines array can be omitted.
{ "transform": [{ "mc_user": "Bubba.Gump@dsiglobal.com", "fromrecordtype": "salesorder", "tranid": "", "fromrecordid": "23922", "torecordtype": "itemfulfillment", "tolocation": "2", "pps": "picked", "sourcefields": [{ "fieldid": "memo", "value": "This Order Fulfilled by Advanced Inventory" }], "targetfields": [{ "fieldid": "memo", "value": "This Item Fulfillment created by Advanced Inventory" }] }] }
Support Case
This example shows how the Support Case NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create a case
Example using DSI_RecordCreate
Note:Assigned to employee must have “Support Rep” checked on employee record.
Required fields: -
Subsidiary
-
Company
-
Title
{ "recordcategory": "event", "create": [{ "mc_user": "happy.gilmore@dsiglobal.com", "recordtype": "supportcase", , "subsidiary": "1", "targetfields": [{ "fieldid": "company", "value": "2956" }, { "fieldid": "title", "value": "It wont work" }, { "fieldid": "assigned", "value": "1646" }, { "fieldid": "incomingmessage", "value": "The pig didn't like it. We want a refund." }] }] }
Update case status
Example using DSI_RecordUpdate
Default Status Values: 1 - Not Started, 2 - In Progress, 3 - Escalated, 4 - Reopened, 5 - Closed, 6 - On Hold
{ "internalid": "101287", "recordtype": "supportcase", "mc_user": "sleeper.awakened@dsiglobal.com", "updatefields": [{ "fieldid": "status", "newvalue": "2" }] }
Escalate a case
Example using DSI_RecordUpdate
Note:Unlike assigned, escalateto can be any employee
{ "internalid": "101287", "recordtype": "supportcase", "mc_user": "kwisatx.haderach@dsiglobal.com", "updatefields": [{ "fieldid": "status", "newvalue": "3" },{ "fieldid": "escalationmessage", "newvalue": "I don't know how to fix this. The Boss said you should do it." }], "updatecolumns": [{ "sublistid": "escalateto", "subrecordname":"", "lines": [{ "line": "NEW", "nvpair": [{ "columnid": "escalatee", "newvalue": "1626" }] }] }] }
Send case message
Example using DSI_RecordUpdate
Default Status Values: 1 - Not Started, 2 - In Progress, 3 - Escalated, 4 - Reopened, 5 - Closed, 6 - On Hold
{ "internalid": "101287", "recordtype": "supportcase", "mc_user": "sleeper.awakened@dsiglobal.com", "updatefields": [{ "fieldid": "messagenew", "newvalue": "T" },{ "fieldid": "incomingmessage", "newvalue": "Thank you for contacting support. Unfortunately, our product is not meant to be consumed by pigs. Closing this case." },{ "fieldid": "status", "newvalue": "5" }] }
Vendor
This example shows how the Vendor NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create a vendor
Example using DSI_RecordCreate
{ "recordcategory": "entity", "create": [{ "mc_user": "William.Gates@dsiglobal.com", "recordtype": "vendor", "entityid": "", "location": "", "subsidiary": "1", "sublists": [{ "sublistid": "currency", "subrecordname":"inventorydetails", "lines": [{ "nvpair": [{ "columnid": "currency", "newvalue": "2" }], "inventorydetail": { } },{ "nvpair": [{ "columnid": "currency", "newvalue": "1" }], "inventorydetail": { } }] }], "targetfields": [{ "fieldid": "firstname", "value": "Arnold" }, { "fieldid": "lastname", "value": "Ziffel" }, { "fieldid": "companyname", "value": "Ziffel Farm" }, { "fieldid": "isperson", "value": "T" }, { "fieldid": "email", "value": "arnold@ziffelfarm.com" }, { "fieldid": "title", "value": "Mr." }, { "fieldid": "comments", "value": "Never mention pork products!" }] }] }
Vendor Return Authorization
This example shows how the Vendor Return Authorization NetSuite process can be accomplished using Advanced Inventory RESTlets.
Create a vendor return authorization
Example sing DSI_RecordCreate
Required fields:
-
Subsidiary
-
Location
-
Entityid (vendor)
-
One or more item lines with item and quantity (rate optional)
-
Inventory details if the item is serialized or lot numbered
{ "recordcategory": "transaction", "create": [{ "mc_user": "snidely.whiplash@dsiglobal.com", "recordtype": "vendorreturnauthorization", "entityid": "3658", "subsidiary":"1", "sublists": [{ "sublistid": "item", "lines": [{ "nvpair": [{ "columnid": "item", "newvalue": "1818" },{ "columnid": "quantity", "newvalue": "6" }] },{ "nvpair": [{ "columnid": "item", "newvalue": "1214" },{ "columnid": "quantity", "newvalue": "2" },{ "columnid": "rate", "newvalue": "5.00" }] }] }], "targetfields": [{ "fieldid": "orderstatus", "value": "A" },{ "fieldid": "memo", "value": "Dented cans" }] }] }
Approve a vendor return authorization
Example using DSI_RecordUpdate
{ "internalid": "", "recordtype": "vendorreturnauthorization", "tranid": "VRMA00000003", "mc_user": "Penelope.Pitstop@dsiglobal.com", "updatefields": [{ "fieldid": "orderstatus", "newvalue": "B" }] }
Close or reopen a vendor return authorization
Example using DSI_RecordUpdate
Set Isclosed to “T” to close or “F” to open. Set line to “ALL” to apply the change to all lines.
{
"internalid": "24426",
"recordtype": "vendorreturnauthorization",
"tranid": "",
"mc_user": "Boris.Badenov@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "Closed by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "item",
"lines": [{
"line": "ALL",
"nvpair": [{
"columnid": "isclosed",
"newvalue": "T"
}]
}]
}]
}
Close or reopen a line on a vendor return authorization
Example using DSI_RecordUpdate
Set Isclosed to “T” to close or “F” to open. Set line to the line number, counting from 1.
{
"internalid": "24426",
"recordtype": "vendorreturnauthorization",
"tranid": "",
"mc_user": "Natasha.Fatale@dsiglobal.com",
"updatefields": [{
"fieldid": "memo",
"newvalue": "Line 2 closed by Advanced Inventory"
}],
"updatecolumns": [{
"sublistid": "item",
"lines": [{
"line": "2",
"nvpair": [{
"columnid": "isclosed",
"newvalue": "T"
}]
}]
}]
}
Void a vendor return authorization
Example using DSI_TransactionVoid
Note: A voided transaction can never be reopened.
{ "mc_user": "Felonious.Gru@dsiglobal.com", "tranid":"VRMA00000003", "internalid": "", "recordtype": "vendorreturnauthorization", }
Update/Edit a vendor return authorization
See DSI_RecordUpdate for more detailed updates using the record type "vendorreturnauthorization".
Fulfill/Ship a vendor return authorization
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "Commander.McBragg@dsiglobal.com", "fromrecordtype": "vendorreturnauthorization", "tranid": "", "fromrecordid": "24426", "torecordtype": "itemfulfillment", "tolocation": "", "location": "2", "pps": "picked", "sourcefields": [{ "fieldid": "memo", "value": "Fulfilled by Advanced Inventory" }], "targetfields": [{ "fieldid": "memo", "value": "Created by Advanced Inventory" }], "lines": [{ "linenum": "1", "item": "678", "qty": "100", "binnumbers":"", "serialnumbers":"", "inventorydetail": { "item":"678", "barcode":"", "location":"2", "tolocation":"", "quantity": "6", "unit": "", "inventoryassignment": [{ "line": "", "binnumber": "Alpha-1", "binid": "", "tobinnumber": "", "tobinid": "", "quantity": "6", "inventorynumber": "L-Alpha1", "inventorynumberid": "", "expirationdate":"" }] } }] }] }
Example when fully fulling simple items
When fully fulfilling all remaining lines on a vendor return authorization that does not include items with bins or lot/serial numbers, the lines array can be omitted.
{ "transform": [{ "mc_user": "B.Fearless.Leader@dsiglobal.com", "fromrecordtype": "vendorreturnauthorization", "tranid": "", "fromrecordid": "24426", "torecordtype": "itemfulfillment", "tolocation": "", "location": "2", "pps": "shipped", "sourcefields": [{ "fieldid": "memo", "value": "Shipped to Vendor by Advanced Inventory" }], "targetfields": [{ "fieldid": "memo", "value": "Advanced Inventory did this" }] }] }
Refund (Bill credit) a vendor return authorization
Requires DSI_MobileClient_User_Enhanced_Permission Role
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "Dudley.DoRight@dsiglobal.com", "fromrecordtype": "vendorreturnauthorization", "tranid": "", "fromrecordid": "24426", "torecordtype": "vendorcredit", "tolocation": "", "location": "2", "pps": "", "sourcefields": [{ "fieldid": "memo", "value": "Vendor Bill Credit created by Advanced Inventory" }], "targetfields": [{ "fieldid": "memo", "value": "Advanced Inventory did this" }] }] }
Work Order
This example shows how the Work Order NetSuite process can be accomplished using Advanced Inventory RESTlets.
There are two ways to do work orders, Standard work orders, and Manufacturing Work In Process (WIP) work orders. WIP is a feature that must be enabled in addition to enabling work orders.
Standard process flow
-
Create the work order, either stand alone or from a sales order.
-
Release the work order.
-
Build the work order using an assembly build.
WIP process flow
-
Create the work order, either stand alone or from a sales order with the iswip checkbox checked.
-
Release the work order.
-
Optional: Create work order Issue.
-
Create work order completion (with backflush if work order issue was skipped).
-
Create work order close.
Create
Create a work order from a sales order
When a sales order containing an assembly item is created or updated, a work order can be created for the quantity of the assembly on the line. To do this, set the createwo column of that line to “T”. Refer to Create sales order with work order for an example of sales order creation. Below is an example after creation.
Example using DSI_RecordUpdate
{ "internalid": "26547", "recordtype": "salesorder", "mc_user": "kelly.quit@dsiglobal.com", "updatecolumns": [{ "sublistid": "item", "lines": [{ "line": "1", "nvpair": [{ "columnid": "createwo", "newvalue": "T" }] }] }], "updatefields": [{ "fieldid": "revision", "newvalue": "8" }] }
Create a standalone work order
Notes:
-
entity must be the first field in the targetfields array.
-
assemblyitem is required.
-
location must be in the targetfields array, not the usual location field.
-
job is the internalid of a project/job, optional
Example using DSI_RecordCreate
{ "recordcategory": "transaction", "create": [{ "mc_user": "I.R.Babboon@dsiglobal.com", "recordtype": "workorder", "subsidiary":"1", "targetfields": [{ "fieldid": "entity", "value": "2956" },{ "fieldid": "assemblyitem", "value": "646" },{ "fieldid": "location", "value": "2" },{ "fieldid": "orderstatus", "value": "A" },{ "fieldid": "firmed", "value": "T" },{ "fieldid": "iswip", "value": "T" },{ "fieldid": "quantity", "value": "6" },{ "fieldid": "job", "value": "3759" }] }] }
Release
This is the approval step for a work order. This can be triggered by default using the Accounting Preferences in the NetSuite set-up menu.
Release (approve) work order
To release a work order use the Record Update RESTlet to change the orderstatus* field in the updatefields array.
*Values for the orderstatus field: A - Planned, B - Released
Example using DSI_RecordUpdate
{ "internalid": "26344", "recordtype": "workorder", "mc_user": "johnny.quest@dsiglobal.com", "updatefields": [{ "fieldid": "orderstatus", "newvalue": "B" }] }
Build - Standard
An assembly build is required if the Manufacturing Work In Process (WIP) is not enabled or the iswip checkbox on the work order is not checked.
Issue - WIP
This step is only relevant if the Manufacturing Work In Process (WIP) feature is enabled and the iswip checkbox is checked on the workorder.
Issue components for work order
A work order issue is created using DSI_TransactionTransform.
Prerequisites:
-
The Manufacturing Work in Process (WIP) feature must be enabled.
-
The Work Order must be released and the WIP check box must be checked (iswip = T).
Issue partial components
Unlike using Transaction Transform to receive or fulfill an order, any line not being fully issued must be specified in the call with a quantity, zero quantity is valid for work order issue.
Note: Any item not being issued must be specified in the lines array with quantity zero.
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "John.Koenig@dsiglobal.com", "fromrecordtype": "workorder", "fromrecordid": "27454", "torecordtype": "workorderissue", "tolocation": "2", "sourcefields": [{ "fieldid": "", "value": "" }], "targetfields": [{ "fieldid": "memo", "value": "I did this" }], "lines": [{ "linenum": "1", "item": "128", "qty": "3" },{ "linenum": "2", "item": "230", "qty": "3" },{ "linenum": "3", "item": "479", "qty": "0" },{ "linenum": "4", "item": "252", "qty": "0" },{ "linenum": "5", "item": "152", "qty": "0" }] }] }Issue all components
Since a Work Order Issue will fully issue components that are not specifically listed in the call, a call with no lines will fully issue all components.
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "Helena.Russel@dsiglobal.com", "fromrecordtype": "workorder", "fromrecordid": "27454", "torecordtype": "workorderissue", "tolocation": "2", "targetfields": [{ "fieldid": "memo", "value": "I did this" }] }] }
Completion - WIP
This step is only relevant if the Manufacturing Work In Process (WIP) feature is enabled and the iswip checkbox is checked on the work order. A work order completion is the “build” step of a WIP work order. When this record is created, the issued components are consumed and the assembly is added to inventory.
A work order completion is created using DSI_TransactionTransform. The completion can be created with or without backflush. Using backflush to record the component consumption allows the work order issue to be skipped.
Prerequisites:
-
The Manufacturing Work in Process (WIP) feature must be enabled.
-
The Work Order must be released and the WIP check box must be checked (iswip = T).
-
In the Accounting Preferences, the setting “Check Completed In Prior Operations During Operation Completion” must be set to "No Validation".
If work process tasks are enabled, specify the startoperation and endoperation.
Note: The error, "SSS_INVALID_SUBLIST_OPERATION", will be thrown unless Check Completed In Prior Operations During Operation Completion is set to No Validation.
Non Advanced Bin/Inventory Number Item
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "bob.t.builder@dsiglobal.com", "fromrecordtype": "workorder", "fromrecordid": "27454", "torecordtype": "workordercompletion", "tolocation": "2", "sourcefields": [{ "fieldid": "", "value": "" }], "targetfields": [{ "fieldid": "quantity", "value": "1" },{ "fieldid": "isbackflush", "value": "F" },{ "fieldid": "startoperation", "value": "101692" },{ "fieldid": "endoperation", "value": "101695" }] }] }
Advanced Bin/Inventory Number Item
To set the serial/lot number or advanced bin, you must use the inventorydetail object in the targetfields array. For serialized items, the line number must be “NEW” and quantity 1. For lot numbered items, line should be NEW for a new lot or blank for an existing lot.
Example using DSI_TransactionTransform
{
"transform": [{
"mc_user": "sue.storm@dsiglobal.com",
"fromrecordtype": "workorder",
"fromrecordid": "34326",
"torecordtype": "workordercompletion",
"location": "2",
"sourcefields": [{
"fieldid": "memo",
"value": "completed by Advanced Inventory"
}],
"targetfields": [{
"fieldid": "isbackflush",
"value": "T"
},{
"fieldid": "quantity",
"value": "2"
},{
"fieldid": "memo",
"value": "my serialized completion"
},{
"fieldid": "",
"value": "",
"inventorydetail": {
"item":"2022",
"unit": "",
"inventoryassignment": [{
"line": "NEW",
"binnumber": "",
"binid": "",
"quantity": "1",
"inventorynumber": "CGSP00001",
"inventorynumberid": ""
},{
"line": "NEW",
"binnumber": "",
"binid": "",
"quantity": "1",
"inventorynumber": "CGSP00002",
"inventorynumberid": ""
}]
}
}]
}]
}
Close - WIP
This step is only relevant if the Manufacturing Work In Process (WIP) feature is enabled and the iswip checkbox is checked on the workorder.
Use a work order close to finalize the accounting for that order when no further work will be done for this order. The work order close reconciles the accounting by reviewing all issues and completions associated with that work order.
Note: A closed work order cannot be reopened. Do not close a work order that is incomplete unless no further work is planned.
Work Order Close
A work order close is created using DSI_TransactionTransform.
Example using DSI_TransactionTransform
{ "transform": [{ "mc_user": "rita.repulsa@moonpalace.com", "fromrecordtype": "workorder", "fromrecordid": "27454", "torecordtype": "workorderclose", "tolocation": "2" }] }
Loading...
There was a problem loading this topic