Connect a related record via Workflow

Hi,

quite simple question.

I have Module A and Module B.

In Module A there is a new record created by incoming Mails. Some Values of the Record are set by the Subject of the Mail via Workflow.

In This context i'd like to relate/connect that record to another record in a different Module (B) depending on the specific Value in Subject.

For e.g.

Subject is: "Car Type 123 is having a Problem"

So depending on that

Field 1 - Product "Car"
Field 2 - Type "123"
Field 3 - Problem

Field 4 - State "Open"

are getting a specific value - that works totally fine.

But the missing part is a relationship to the Module B and the record there.

Like - action -> link record to related Module B and record "Failure Type 098"

I hope it's clear what i'm looking for.

 Thanks!

Parents
  • I don't have Workflow (BPM) because I'm on Professional but I can give you a non-Workflow solution.

    I assume you are using the Emails module to receive the email and create the record in Module A.

    That means you probably have a relationship between Emails and ModuleA.

    When an Email comes in the Email record is Related to ModuleA.

    In ModuleA you can add an after_relationship_add logic_hook
    https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_9.0/Architecture/Logic_Hooks/Module_Hooks/after_relationship_add/

    Check if the relationship you just added is between Emails and ModuleA, if so then retrieve the information you need from ModuleA to determine which ModuleB to relate, and add the relationship between ModuleA and ModuleB programmatically. (I know there's a developer manual page somewhere about this but I can't seem to find it - let me know if you need an example)

    FrancescaS

Reply
  • I don't have Workflow (BPM) because I'm on Professional but I can give you a non-Workflow solution.

    I assume you are using the Emails module to receive the email and create the record in Module A.

    That means you probably have a relationship between Emails and ModuleA.

    When an Email comes in the Email record is Related to ModuleA.

    In ModuleA you can add an after_relationship_add logic_hook
    https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_9.0/Architecture/Logic_Hooks/Module_Hooks/after_relationship_add/

    Check if the relationship you just added is between Emails and ModuleA, if so then retrieve the information you need from ModuleA to determine which ModuleB to relate, and add the relationship between ModuleA and ModuleB programmatically. (I know there's a developer manual page somewhere about this but I can't seem to find it - let me know if you need an example)

    FrancescaS

Children
  • Hi Francesca,

    thanks for the reply.

    I'm working on Sugar Prof 8.0

    And your answer was a bit in a different direction.

    To explain it a bit more.

    You can create relations between records (Module A and Module B)

    So in a record in Module A you can search in the Field "Relation to Module B" for the Name of a record in Module B and connect them.

    But i'd like to have a possibility to automatically connect the record from Module B to the record in Module A via an advanced workflow or something like that.

    Maybe more understandable?

    Best,
    L.