Real time workflows cannot trigger integration app data flows in NetSuite. You need to create a scheduled Workflow. Below is a suggested workaround from NetSuite Answers:
When a scheduled Set Field Value action runs, it sets the value of the field but it doesn't trigger any User Event scripts. A workaround for this scenario is to create a custom workflow action that will set the field value using SuiteScript.
For example, the Set Field Value action below will set the field Comments, in the customer record, with "Good Customer". This action will run one hour after the record enters the workflow state that contains the workflow action but it will NOT trigger any User Event scripts:
New Action > Set Field Value
Trigger On = Scheduled
Scheduled > Use > Delay = checked
Scheduled > Delay = 1
Scheduled > Unit = Hour
Field = Comments
Value > Static Value = Checked
Value > Text = "Good Customer"
If it is necessary to trigger User Events scripts when the field value is set, the scheduled workflow action above needs to be replaced with a scheduled Custom Workflow Action that will change the field value using the script below:
setFieldValue()
{
var id = nlapiGetRecordId();
var customer = nlapiLoadRecord('customer', id);
customer.setFieldValue('comments','Good Customer');
nlapiSubmitRecord(customer);
}
For additional information on how to create Workflow Action Scripts see the Help Guide:
SuiteFlow (Workflow) : Workflow Core Concepts : Workflow Action Scripts
Comments
Hi for anyone trying this script. My script was:
function setValueScriptCustom()
{
var id = nlapiGetRecordId();
var customer = nlapiLoadRecord('customer', id);
customer.setFieldValue('comments','Good Customer');
nlapiSubmitRecord(customer);
}
Please sign in to leave a comment.