SuiteCRM Logic Hooks to disable Portal User after deleting related Contact

Hello,

I was looking for a way to automatically disable a Portal User when the related Contact is deleted from the crm.

I don’t know how to implement this but it would be nice if there is some kind of logic hook that I could use in this case.

I found this: http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.7/03_Module_Framework/Logic_Hooks
but I’m not really sure if this specific documentation applies to Sugar CE and SuiteCRM.

Any help about the specific problem (disable portal user after contact deletion) or generally about logic hooks would be greatly appreciated.

Regards,
George

Hi George,

Sorry for the delay in replying.

The link you posted also applies to SuiteCRM. In order to do what you need you could create an after_delete logic hook.

In the logic hook you could then make a call to disable the portal user. To disable you could either make a call to:

example.com/index.php?module=Contacts&action=disablePortalUser&record=IDOFCONTACT

or you could check the code that the above runs (found in custom/modules/Contacts/disablePortalUser.php) and use that in the logic hook.

Hope this helps,
Jim

1 Like