How to Access form section field of record using business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 02:38 AM
How to Access form section field of record using business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:22 AM
Show what have you written
and show the form(the record)
and the related record form section is referencing to
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 06:17 AM
Need to Glide company from general form section.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 06:43 AM - edited 09-27-2023 06:44 AM
The reference field is Company , no significance of the section t all
(function executeRule(current, previous /*null when async*/ ) {
var fc= new GlideRecord('core_company'); // this is the table yoru form section field points to
fc.addQuery('sys_id', current.<company field name>); //add the right field name
fc.query();
if (fc.next()) {
//Do whatever
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 07:09 AM - edited 09-27-2023 07:16 AM
Hello @Rohith2 ,
I tried with background script, you can modify as Business rule according to your requirement, Please find code below
var gr = new GlideRecord('sys_ui_element');
gr.addQuery('sys_ui_section.name','incident'); // name should be table name
gr.addQuery('sys_ui_section.caption','Related Records'); // caption should be Section name which you want to access
gr.query();
while(gr.next()){
gs.print(gr.element);
}
we have two OOB tables which are sys_ui_element, and sys_ui_section. These tables store elements, sections, and views of the forms. If u observe those tables, you will get some idea about your requirement
Please mark my answer helpful and correct, if it helps you
Thank you
Thank you
G Ramana Murthy
ServiceNow Developer