- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:18 AM
I'm having two tables table1 and table2, I have written script for insertion of record once I insert record in table1 automatically in table2 record should be create here is my script
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:25 AM
@Community Alums Here is how you should write your script.
var gr = new GlideRecord("u_mytable");
gr.addQuery('u_name',"abraham.lincoln");
if(gr.next()){
var grc = new GlideRecord("u_mytablecopy");
grc.addQuery('u_name',gr.getValue('u_name'));
if(grc.next()){
grc.delete();
}
gr.delete()
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:31 AM
Hi @Community Alums ,
Please use gr.initialize() when your inserting the new record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 08:32 AM
What does this have to do with ServiceNow?
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/