ServiceNow Certified Application Developer — Question 119
Which of the following methods are useful in Access Control scripts?
Answer options
- A. g_user.hasRole() and current.isNewRecord()
- B. gs.hasRole() and current.isNewRecord()
- C. g_user.hasRole() and current.isNew()
- D. gs.hasRole() and current.isNew()
Correct answer: B
Explanation
The correct answer is B because 'gs.hasRole()' is the appropriate method to check user roles in Access Control scripts, and 'current.isNewRecord()' accurately identifies if the record is new. Options A and C incorrectly use 'g_user' instead of 'gs', while option D uses 'current.isNew()', which is not the correct method for this context.