Is SuiteQL ‘not allowed’ in an afterSubmit UserEve...
# suitescript
c
Is SuiteQL ‘not allowed’ in an afterSubmit UserEvent script? When I test my query using @tdietrich’s SuiteQL Query Tool the query returns the expected results; however, when loading in an afterSubmit function I’m getting an error
"type":"error.SuiteScriptError","name":"SSS_SEARCH_ERROR_OCCURRED","message":"Search error occurred: Unknown identifier 'custrecord_kiza_cc_fill_commitment'. Available identifiers are: {}","stack":["runSuiteQLInternal(N/query)","afterSubmit(/SuiteScripts/KizaScripts/kiza_fill_ue.js:34)"],"cause":{"type":"internal error","code":"SSS_SEARCH_ERROR_OCCURRED","details":"Search error occurred: Unknown identifier 'custrecord_kiza_cc_fill_commitment'. Available identifiers are: {}","userEvent":"aftersubmit","stackTrace":["runSuiteQLInternal(N/query)","afterSubmit(/SuiteScripts/KizaScripts/kiza_fill_ue.js:34)"],"notifyOff":false},"id":"","notifyOff":false,"userFacing":false}
t
@Colleen Hammersley Just a hunch, but I think this might actually be a permissions issue. I would check to see if the role you're using has access to the custom record that you're referencing.
c
Thanks @tdietrich I’m running this as administrator at this point, and I am able to CERD the record with out a problem [by removing that section of code]…. any other thoughts?
Update: my error was within the javascript code… I failed to properly insert the required space between the last SELECT column name and the FROM statement 🤦‍♀️