Logic Hook Needed: Set Account Assigned User to a related Module everytime a record is saved/edited in that related module.

Hello Devs,

I would like to implmenet a Logic Hooks outside the BPM, which will be executed every time a record is saved in Module B. Module B is related to module A in a 1:n connection. So module A can have multiple records in module B.

Module A has an assigned user and this user should also be set as the assigned user in the record in module B whenever a record has changes in module B. But this ONLY if in module B in the dropdown field "program" the value "gold" is filled in.

I don't have a plan how to realize this and need your help.
I am looking forward to your ideas.


Many thanks in advance!

Kind regards
Martin

Parents
  • Hello Martin 

    This might be configuring rather than DEV task.
    Let me just clarify the requirement

    Let's assume ModuleB has a number of ModuleA records on the subpanel (Module B is related to ModuleA in a 1:n connection, so for each ModuleB rec could be a number of ModuleA recs, correct?)
    When ModuleB rec changes and its "program" goes "gold" with that change saved, which one of many ModuleA record Agssignedto value has to be set to the parent ModuleB rec AssignedTo?
    It looks like there could be many different AssignedTos  for different ModuleA recs that belongs to the one ModuleB rec

    Could it be that in your req ModuleA to ModuleB is 1:n, so that ModuleA has many ModuleBs recs on the subpanel  and the task is to set parent ModuleA.AssignedTo to equal to child ModuleB.AssignedTo as soon as any of ModuleB's program goes gold with ModuleB save?

    Best Regards,
    Dmytro Chupylka

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

  • Hi Dmytro,

    thanks for that quick reply.

    Could it be that in your req ModuleA to ModuleB is 1:n, so that ModuleA has many ModuleBs recs on the subpanel  and the task is to set parent ModuleA.AssignedTo to equal to child ModuleB.AssignedTo as soon as any of ModuleB's program goes gold with ModuleB save?

    That's it exactly:
    Module A can have multiple Module B Recors, not the other way around. And whenever a module B record is modified and saved, the assigned user of the parent record from module A should be pulled and set beforehand. But only if the conditions are met (gold).

    Kind Regards,

    Martin

Reply
  • Hi Dmytro,

    thanks for that quick reply.

    Could it be that in your req ModuleA to ModuleB is 1:n, so that ModuleA has many ModuleBs recs on the subpanel  and the task is to set parent ModuleA.AssignedTo to equal to child ModuleB.AssignedTo as soon as any of ModuleB's program goes gold with ModuleB save?

    That's it exactly:
    Module A can have multiple Module B Recors, not the other way around. And whenever a module B record is modified and saved, the assigned user of the parent record from module A should be pulled and set beforehand. But only if the conditions are met (gold).

    Kind Regards,

    Martin

Children
  • Hello Martin,

    OKay-  however, there is always a place for some requirements adjustments - that is why SugarCRM admins might prefer configuring and reconfiguring instead of ordering code development for such small tasks

    Here is the logic hook configuration for the scenario:

    1) the drawing of the logic hook - it's easy to read, just zoom in and follow the while line for reading (white is  the main logic flow)
    2) the video of the behavior configured



    and video (switch to the full-screen when viewing)




    In regards to some adjustments that may derive from the video - I suppose you'd prefer to have ModuleA.AssignedTo not updated for the second time if there is a "gold" ModuleB's already related to ModuleA previously, correct?

    Here is a ready-to-use zip  of logic hook implementation designed
    z20210910_flowchart_lb613.zip
    , but I suppose your real modules are not ModuleA and ModuleB either
    Therefore, so to make it work for your real modules, the actual metadata should be applied in the drawing.

    It takes minutes to configure and adjust logic hooks configurations with the Logic Builder tool to which I have access to
     I would be happy to help make ready-to-use logic hook work for your metadata - just let me know and I will guide you so that you could do configuring yourself.

    Best Regards,
    Dmytro Chupylka

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