- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 01:09 PM
Hi All,
New to servicenow and business rules.
We have two tables - primary and secondary. Based on the drop down value selected in primary field, I have to create a new or update existing record in the secondary table to show that field in the secondary table.
- Should I create the rule on the primary table in this case?
- what would be the best way to get the values into the related fields in the secondary tables..
Thanks!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 11:37 PM
Hi,
Yes you can create Business rule on your Primary Table and in the script you can GlideRecord('Secondary Table') to create or update existing record in Secondary Table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 09:41 AM
Yes, it is .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 09:06 PM
May be you have not given the correct field name for Project name and instance version fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 07:43 AM
Have double checked all the field names.. the issue still persists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 10:07 PM
Can you show me the script and the output you are getting?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2022 09:13 AM
Hi Rahul,
The business rule is created on the primary table to run after insert/update.
Here's the script I have written -
Update - I had to recreate the table u_instance_details due to some error. Post date, I had made sure to change all the field values to the correct ones, but now the new records are not being created in the u_instance_details table at all.