<@UCZ7FEPJM> Try this. Trigger on Before Record L...
# suiteflow
t
@Yadigar Try this. Trigger on Before Record Load and set Event Type to "Email"
y
@TJ Cornelius Thanks, I will check that and update you soon.
@TJ Cornelius Unfortunatly it doesn't work- Value cannot be set in BEFORELOAD on already existing (not a new) record.
t
@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...
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
@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
@Yadigar Let me know if you run into any snags and I would love to help out.
y
@TJ Cornelius 👍