How to delete current record in a business rule

e_wilber
Tera Guru

How do you delete the CURRENT record in an on-after business rule?


We have a checkbox that's part of another process that, when checked, will trigger the deletion of the current record.

 

Is there something like current.delete? Or do I need do to a glidequery back to the existing record to delete it?

3 REPLIES 3

Vanderlei
Mega Sage

Hi, current is already a GlideRecord of the current record, that is, you can use current.deleteRecord()

 

Vanderlei_0-1698329833515.png

If my answer helped you, please mark my answer as helpful.

 

Vanderlei Catione Junior | LinkedIn

Senior ServicePortal Developer / TechLead at The Cloud People

Wybren1
Tera Guru

Did you try current.deleteRecord(); ?

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Why to have a checkbox, and then user checks the box and saves the recrd which triggers instant deletion>?Why not just have a delete ui action for better user experience.

 

Also why delete, cant you just deactivate the data? It doesn't sound like some transitional data if user is taking action on it.

 

-Anurag