Good morning,
I've got a question about an error that I get when trying to update some value in the PriceDiscActual form.
My goal: to set the "Discount percentage 1" value with a custom calculated value.
I thought it would be as simple as this (simplified version):
[ExtensionOf(formStr(PriceDiscActual))]
final class PriceDiscActual_FV_Extension
{
void findPriceAgreement()
{
next findPriceAgreement();
this.percent1 = 0.99;
}
}
However, this gives me a runtime error "Invalid cast from 'System.Decimal' to 'Dynamics.AX.Application.Forms.PriceDiscActual'."
If I try to do the same logic with the salesLineDisc field it works fine as expected.
Can anyone give me some hints why the percent1 field is different from the salesLineDisc field? And how I can achieve my goal of setting the percent1 field with a custom value?