Create custom records using recmach function in script

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

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

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