web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

D3FO Development .orig()

(0) ShareShare
ReportReport
Posted on by 575

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 have the same question (0)
  • Suggested answer
    Hichem.Chekebkeb Profile Picture
    3,371 on at

    I believe it is still available. Didn't you find it? I just tested it, it works fine.

  • Amr Saad Profile Picture
    575 on at

    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.

    Thanks,

    Amr

  • Suggested answer
    Hichem.Chekebkeb Profile Picture
    3,371 on at

    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()

  • Amr Saad Profile Picture
    575 on at

    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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans