Can you help me

teja6
Kilo Contributor

Create a business rule 'Remove Temp Incident  Rule' , This should execute only whenever any record removed from 'Incident' table.
             - Query the incident number from 'incident_temp' table based on removed Incident Number record from 'Incident' table
             - Remove the corresponding incident record from 'Incident_temp' table

1 ACCEPTED SOLUTION

Advanced checkbox should be checked.

When to Run - before and delete checkbox should be checked.

Code will be this - 

 

var gr = new GlideRecord('incident_temp');
gr.addQuery('field_name', current.number); 
gr.query();

if(gr.next()) {
  gr.deleteRecord();
}

 

For Full Detail of Business Rules go through the below link - 

Create Business Rule

View solution in original post

6 REPLIES 6

nayanawadhiya1
Kilo Sage

Write Before Delete BR and in the script glide the incident of 'incident_temp' then delete the record from incident_temp table.

can u give the details explaination bro

Advanced checkbox should be checked.

When to Run - before and delete checkbox should be checked.

Code will be this - 

 

var gr = new GlideRecord('incident_temp');
gr.addQuery('field_name', current.number); 
gr.query();

if(gr.next()) {
  gr.deleteRecord();
}

 

For Full Detail of Business Rules go through the below link - 

Create Business Rule

thank you