Hi All,
I hope someone can help as I am not a full time coder and this part of the customisation has me flumuxed!
I have created a UD field in “PODetail” called “TonRte_c”, I have then pulled through a Foreign Key from the “Part” Table called “Part.GrossWeight”
The calculation seems simple but it has me stumped, it compiles ok but does nothing.
(PODetail.ScrUnitCost / Part.GrossWeight) * 1000 - This should return the result back to “TonRte_c”
private void PODetail_AfterFieldChange(object sender, DataColumnChangeEventArgs args)
{
// ** Argument Properties and Uses **
// args.Row["FieldName"]
// args.Column, args.ProposedValue, args.Row
// Add Event Handler Code
switch (args.Column.ColumnName)
{
case "TonRte_c":
decimal TonRte_c = (decimal)args.Row["PODetail.ScrUnitCost"] / (decimal)args.Row["Part.GrossWeight"] * 1000;
break;
}
}
Any help on this would be very appreciated.
Many thanks in advance
Steve