BPM to send email to specific business units

If there is nothing already in place, I would do the following:

  1. Create a UD code type of BU
  2. Add a UD Code (of type BU) for each ProdGrp.
    Make the UD Code the same as the ProdCode (for easier relating).
    Set the LongDescription to be a list of email addresses for that BU. Use a semicolon to separate addresses, like:
    alice@abc.com; bob@abc.com; charlie@abc.com;

You may have to play with whether or not a trailing semicoln causes issues. And don’t try to include the display names like:
Alice Cooper<alice@abc.com>; Bob Seager<bob@abc.com>;

Then in your BPM, query the UD Codes like:

Db.UDCodes
  .Where( r =>r.Company == callContextClient.CurrentCompany 
    && r.CodeType == 'BU'  && r.CodeID == PG)
  .Select( r =>r.LongDesc)
  .DefaultIfEmpty("your email address to catch faults").FirstOrDefault()
1 Like