CAD · Question #67
Which method is used to retrieve Application Property values in a script?
The correct answer is A. gs.getProperty(). Application property values are retrieved in server-side scripts using the gs.getProperty() method, which accesses both system and application-specific properties.
Question
Which method is used to retrieve Application Property values in a script?
Options
- Ags.getProperty()
- Bg_form.getAppProperty()
- Cg_form.getProperty()
- Dgs.getAppProperty()
How the community answered
(37 responses)- A92% (34)
- C5% (2)
- D3% (1)
Why each option
Application property values are retrieved in server-side scripts using the `gs.getProperty()` method, which accesses both system and application-specific properties.
The `gs.getProperty(property_name)` method is the correct server-side API used to retrieve the value of any system property, including those specifically defined for an application. This method reads the property value from the `sys_properties` table.
`g_form` is a client-side API, and `getAppProperty()` is not a standard or valid method for retrieving properties.
`g_form` is a client-side API, and `getProperty()` is not a standard or valid method on the `g_form` object for retrieving system properties.
While `gs` is the correct server-side object, `gs.getAppProperty()` is not the standard or documented method; `gs.getProperty()` is the universal method for all system properties.
Concept tested: Retrieving system/application properties
Source: https://docs.servicenow.com/bundle/washingtondc-application-development/page/script/server-scripting/reference/r_Global_GlideSystem.html
Topics
Community Discussion
No community discussion yet for this question.