Announcements
No record found.
Dear All
Up to AX 2012 we were using .orig() to get the original record before updating any field. Is there any equivalent to it in AX7 or D3FO?
Thanks,
Amr Saad
*This post is locked for comments
I believe it is still available. Didn't you find it? I just tested it, it works fine.
Actually, I tried it but it did not work. My case is that when the user changes the "Sales price" on "Sales quotation line", I need to compare between the old price and the new one.
Amr
You probably need to change your title so we can understand better, I tried in the Update method of the table I could get the origin value, Where are you calling the .orig() method, try to call it before super()
I'm using the extension. So I created an event handler class and event handler method for validatedFieldValue() like below:
[DataEventHandler(tableStr(SalesQuotationLine), DataEventType::ValidatedFieldValue)]
public static void SalesQuotationLine_onValidatedFieldValue(Common sender, DataEventArgs e)
{
SalesQuotationLine salesQuotationLine = sender as SalesQuotationLine;
ValidateFieldValueEventArgs ve = e as ValidateFieldValueEventArgs;
boolean ret = ve.parmValidateResult();
SalesLinePercent linePercent;
SalesPrice oldValue, newValue;
if(ret)
switch(ve.parmFieldName())
case fieldStr(SalesQuotationLine, SalesPrice):
oldValue = salesQuotationLine.orig().SalesPrice;
newValue = salesQuotationLine.SalesPrice;
if (newValue < oldValue && oldValue > 0)
ret = checkFailed("ERROR MESSAGE");
}
break;
ve.parmValidateResult(ret);
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CP04-islander 39
Michel ROY 14
imran ul haq 8