Custom JavaScript Code Snippet
The Go app can execute custom JavaScript code snippets. The code is downloaded to the client app during configuration sync. Unlike web services, this custom code snippet is executed even if the client app is offline. For custom JavaScript errors, an error or a confirmation message is displayed. Tapping the error or confirmation message highlights the specific line item where the error occurred.
For more information on how to define these code snippets, see Custom JavaScript Snippet Support.
JavaScript code snippets can be configured on the following:
After Add Record
After Save/Insert
Before Save/Insert
Custom Button
Field Change
Page Load
For information on:
How to access information about attachments for a record using code snippets, see Access Information About Attachments for a Record.
How to get user details and device details, see Get User Details and Device Details.
How to display error messages in the respective fields on the header and child sections, see $response API.
* 
By default, the validation error appears in the Overview tab in the ServiceMax Go app, if the JavaScript code does not specify where the error should appear.
The After Add code snippet gets executed on Add button of the work detail section. Refer to the OnChange, OnExit, and AfterAdd terminologies for more information.
Was this helpful?