Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Error Message coming twice(bi-directional)

ar-mi
Tera Contributor

Hi Community,

 

I have a requirement to configure an error message in control workspace view when no risks are attached to the control, it should show an error message and block the save action. I have implemented it using a before update Business Rule but when we go through Risk form and remove a control from the risk, the same message comes up here as well. In both scenarios, the message comes up when we remove either Risk from Control or Control from Risk.


Thanks!

1 REPLY 1

KanteS
Tera Guru

Hi 

 

The issue occurs because the Business Rule is implemented on the sn_compliance_control table and runs on update. When a relationship between Risk and Control is removed from either the Control form or the Risk form, the platform updates the Control record, which triggers the Business Rule in both scenarios.

So try to  implement the validation on the relationship table sn_risk_m2m_risk_control. Since the relationship between Risk and Control is stored there, the validation can run when a relationship is deleted.

Create a  Business Rule on sn_risk_m2m_risk_control and check whether the record being deleted is the last relationship for that Control.

 

if my answer is helpful give a like and mark as soultion

Thank you