Workflow for password resetting

Project: THR-354
Add a custom checkbox to the customer record.
Create a workflow . In the workflow check if the custom checkbox created is checked. If checked then check the give access Checkbox in the Access subtab of customer record. Then also check the Manually assign or reset password and set a test password. After that send a email to the Customer. Then after sending the Email uncheck the custom checkbox of the customer record.The context of the workflow should be CSV import.

Workflow action Script:

/**
@NApiVersion 2.x
@NScriptType WorkflowActionScript
*/
define(['N/record'], function (record) {
function onAction(scriptContext) {
log.debug({
title: 'Start Script'
});
var custrec = scriptContext.newRecord;
custrec.setValue({ fieldId: 'giveaccess', value: true,ignoreFieldChange: true}); custrec.setValue({ fieldId: 'password', value: "Thermogard@2022", ignoreFieldChange: true }); 
custrec.setValue({ fieldId: 'password2', value: "Thermogard@2022", ignoreFieldChange: true }); }
return {
onAction: onAction
}
});


Created a checkbox in customer record named Password Reset under custom tab. 

Created a workflow to :

  • check the give access field and to assign password as Thermogard@2022.  
  • To send email to customer. 
  • To uncheck the custom checkbox after sending email. 

Whenever a customer record is updated using csv import, workflow triggers and the above actions will execute. 

Email will send to the corresponding customer with different templates depending upon the subsidiary.

Leave a comment

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