- 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-12-2022 10:06 PM
Hi,
Seems to be some exercise for your study
So what script did you start and where are you stuck?
Unless you start how would you learn?
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-12-2022 10:30 PM
Hii Ankur,
I have created table and fields.
but,i'm not getting what exactly i have to do in 2nd point.
Regards,
astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 10:37 PM
Hi,
create after insert BR on incident table and then use GlideRecord to insert data into incident_temp table
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:00 AM
Hii Ankur,
I have write this script but it is not working
(function executeRule(current, previous /*null when async*/) {
var rec = new GlideRecord('incident_temp');
rec.initialize();
rec.u_number = current.number;
rec.u_string_1= current.short_description;
rec.insert();
})(current, previous);
Please,help me with this