How to restrict deletion of parent record when it has associated child records?

Ankita Kolhe
Tera Contributor

Hi Community,

 

I created a before delete business rule to restrict users to delete the parent record if it has associated child records.

However it's not working. Record is getting deleted even when parent record has child records. Also, count is displaying as 0 instead it should show value 1.

It seems like the record is getting deleted first and then querying the gliderecord.

 

 

AnkitaKolhe_1-1710748572378.png

 

Please let me know if someone can help me on this

 

Thanks

 

1 REPLY 1

ravigoel
Tera Contributor

Hello Ankita,

 

It seems that you are missing "=" operator in your encoded query on Line 5. Hence, the query may not be working correctly. here's how the query would look like:

"parent="+current.sys_id;

 

Hope it helps.

 

Please mark my response as Correct Answer/Helpful in case it does help.

 

Thanks and Regards,

Ricky