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

  • Check this discussion, I hope it can help

     sugarclub.sugarcrm.com/.../22671

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

  • 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
  • Hello Dmytro,

    Indeed that seems like a perfect solution for this case! Would like it to be able to do it from the studio but oh well.

    Im new to logic hooks, but they do seem powerfull.

    I've read the post but noticed your link to the custom module is gone. Would you mind sharing it again so I can test it?

    Thanks for sharing!

  • Hello  José Carlos,

    Sure -  here is the logic hook configuration in ZIP, also a logic hook configuration - a drawing from which logic hook ZIP is generated.


     OnPrimaryContactIsChanged.zip

    Logic hook configuration drew in the Logic Builder environment (follow the while line to read)


    I also updated the article by the ref, thank you


    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

  • Thanks! That totally worked!

    We just has to add a timer to our process to give time to the logic hook to do its thing.

    Thanks again!

    NOTE: We actually noticed that this is an inbuilt feature on Sugar 11.1 but is not available to non-cloud just yet.