Is there a way to push a message from a HOOK to the user ?

Hello,

I have a quick question : Is there a way to push a message from a HOOK to the user ?

The purpose is easy ; during my hook, several job are processed and can return non blocking messages. Is there a way to promote thoses message to the user interface (the same way the Success message is displayed after the process for instance).

Many thanks for your help.

PS : I am aware about the sugar validation process using JS, but the message are provided by external app after insertion, and I don't want to trigger them before my record is saved.

Any solution my superheroes ??? 

  • Hello

    Fred, if you need help or additional explanations about how to use Logic Builder to configure "after save" soft validation and notifications, my team would be happy to help you.

    As far as I understand from comments, a notification is only a soft warning that a user should remember for the future. In our experience, users often forget about it in time. Maybe a good idea would be the following: additionally to the on-time notification, create something to remind in the future. It may be Notes with a particular subject or, if you need good visualization on the context dashboard, it may be TimeLine Viewer Event.

    Logic Builder can easily configure complex algorithms to notify and create new Sugar entities. You can add this logic as a step of the process in SugarBPM to automate complex workflow.

    Best regards,
    Mykola

    Integroscrm.com
    We make work in Sugar
    more convenient and efficient

  • Yes, you are right. Unfortunately, this one is only for BWC modules. I was also using it for BWC modules.

    Keeping in mind what you want to achieve; I can think of the following two options from the top of my head. 

    1. As also suggested, override model save in JS. On the success of save, call custom API sending the bean information to the external solution. Then show the response or message received from that API to the user.

    2. If you still want to use the logic hooks for this purpose. Create two new fields. One for storing the message received from an external source. The second one to decide if the message already shown to the user or not. Now save the information in these fields via logic hook. After that, override the RecordView JS for that specific module and on the model sync, checks the shown bit. If the message text is not yet shown then just show the message stored in the custom field earlier and then set the bit to true so that message will not show up again on refresh of the record.

    I hope this will solve your problem. Happy Coding Slight smile

    Kind Regards,

    Junaid