I’m sure I’m missing something simple - I hope someone can provide some guidance on the following:
I’m adding the very first line (Part) to a quote, then immediately specify the part number. The BPM fires on the change of the partnumber field - before this new quote detail line is even saved.
I simply need to copy over some addtional data from the part record into the quote detail record.
I cannot seem to get it to work - either in a Pre or Post processing directive, the ttrecord seems unavailable to me (or I can’t figure out how to get at it. I’d appreciate any feedback on the following. Thx.
Erp.Tables.Part Part;
foreach(var ttDtl in(from ttrec in ttQuoteDtl where (ttrec.Unchanged() == false) select ttrec))
{
string vPartNum = ttDtl.PartNum;
string errorMessage = "PartNum: " + vPartNum + "\nQuoteLine: " + ttDtl.QuoteLine.ToString();
this.PublishInfoMessage(errorMessage,Ice.Common.BusinessObjectMessageType.Error,Ice.Bpm.InfoMessageDisplayMode.Individual, "Quote", "YourMethod");
foreach (var Part_iterator in (from Part_Row in Db.Part where ((Part_Row.Company == "MyCo") && (Part_Row.PartNum == vPartNum)) select Part_Row))
{
var PartRow = Part_iterator;
ttDtl["Character01"] = PartRow["Character06"];
}
}
The MessageBox displays, with no partnum, and quote line 0 (which is appropriate). I thought I could grab the intended partnum using this method.
** Update ** Figured it out. The BO runs ChangePartNumMaster which does stuff, but does not update the tt record. I attached my BPM to ChangePartNum (which runs after the …master). Works fine, now.