π ServiceNow Interview Questions Grind
Q1: How to set the default value of a Date/Time field to the current date-time?
π Answer:
Go to the Dictionary of the respective Date/Time field and set the default value as:
π‘ Pro Tip: Use this when you want a field to auto-populate with the current time (e.g., βOpened Atβ).
Q2: What is Client Transaction Timing?
π Answer:
Client Transaction Timing provides detailed information β±οΈ on the duration of transactions between the client and the server.
π Requirement: Activate the plugin β Client Transaction Timing Plugin.
π‘ Use Case: Helpful in performance troubleshooting.
Q3: What does theΒ setWorkflow(e)
function do?
π Answer:
-
setWorkflow(true)
β Enables business rules, workflows, and auditing (default). -
setWorkflow(false)
β Disables business rules and auditing for that operation.
π Example:
π This updates the record without triggering business rules.
β οΈ Interview Hint: Useful when updating records in bulk without triggering unnecessary rules.
Q4: What does theΒ setForceUpdate()
function do?
π Answer:
Forces the record to be updated even if no fields were changed.
π Example:
π‘ Pro Tip: Handy when you want to fire business rules or workflows even if the record data didnβt change.
Q5: What is the significance of theΒ setLimit(n)
function?
π Answer:setLimit(n)
restricts the number of records returned by a GlideRecord query.
π Example:
π Returns only 5 incidents.
Q6: How to get the row count in a GlideRecord?
π Answer:
Use the getRowCount()
function.
π Example:
Q7: What is the difference betweenΒ deleteMultiple()
and deleteRecord()
?
π Answer:
-
deleteMultiple()
β Deletes multiple records matching the current query (but does not delete attachments). -
deleteRecord()
β Deletes a single record (including its attachments).
π Example:
π‘ Pro Tip: Use deleteMultiple()
carefully β οΈ β itβs powerful and can wipe out large data sets quickly.