update the description of the new record with existing

purnendutiw
Tera Contributor

How can we solve this.. I am getting  so much confusion on this.

 

When a record is created from another record, update the description of the new record with existing description + this record has been created with the Incident number.

 

 

1 ACCEPTED SOLUTION

@purnendutiw 

update as this

(function executeRule(current, previous /*null when async*/) {
var newRecord = new GlideRecord('incident');
newRecord.initialize();
newRecord.description = current.description;
newRecord.short_description = 'this record has been created with the ' + current.number;
newRecord.insert();
}
)(current, previous);

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Brad Bowman
Kilo Patron
Kilo Patron

You could add this to the UI Action or other script that is creating the record.  Otherwise, a Business Rule before insert on the table of the record that is being created will do it.  Add a filter condition for whatever field contains the incident number is not empty, then you can write a script to look up the record that has the existing description to populate on the new record.  

Can it be achieve by using business rule? If yes then can you please tell me how.

Uncle Rob
Kilo Patron

So a couple things...
1)  What records are you talking about specifically.  Because there are task types where you wouldn't want to do this.
2)  What do you mean "created from another record"?   Are you talking about something in the related list?  Are you referring to some kind of "copy" button?  

Its like suppose , we have a record in incident table and we want to create new record from that record, and in new record short description its should be written as "This record has been created with the +incident.number.