Make a copy Scenario in case of Checkbox

when selects the option make a copy in sales order if there is custom field, the value in the custom field also copies to the record.

to avoid this scenario

write code in userEvent before load

    const beforeLoad = (scriptContext) => { 

    if (scriptContext.type === scriptContext.UserEventType.COPY) {

  var currentRecord = scriptContext.newRecord;     

  currentRecord.setValue({   

                fieldId: ‘custbody_email_sent_uis’, 

                  value: false             

  });     

    }               

  }

Leave a comment

Your email address will not be published. Required fields are marked *