What is the alternate for gel() in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 12:56 AM
Hi All,
I have the client script with the gel() method but I want to replace gel() with something else.
Please help me with an alternate for gel() in the client script
Sample Line below:
var name = gel('service_select_0'));
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 01:22 AM
There's not a 1 on 1 replacement. You really have to look at the individual cases, what your developers have setup, what the functionality is, if you can rebuild such, or that you have to abandon the functionality, etcetera.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 01:29 AM
Probably the first time I am seeing anyone use etcetera and not just etc. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 01:28 AM - edited 01-08-2024 01:28 AM
You are looking to find alternate of gel(), which is not recommended, basically DOM manipulation is not recommended, so any alternate you use for the same, it will still not be a good practice.
For eg, stealing is bad, what is the alternate - There is no alternate just don't steal.
As Mark rightly said, depends on the case what you are trying to do , in many cases you can find an OOB api for the same, eg to show / hide fields, field styles, field behavior , all these can be done in javascript using get() but servicenow has alternate functions to control this in g_form api.
