BPM on Sales Order Question

Referencing your code, I am trying to adopt the same concept. But I have it to where a field in ERP.ORDDTL is updated based upon a field in ERP.PART_UD. The part that I am stuck on is “ttOrdDtl” seems to not exist as a reference?

I created a method directive on ERP.SalesOrder.ChangePartNum and its pre-processing.

var ORDDtlRow = ( from ttOrdDtl_row in ttOrdDtl
where (ttOrdDtl_row.RowMod == "A" || ttOrdDtl_row.RowMod == "U")
select ttOrdDtl_row).FirstOrDefault();
Erp.Tables.Part Part;

if (ORDDtlRow != null)
{
PublishInfoMessage("ORDDtlRow != null & PartNum=" + ORDDtlRow.PartNum, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "ORDDtlRow != null", "Update");

Part = (from Part_Row in Db.Part
where (Part_Row.Company == ORDDtlRow.Company && Part_Row.PartNum == ORDDtlRow.PartNum)
select Part_Row).FirstOrDefault();

if (Part != null)
{
PublishInfoMessage("Part != null", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "Part != null", "Update");

ORDDtlRow.Character03 = Part.CSNotes_c.ToString();
}
}

image

Wouldnt it be ttOrderDtl? You can always type tt then press ctrl-space and see what autocomplete offers up.

Thanks @Chris_Conn brain must have been fried end of day LOL.

1 Like

@Chris_Conn Could you provide some insight as to where I’m going wrong with this BPM? After enabling my BPM and closing out of Epicor and logging back in. Upon entering a new order and creating a new line for a part with the “CSNOTES_c” field populated for that part. Upon clicking save or tabbing the new line record in. I don’t seem to be receiving either show message notification whether the processed passed/failed.

image

image

image

image

image

image

Please start new threads when the are not a direct continuation of an existing one.

@josecgomez Roger.

A few comments -
You shouldnt have to close clients after BPM changes or enabling.
If neither message shows, then you either:
A) Are not actually calling the method, check trace
B) Getting to the query and crashing (although I would expect a message) - temporarily disconect the FillByQuery (leave it floating) and route straight to the message after it to see if it fires.