We have a custom object - ExternalPortal Users which is a child of Opportunity and Contact.
There is a checkbox on Contact - IsExternalPortalUser. If checked creates ExternalPortal Users record.
When an opportunity is closed won. The Owner selects the contacts that need access to the portal and ExternalPortal users records are created for those contacts. We want the check off the box on contact to track if that contact is ExternalPortal User.
When we check off the checkbox(IsExternalPortalUser) on contact during opportunity path the trigger in Contact fires to again create a child record for this Contact. I know we can put some WHERE clause in the SOQL to prevent the class from creating one more record. But any other suggestions on how we can improve or remove this cyclic dependency?