Hi,
We’re trying update the quote total depending on a drop down menu selection. If Weekly is selected, the Total will be (x * 7) and if Monthly is selected, then total will be (x * 30).
For some reason, the total field is not updating. It’s also grayed out so I’m not if that is the issue. This is the code we are using.
private void QuoteDtl_AfterFieldChange(object sender, DataColumnChangeEventArgs args)
{
// ** Argument Properties and Uses **
// args.Row[“FieldName”]
// args.Column, args.ProposedValue, args.Row
// Add Event Handler Code
switch (args.Row[“SellingExpectedUM”].ToString())
{
case “FPW”:
UpdateWeekly(Convert.ToDecimal(args.Row[“DocPotential”]));
break;
case “FPM”:
UpdateMonthly(Convert.ToDecimal(args.Row[“DocPotential”]));
break;
}
}
private void UpdateWeekly(decimal WPotential)
{
var edvWeekly = oTrans.Factory("QuoteDtl");
edvWeekly.dataView[edvWeekly.Row].BeginEdit();
edvWeekly.dataView[edvWeekly.Row]["DocTotalQuote"] = WPotential*7;
edvWeekly.dataView[edvWeekly.Row].EndEdit();
}
private void UpdateMonthly(decimal MPotential)
{
var edvMonthly = oTrans.Factory("QuoteDtl");
edvMonthly.dataView[edvMonthly.Row].BeginEdit();
edvMonthly.dataView[edvMonthly.Row]["DocTotalQuote"] = MPotential*30;
edvMonthly.dataView[edvMonthly.Row].EndEdit();
}
}