Solution
- First, clone the process to be customized (eg. NSWMS_multiOrder_Picking)
- View the cloned process (eg. NSWMS_multiOrder_Picking_1)
- From the Mobile Process, view the Mobile – Page where the custom page element will be created (eg. multiOrderPicking_enterStagingBin_1
- Under Page Elements subtab, create a new Mobile – Page Element, making sure to provide the ff in the element: a) record name (eg. purchaseorder) //internal ID of the record as per Records Browser b) field name (eg. custbody12) //Custom NetSuite transaction body field internal ID
5. After saving the page element, one is redirected to the Mobile – Page. Under the Page Elements subtab, view the Mobile – Page Element for the Action Button (eg. multiOrderPicking_enterStagingBin_stagingBinActionBtn).)
6. Look for the On Click Action link (eg. mp_enterStagingBin_stagingBinActionBtn_stageBinValidate)
7. Edit the Mobile – Action page mp_enterStagingBin_stagingBinActionBtn_stageBinValidate, and supply the ff values: a) Type = Submit Form b) HTTP Method = POST c) On the right side of the After Action Restlet dropdown field, click the plus (+) sign to create a new custom Restlet (eg. AddAdditionalDetails).
8. Upon click of the plus sign, a popup to create a Mobile – Action appears. Supply it with the following values: a) Type = Restlet (Notice how the page displays lesser fields once you do this) b) HTTP Method = POST c) Name = AddAdditionalDetails d) Script ID = customscript_jj_rl_field_from_wms* e) Deployment ID = customdeploy_jj_rl_field_from_wms
The custom Restlet customscript3635637_restletwmsmobile was already deployed prior to these steps.
/**
* @NApiVersion 2.1
* @NScriptType Restlet
*/
define(['N/record','N/search'],
(record,search) => {
function removeDuplicates(arr) {
return arr.filter((item,
index) => arr.indexOf(item) === index);
}
const post = (requestBody) => {
try {
log.debug("requestbody", requestBody);
var test = requestBody;
// get the object from the WMS restlet action
log.debug('test.params.impactedRecords.salesorder[0]', test.params.impactedRecords.salesorder);
var soidArr = test.params.impactedRecords.salesorder
var wmsValue = test.params.recordsData.salesorder.standardFields.custbody_if_created_wms;
log.debug("soidArr.length",soidArr.length);
var removedupl = removeDuplicates(soidArr)
for(j=0; j<removedupl.length;j++) {
var soId = record.submitFields({
type: record.Type.SALES_ORDER,
id: Number(removedupl[j]),
values: {
custbody_if_created_wms: wmsValue
},
options: {
enableSourcing: false,
ignoreMandatoryFields: true
}
});
log.debug("wmsValue", wmsValue);
}
}
catch (e) {
log.error('error@post', e);
}
}
return {post}
});
9. Save the pop up Mobile – Action, and note that the After Action Restlet field is now populated with AddAdditionalDetails
10. Save the Mobile – Action page
11. To apply the changes, click on the update app link on the Mobile application list page.

12. Click on the URL and click on the link to view the scheduled script status.
13. Once the customdeploy_mobile_ss_ondemand_app_conf completes, test the WMS app (Setup > Custom > Mobile App > Begin New Session)
Created custom field in WMS page

14. One should now successfully be able to save the value from the WMS page element to the NS body field in the Sales Order.
The custom transaction body field which fetch the value from WMS custom field
