The word recmach is attached to the custom records id when the record is attached into another record. We can use this function to create custom records instead of using record.create function. So, the governance limit is controlled. newRecord.selectNewLine({ sublistId: ‘sublistid’ }); newRecord.setCurrentSublistValue({ … Continue reading Create custom records using recmach function in script
Author: Shanmugapriya Ganesh
Unique Folder Name for Error Files
If the map/reduce script, we can create unique name for the error file by using the time in seconds in the summarize stage. All the error details are stored as a csv file and will save in a file cabinet with different name for the future reference. reduceContext.write({ … Continue reading Unique Folder Name for Error Files
How to get the old record value in client script
Here, we have used lineInit() to get the value. declare the variable as global; itemQuantity = currentRecord.getCurrentSublistValue({ sublistId: ‘item’, fieldId: ‘quantity’ }); Then use the value where we need. currentRec.setCurrentSublistValue({ … Continue reading How to get the old record value in client script
Change the date format as system preference date and time zone using script
Here we have used to fetch the system preference date format and time zone and using the format module. let dateFormat = runtime.getCurrentUser().getPreference({ name: ‘DATEFORMAT’ }); let timeZone = runtime.getCurrentUser().getPreference({ … Continue reading Change the date format as system preference date and time zone using script
Decode Function in saved search
We can use decode function for mutilple conditions check like nested if condition. DECODE( (CASE WHEN {item.type} = ‘Inventory Item’ AND {quantity} = {quantityshiprecv} THEN 1 ELSE (CASE WHEN {item.type} = ‘Inventory Item’ AND {quantity} != {quantityshiprecv} AND {closed} = ‘T’ THEN 1 ELSE 0 END) END ), 1, 1, 0 ) Using… Continue reading Decode Function in saved search
Create a subfolder in the file cabinet using script
In the script, we can create a subfolder in the file cabinet. let val = -15; //Internal ID of the parent folder let objRecord = record.create({ … Continue reading Create a subfolder in the file cabinet using script
How Estimate Extended Cost is calculated in Sales order.
The Est Extended Cost is calculated based on the following formula. Est Extended Cost = [ Location Total Value/ Location on Hand ] * transaction quantity Location Total Value = Location On Hand * location average cost. Here the item location inventory quantity on hand is 10 and average cost is 20 and transaction quantity… Continue reading How Estimate Extended Cost is calculated in Sales order.
How to set approval status based on all child records in PM Approval Record using script
In the PM Approval record, we have to set the approval status as ‘Approved’ when all the child records approval status as ‘Approved’. let newRecord = scriptContext.newRecord; if (scriptContext.type == ‘xedit’ || scriptContext.type == ‘edit’) { let… Continue reading How to set approval status based on all child records in PM Approval Record using script
How to set the estimate extended cost using client script
In the client script, we can set the sublist value in the fieldChanged() function. function fieldChanged(scriptContext) { try { let currentRecord = scriptContext.currentRecord; if (scriptContext.sublistId == ‘item’ && scriptContext.fieldId == ‘location’) { … Continue reading How to set the estimate extended cost using client script
How to restrict the edit button using user event script
In the user event script, we can disable or remove the standard buttons using button id. If you need to restrict the edit from the lists view use error message and throw that error based on your condition. Do not add try catch block for the error create portion. If you add try catch for… Continue reading How to restrict the edit button using user event script