define([‘N/runtime’, ‘N/error’], /** * @param{search} search */ (runtime, error) => { const ROLES = [ 1112 , 1046] const LOCATION = [29] const beforeLoad = (scriptContext) => { if (scriptContext.type == scriptContext.UserEventType.EDIT) { let curUser = runtime.getCurrentUser(); let curRole = curUser.role let curLoc = curUser.location … Continue reading How to throw error in User Event script
Author: Mindu Paul
How to use search instead of loading a record
function (currentRecord, search) { }
How to use the function checkForParamter
It is a function to validate a parameter. It will check if the parameter meets certain conditions for validity. The example of the code is shown below. const checkForParameter = function checkForParameter(parameter) {try { if (parameter !== “” && parameter !== null && parameter !== undefined && parameter !== false &¶meter !== “null” && parameter… Continue reading How to use the function checkForParamter
To create a custom field in RMA records
Navigate to Customization > Lists, Records and Fields > Transaction Body Fields > New to create the custom field. Then fill the necessary fields such as label and Id. And select the checkbox ‘sale’ under the ‘Applies to’ subtab and also fill the display settings. Afte filling the necessary details select ‘save and apply to… Continue reading To create a custom field in RMA records