BPM update - loop through contact records

I’m looking for some help here. i’m not getting any record update when this code executes.
BPM at customer.update is called but no error - no update

i would appreciate some other eyes on it,.
thanks



foreach (var ttCustomerRecList in ttCustomer.Where(cr => cr.RowMod == “U” || cr.RowMod == “A”))
{

string companyID = (string)ttCustomerRecList[“Company”];
int custnumID = (int)ttCustomerRecList[“CustNum”];
int contnumID = (int)ttCustomerRecList[“ConNum”];
string email = string.Empty;

var contactRecList =
from cca in Db.CustCnAttr
join cct in Db.CustCnt on new {cca.Company, cca.CustNum, cca.ConNum }
equals new {cct.Company, cct.CustNum, cct.ConNum }
where cca.Company == companyID
&& cca.CustNum == custnumID

                select new {cct.PerConID,cct.EMailAddress};

foreach (var earEmailStr in contactRecList)
{
if (!string.IsNullOrWhiteSpace(earEmailStr.EMailAddress))
{

                    if (!string.IsNullOrWhiteSpace(email))
                        email = string.Format("{0};{1}", email, earEmailStr.EMailAddress);
                    else
                        email = earEmailStr.EMailAddress;
                }

}

ttCustomerRecList["Comment"] = email;

/* custRec.Comment = “at tleast we got there”; */

}



1 Like

Try taking out this statement. I do not believe that ConNum exists in the Customer Dataset. I would have expected an error, which is kind of odd.

tried but no change. I have the uneasy feeling nothing is happening at all.
no error - no update
thanks

i cant even hardcode a value. i’m thinking there is a scope/dataset issue but i’m not sure.

Odd. I just pasted the code into a pre-processing directive on Customer.Update and it worked fine. The directive is enabled and a pre-processing, correct? Anything in the server log?

1 Like

the directive IS in place. I have a PREupdate and POST update message and both show

image

hold on … it’s a post directive … …

BINGO!

i still get those PRE and POST mixed up.!
Thanks SO much!