You need to sign in to do that
Don't have an account?
Carrlos Boyd
I need help writing a trigger to prevent a record from closing if related records are open
I need help writing a trigger to prevent Obj1 records from being cancelled (Status__c = "Cancelled") or completed (Status__c = "Completed") if there are open activities/tasks that are not completed or cancelled, or if related records from Obj2 or Obj3 are still open. Obj1 may have mutiple related records from Obj2 and Obj3. The look-up field on Obj2 and Obj3 is called 'Obj1__c'.
Please note, since I have faked the Obj, the way you have provided. You may need to change those before run it in your org, specially with the sub SOQL. Please confirm how it go.
All Answers
Please note, since I have faked the Obj, the way you have provided. You may need to change those before run it in your org, specially with the sub SOQL. Please confirm how it go.
Thank you for the help Abdul. Can you please tell me how to add options for the open statuses of my related records? The three statuses are actually "In Progress" and "New".
Line 14 old code that generates error:
Line 14 with new code:
Let me know if this is ok to do please.