I want to copy short description and description of parent whenever we click on new child incident?

Prathamesh Chav
Tera Contributor

Hi Team,

 

After parent is getting created we are clicking on new child record,

and when we click on new it should fetch parent short_des and Description.

 

Can anyone help me in this?

6 REPLIES 6

Anurag Tripathi
Giga Patron

SN_Learn
Mega Patron

Ravi Gaurav
Giga Sage

Hi @Prathamesh Chav 

 

You can create a BR (Before Insert prefebally)and write a logic below :-


// Check if the incident has a parent
if (current.parent) {
// Get the parent record
var parentIncident = new GlideRecord('incident');
if (parentIncident.get(current.parent)) {
// Copy the short description and description from parent to child
current.short_description = parentIncident.short_description;
current.description = parentIncident.description;
// Optionally, you can also copy other fields if needed
}

Ankur Bawiskar
Tera Patron

@Prathamesh Chav 

there are multiple ways to do this

1) before insert BR on child table

OR
2) display BR on child table and get the value from parent reference field and set

what did you try so far and what didn't work?

If my response helped please mark it correct and close the thread so that it benefits future readers.