@Yadigar Try this. Trigger on Before Record Load and set Event Type to "Email"
y
Yadigar
09/25/2018, 7:08 PM
@TJ Cornelius Thanks, I will check that and update you soon.
Yadigar
09/26/2018, 10:47 AM
@TJ Cornelius Unfortunatly it doesn't work- Value cannot be set in BEFORELOAD on already existing (not a new) record.
t
TJ Cornelius
09/26/2018, 12:29 PM
@Yadigar you will not be able to set the field via the workflow, but you can use the trigger to enter a state that triggers a Workflow Action Script on entry. That script is what will set the field. Add an extra state to your workflow with the transition being set to Before Record Load, Event Type = Email. And the condition of the transition to {initialresponsetime} is null and {status} <> 'Closed'. Then create a Workflow Action Script and add it to the new state to trigger on entry. The script could look something like this...
TJ Cornelius
09/26/2018, 12:29 PM
function updateField(){
var recType = nlapiGetRecordType();
var recId = nlapiGetRecordId();
var rec = nlapiLoadRecord(recType,recId);
rec.setFieldValue('initialresponsetime','T'); //assuming that field is a checkbox. If it is not, replace 'T' with the value you are giving it.
nlapiSubmitRecord(rec);
}
y
Yadigar
09/26/2018, 12:40 PM
@TJ Cornelius Hey, thanks again for your quick response. Currently my expertise is at suite-flow. my knowledge at suite-script is lack, but I will give it a chance. THANK YOU!
t
TJ Cornelius
09/26/2018, 12:45 PM
@Yadigar Let me know if you run into any snags and I would love to help out.