How to create record in custom table when a record is created and updated in other custom table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 02:24 AM
Hi ,
I have a Business Requirement ,where - 'If a record gets inserted / Updated in a custom table then same respective record should be created / updated in another custom table'. What script needs to be used in this type of scenario 's.
Please Help me on this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 02:39 AM
Hello,
Write a after insert BR on the 1st table write the below script for getting the record created on 2nd table whenever the 1st table record is created
var gr= new GlideRecord('yoursecondtablename');
gr.initialize();
gr.fieldname1secondtable=current.fieldname1firsttable;
gr.fieldname2secondtable=current.fieldname2firsttable;
gr.insert();
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 01:15 AM
Hello,
If my answer helped you can you also mark it as correct.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 01:41 AM
Since you have the same fields from some other table you may create a BR to Insert/Update the same record. You may use the scripts provided by the other members just for the insert.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 01:45 AM
You have to write Business rule to achieved this -
After Insert - BR should written on first table and in script you have to insert details in another table.
After Update/Async - BR should written on first table and in script you have to update details in another table.