ShortChar01 and ShortChar02 empty in BPM


We have a BPM that looks at received parts, and under certain circumstances is supposed to send an e-mail with information.

The BPM is in Erp.Receipt.ReceiveAll (Post-Processing). I’m using this custom code:

foreach (var ttRcvDtl_iterator in (from ttRcvDtl_Row in ttRcvDtl
                                   where (string.Equals(ttRcvDtl_Row.RowMod, IceRow.ROWSTATE_UPDATED, StringComparison.OrdinalIgnoreCase) || string.Equals(ttRcvDtl_Row.RowMod, IceRow.ROWSTATE_ADDED, StringComparison.OrdinalIgnoreCase))
                                   select ttRcvDtl_Row))
    var ttRcvDtlRow = ttRcvDtl_iterator;
    PublishInfoMessage( "RcvDtl.PartNum="+ttRcvDtlRow.PartNum+"RcvDtl.ShortChar01="+ttRcvDtlRow["ShortChar01"]+"RcvDtl.ShortChar02="+ttRcvDtlRow["ShortChar02"], Msg_Info, Msg_Indv, "debug126","debug459");

I added this info message when I noticed that the ShortChar01 and ShortChar02 fields were always blank. I couldn’t even use ttRcvDtlRow.ShortChar01 though, it kept telling me ShortChar01 didn’t exist, but the above way worked and matches how we are trying to extract the field to send in the e-mail.

The field definitely exists and has a value in the database though, as the following query proves when we run it against the database:

SELECT DISTINCT RcvDtl.ShortChar01, RcvDtl.ShortChar02, Part.PartNum
ON Part.Company = RcvDtl.Company AND Part.PartNum = RcvDtl.PartNum
WHERE Part.PartNum='12-7654-88';

When I run this query I see values for ShortChar01 and ShortChar02.

What am I doing wrong that I am not seeing any values in the BPM?

2 things:

  1. Try this simple for loop. It’s a lot less typing.
  2. I think you need to convert the Object to a String for the message.
foreach (var tt in ttRcvDtl.Where(tt => !tt.Unchanged()))
    PublishInfoMessage( "RcvDtl.PartNum="+tt.PartNum+"RcvDtl.ShortChar01="+tt["ShortChar01"].ToString()+"RcvDtl.ShortChar02="+tt["ShortChar02"].ToString(), 0, 0, "debug126","debug459");
1 Like

Thanks! It turned out to be that ShortChar01 and ShortChart02 aren’t actually getting set for the specific RcvDtl record being accessed, but my query was obscuring that.