I’m trying to implement a BPM in Kinetic which involves custom code and two ds files. Based on the trace I did in classic mode the dataset has both ds files available but when my code tries to access the second one I get a null result. I’ve incorporated numerous displays to try to figure it out and I have proven out the first ds call is successful.
Basically what I’m trying to do is push up the cost figures which have been entered on a quote BOM/MOM (Worksheet qty breakout) to the corresponding detail line so I can compute a VM% based on the line price entered. The trigger for the BPM is the Erp.BO.Quote.GetWSUnitPrice method associated with the change to the Quoted Unit Price field on the quote > line > worksheet page. I first went down the rabbit hole of adding a rule to the app studio version of QuoteEntry but that proved not to be the suggested route (unless someone can prove out otherwise). I feel like I’m sooooooo close but … Any assistance in pointing out my “operator error” would be appreciated.
Here’s the code:
var ttQuoteQty = (from qq in ds.QuoteQty where
qq.Company == Session.CompanyID &&
qq.RowMod == "U" select qq).FirstOrDefault();
if (ttQuoteQty != null)
{
this.PublishInfoMessage(ttQuoteQty.QuoteNum.ToString(), /* returns quote num */Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "FirstVar","SecondVar");
var ttQuoteDtl = (from row in ds.QuoteDtl
where row.Company == Session.CompanyID &&
row.QuoteNum == ttQuoteQty.QuoteNum &&
row.QuoteLine == ttQuoteQty.QuoteLine select row).FirstOrDefault();
if (ttQuoteDtl != null)
{
// ttQuoteDtl["VMPct_c"] = CalcedVMPct;
ttQuoteDtl["VMCosts_c"] = CalcedUnitCost; /* Function output var */
ttQuoteDtl["RowMod"] = "U";
}
else
{ this.PublishInfoMessage("Can't find QuoteDtl", /* This is shown */Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "FirstVar","SecondVar");
}
}