function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vegaln1Vegaln1 

Checking to see if Contact Id is part of entitlement record before deleting contact.

I would like to create a S-Control on the Contact object to NOT allow the contact to be deleted if this contact id exists in another custom object called 'ShipTo'. This custom object 'ShipTo' contains contact id's and contract ids that this contact is associated with. So, in other words, if the contact to be deleted is also referenced in this custom object, 'ShipTo', then issue a message to the user that this contact can not be deleted because it is associated as a ShipTo contact in this custom object. Is this possible via a S-Control and maybe some tips in acomplishing this.

Thanks.
MikeGoelzerMikeGoelzer
Yes, this is easy to do, but you want to look at 'delete triggers' not s-controls.

Google for the "Quoting Application Example" in the Apex docs. It's complex, but figure it out and you can enforce any kind of relational integrity that you want.