Which options are strategies for debugging client-side scripts? Choose 2 answers
Correct Answer: B,D
Debugging client-side scripts in ServiceNow involves using methods that provide feedback during script execution. The following methods are commonly used: * g_form.addInfoMessage(): * Description: Displays informational messages to the user within the form interface. * Usage: g_form.addInfoMessage('Your message here'); * Purpose: Useful for providing real-time feedback or debugging information directly on the form during script execution. * jslog(): * Description: Logs messages to the browser's console. * Usage: jslog('Your debug message here'); * Purpose: Helps developers output debugging information to the browser console, which can be inspected during development. Incorrect Options: * gs.addErrorMessage(): This is a server-side method used to display error messages to the user and is not applicable for client-side debugging. * gs.log(): Another server-side method used to log messages to system logs, not suitable for client-side script debugging.
Question 137
Which one of the following is true for GlideUser (g_user) methods?
Correct Answer: C
The following is true for GlideUser (g_user) methods: Can be used in Client Scripts, UI Policies, and UI Actions. This is true because GlideUser (g_user) methods are part of the client-side scripting APIs that provide information about the current user and the user's preferences. Client Scripts, UI Policies, and UI Actions are all types of client-side scripts that run in the web browser and manipulate the user interface. The following are not true for GlideUser (g_user) methods: Can be used in Client Scripts and UI Policies only. This is false because GlideUser (g_user) methods can also be used in UI Actions, which are another type of client-side scripts that can be triggered by a user's click on a button, link, or choice. Can be used in Business Rules only. This is false because GlideUser (g_user) methods cannot be used in Business Rules, which are server-side scripts that run on the ServiceNow platform and manipulate the database. Business Rules use a different API to access the current user information, which is GlideSystem (gs). Can be used in Business Rules, and Scripts Includes. This is false because GlideUser (g_user) methods cannot be used in Business Rules or Script Includes, which are both server-side scripts. Script Includes are reusable units of code that can be called from any server-side script. Script Includes also use GlideSystem (gs) to access the current user information. Reference: Client-Side Scripting APIs, GlideUser, Business Rules, Script Includes
Question 138
When configuring the content of an Email Notification, which syntax should be used to reference the properties of an event triggering the Notification?
Correct Answer: D
Question 139
What field type would you select if you want to query records from another table on a form?
Correct Answer: D
A). Use the Date field type: This is incorrect. The Date field type is designed to store date values and does not facilitate referencing records from other tables. B). Use the Phone Number field type: This is incorrect. The Phone Number field type is intended for storing phone number data and does not support referencing other table records. C). Use the String field type: This is incorrect. The String field type stores text data and does not inherently provide functionality to reference records from other tables. D). Use the Reference field type: This is correct. The Reference field type is specifically designed to create a link to a record in another table, enabling the incorporation of related data into the form. For example, in the Incident table, the "Caller" field is a reference to the User [sys_user] table, allowing the selection of a user as the caller for the incident. This setup ensures data consistency and leverages existing records without data duplication. For more detailed information, refer to the official ServiceNow documentation on Reference Fields. Explanation: In ServiceNow, to include data from another table within a form, the Reference field type is utilized. A Reference field creates a relationship between the current table and another table by storing a reference to a record in the target table. This allows users to select a record from the referenced table and display related information seamlessly within the form.
Question 140
What section on the Notes tab, shows the history of the work documented on the record?