if(type == "print" && subsidary == '1') {
var record = nlapiLoadRecord('salesorder', nlapiGetRecordId());
var count = record.getFieldValue('custbody_printcount');
record.setFieldValue('custbody_printcount', Number(count) + 1);
nlapiSubmitRecord(record);
}
a
alien4u
12/10/2018, 2:53 PM
No sure how to do that in SS 1.0 but I would limit that code to run on Execution Content UI(User Interface)... that should solve your problem...
t
Tyler
12/10/2018, 2:54 PM
Hmm I'm not sure exactly how I would make that happen. Would you mind pointing me in the right direction? Thanks!
Tyler
12/10/2018, 3:01 PM
Nevermind, I believe I found the correct syntax in the docs
Tyler
12/10/2018, 3:25 PM
So I was able to test with the context but I'm running into a different issue - it appears the Workflow we have in place that sends the acknowledgement email is triggering a userevent "print" event, which is the same event type when a user clicks the Print button (because the code isn't actually being executed on the userinterface side)
Tyler
12/10/2018, 3:25 PM
I think my best bet is to figure out exactly what's throwing the print event in the Workflow and try to stop it