I need to write a script include to fetch data for one field in table A from another table .
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 02:49 AM
The condition is, I need to auto populate some fields in table A from table B. Shall I have to write a script include or it can be done using business rule also. Please help me with the following.
Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- 208 Views
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 03:00 AM
You can write an after business rule to run on update.
The BR should be created in the first table.
Check below sample code:
(function executeRule(current, previous /*null when async*/) { var gr = new GlideRecord('second_table'); current.field_name = gr.field_name; gr.update(); }(current, previous);