Sugar BPM between Contacts and Accounts

Hi everyone, 

I want to create a BPM which helps us to track the number of main contacts of all the accounts and send a email alert if the number of main contact is not equal to 1

In the module "Contact", Main contacts are identified by a checkbox field renamed “Principal Adhérent”.
in the “Account” module, we already have a calculated field which allows us to count the contacts whose checkbox checked is "Principal Adhérent" (this field count the number of mains contacts of each account).

Here is my workflows : 

Start Event : context : for New records and all updates

Context is when a new contact is created or updated and the "Principal Adhérent" is different to 1.

1st branch indicates that if the number of main contacts is greater than 1, then the “Principal Adhérent” field is unchecked.



2nd branch indicates that if the number of main contacts is null, then leave the “Principal Adhérent” field checked.



Once the BPM has checked these conditions, I want to send a notification to the assigned person (by emails)



My current process doesn't work. Can you help me adjust my workflow?

With exclusive gateway, it must have a default Flow ? 

And i don't know how to use the parallel Gateways in my case.

Best Regards, 

Phuong.

  • Hi  ,

    A default path for exclusive gateway is considered best practice but not required for a process definition to function. A default path ensures any gaps in your routing criteria are covered. Without a default path identified, if a record does have a gap in your routing criteria, it will create a hung process since it doesn't have a path to proceed. 

    With regards to your process design, you don't need to use a parallel gateway element. If you want both of those actions to generate the same alert, then feed those actions directly to the alert. If you only want one of those actions to send an alert, then feed the other action directly to the end event. Parallel gateways are intended to be used where you want multiple paths to happen simultaneously, so there should be a minimum of 2 outgoing paths from a parallel gateway for it to be considered valid. 

    Chris

  • Hi  , 

    Thanks for your reply. I've modified my workflow and it seems to work except for sending a message to user who did the modifications. (i've not receive any alert mail)

    By the way, I've tried my workflow and want to improve the conditions.

    As you know, I've recently added this field “Nombre Contact Principal” which is the sum of contacts with the field “Principal Adhérent” checked in module "Contacts"

      

    Here is my scenario:
    When I check the "Principal Adhérent" field on the contact "Phuong 3 TRINH 3", I want the "Principal Adhérent" field on the contact "Phuong 2 TRINH 2" to be automatically unchecked. or "Phuong 3 TRINH 1", the "Principal Adhérent" field on the contact "Phuong 2 TRINH 2" must be automatically unchecked (any other contact excep for the contact with "Principal Adhérent" checked)

    To achieve this, I tried using a filter based on the modification date, but I cannot configure this filter to check the modification date or Creation date before the Run Time. As a result, the workflow modifies the already existing contac, insteade of applying the change to the new contact being created or updated.

    Maybe it's not the best approach, but if you have other solutions, I'd love to hear from you.

    Best regards, 

    Phuong

  • Hi  ,

    Regarding the alert not being received, this is likely due to a bug introduced last year in how SugarBPM tries to send emails. The bug occurs in that if the user you choose to send the email from does not have their personal outgoing email configured in Sugar, the email will fail to send. Prior to this bug, it would try to send the email as the user through the system email account so as long as the system email account had send as permissions configured properly on the mail server, the mail would succeed. My recommendation is to only send BPM emails from the system account since that is the only account you can reliably control as an admin.

    If you want to use other users to send BPM emails, I recommend purchasing our Upsert BPM Essentials plugin. One of our newest features gives you visibility into emails that fail to send via BPM since Sugar does not natively provide this transparency:

    With regards to your business requirement to keep the latest record as the Principal Adherent, I recommend the following:

    1. Create a dropdown field (e.g. Principal Adherent Status) in the Contacts module with the following options:
      1. blank
      2. Current Principal Adherent
      3. (optional) Past Principal Adherent
    2. Mass update all the contacts where 'Prinicipal Adherent' is checked to have a value of 'Current Principal Adherent'
    3. In your process definition action, set the filter to update contacts where 'Principal Adherent Status' equals 'Current Principal Adherent'. Set the action to uncheck 'Principal Adherent' and set 'Principal Adherent Status' equal to blank or 'Past Principal Adherent'
    4. Create a following action to then update the current record in the process and set 'Principal Adherent Status' equal to 'Current Principal Adherent'

    I hope this helps!

    Chris

  • Hello  ,

    Thanks for your recommandation. I'll try to send the email as the user through the system email account so as long as the system email account had send as permissions configured properly on the mail server. But our system e-mail settings bug, i can't open it. 

    I've tried your solution, the logic is good but is it possible to have both actions in a process definition? I could'n modify my first action of my first path (More than 1 main contact) anymore since yesterday. 

    Best regards, 

    Phuong

  • Hi  ,

    If your system email settings is not opening, it may be because you are configured with Microsoft Office 365 and the Entra app is set to multitenant. Due to some changes in Entra earlier this year, we have been setting all of our clients' Entra apps to be single tenant. Sugar Support may have a hotfix available for you if you want to try and continue using the multitenant Entra app, but my recommendation is to create a new single tenant app. 

    With regards to the process definition, two actions are necessary because the filtering criteria on which contact(s) you are updating are different. The first action is updating contacts where their status is 'Current Principal Adherent' and the second action is updating the most recent contact where the 'Principal Adherent' field is checked.

    Chris

  • Hi  , 

    I've already tested sending tickets and emails and it worked, so I think our SUGAR system has a bug.


    I understand why it must be 2 actions, and i'm totally agree with yo. But In my process definition, after setting the 1st action, I can no longer modify it. The page has been loading since late yesterday morning. I've also tried to duplicate the definition, and i have a same probleme.

    Have you tried to create a definition of process with 2 actions like mine ? Does it work ?

    Kind regards, 

    Phuong