- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2022 10:05 PM
- Create a table called ‘incident_temp’ with below two fields
Incident Number
Short Description - Create a business rule, this should execute only whenever any new incident created on ‘Incident’ table
- Create a new record in ‘incident_temp’ table from above newly created Incident record and set Incident Number and short description values and save the record in ‘incident_temp’ table
Please, help me with 2nd point
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 12:07 AM
Hi,
script looks ok
I hope BR is after insert on incident table
are you sure the table name is incident_temp or it is u_incident_temp
(function executeRule(current, previous /*null when async*/) {
var rec = new GlideRecord('u_incident_temp');
rec.initialize();
rec.u_number = current.number; // field name is correct?
rec.u_string_1= current.short_description; // field name is correct?
rec.insert();
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 12:07 AM
Hi,
script looks ok
I hope BR is after insert on incident table
are you sure the table name is incident_temp or it is u_incident_temp
(function executeRule(current, previous /*null when async*/) {
var rec = new GlideRecord('u_incident_temp');
rec.initialize();
rec.u_number = current.number; // field name is correct?
rec.u_string_1= current.short_description; // field name is correct?
rec.insert();
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 12:30 AM
Hii Ankur,
my bad
i have put wrong table name .now it is working fine.
Thanks and Regards,
Astik Thombare
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 01:44 AM
Glad to know.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2022 03:48 AM
I have marked it as correct.
Thanks for your help.
regards,
Astik