Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 04:58 AM
On a table, there are 15 VIEWS created. I need to seach for a field say 'ABC'.
How to know in which of the 15 views this field 'ABC' is avaialble.
I checked form views, sections, elements etc etc.. but couldnt find a way 😞
Appreciate if you can help 🙂
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 05:21 AM
This may get you started, but please, check all the variables.
var viewGR = new GlideRecord('sys_ui_view');
viewGR.addQuery('name', 'my_table');
viewGR.query();
while (viewGR.next()) {
var sectionGR = new GlideRecord('sys_ui_section');
sectionGR.addQuery('view', viewGR.sys_id);
sectionGR.query();
while (sectionGR.next()) {
var elementGR = new GlideRecord('sys_ui_element');
elementGR.addQuery('section', sectionGR.sys_id);
elementGR.addQuery('element', 'my_field');
elementGR.query();
if (elementGR.next()) {
gs.print('View "' + viewGR.getValue('name') + '" contains "my_field".');
}
}
}
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2024 06:33 AM
What's your business requirement?
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
