or beforeLoad sorry
# suitescript
a
or beforeLoad sorry
t
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
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
Hmm I'm not sure exactly how I would make that happen. Would you mind pointing me in the right direction? Thanks!
Nevermind, I believe I found the correct syntax in the docs
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)
I think my best bet is to figure out exactly what's throwing the print event in the Workflow and try to stop it
r
You can filter by Execution Context != Workflow