Adding a related contact on create (Admin)

Hello!

Our team has been stuck on these one for a while.

Recently we implemented some processes to notify clients on the status of cases. We managed this without a problem.

However we noticed something odd. Since the contact is related automatically when it is created in the web portal the info cant be added when it is created via de admin web.

To be clearer, when a case is created in the admin web the related Contact module is not populated.

We've tried adding the contact in the "Primary Contact" since that seem to be updated when the source is the portal. However this will not create the relation.

From portal:

From admin:

Of course we could link the record in the subpanel after creation, but that would skip our process for new records

Any way to create a field on the creation menui that would relate the contact?

Thanks in advance

Parents
  • From clients/portal/api/ModulePortalApi.php, on saving any record in Portal, it will automatically set the field primary_contact_id (1:M relationship between Contacts and Cases) and its M:M relationship (subpanel under Cases).

    So the solution may be an after_save LogicHook on Cases that evaluates from which platform (base or portal) the Case has been created and then decide whether to set that M:M relationship accordingly.

    Another possible solution is to create a custom BaseCaseApi which setup that relationship on createRecord.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply
  • From clients/portal/api/ModulePortalApi.php, on saving any record in Portal, it will automatically set the field primary_contact_id (1:M relationship between Contacts and Cases) and its M:M relationship (subpanel under Cases).

    So the solution may be an after_save LogicHook on Cases that evaluates from which platform (base or portal) the Case has been created and then decide whether to set that M:M relationship accordingly.

    Another possible solution is to create a custom BaseCaseApi which setup that relationship on createRecord.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children
No Data