Will User Event Scripts trigger when a record is c...
# suitescript
b
Will User Event Scripts trigger when a record is created via web services?
j
Yes
b
I'm missing something then
j
Look at the deployment and the script itself to make sure there isn't any exclusions for context
e
Web Services preferences
b
Adding Requisitions, since you can't set the "location" of a Requisition Item via web services, I have a custom field that I set via web services, then have a beforeSubmit script that copies that value to "Location". Right now, it works if I go into the UI and go to Edit then hit Save, but not on creation from web services
yeah, that's set
Untitled
Do I need to set up Roles/Employees/etc in the Audience?
@jarens other than those, I don't see any kind of exclusions
e
yes, you'll need to set the role/audience
j
Yeah. I can only think to make sure it's "released" and deployed to all roles to make sure its running. Also add a log.debug() to the start to see if it's entering the script
b
yeah I mean, like I said, without Roles/Audience, it runs from the UI.
just not from web services
I'll try setting it to Released and doing All Roles
yeah, still not triggering
nvm
I'm dumb
either the roles or the release status fixed it. I was looking at the logs and forgot to switch it back to debug
thanks
🎉 1
@jarens any reason why it'd be properly updating the Location but from the custom field but not unsetting the custom field based on my script? Again -- only a problem in Web Services. If I go to edit and save it updates the location and removes the custom field value. Is it an issue because it's on CREATE from web services rather than EDIT?
j
You might need to check some of your values in the script? If some of these fields aren't populated until after the record commits to the server, you may need to move your script from beforesubmit to an aftersubmit.
When this stuff happens to me, I start logging everything until I have perfect clarity on each stage of execution.
b
I'll give that a try. Thanks
278 Views