Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Orig method not working
Finance forum
Unanswered

Orig method not working

Posted on by Microsoft Employee

I have used two temporary tables in my form. One is for all the controls and the other is for a grid. I am trying to obtain the values before update for on of the grid fields using orig but it does not seem to be working. The same if applied on the other temp table is working fine, therefore, I am a little confused as to what to do? Could you give me a few suggestions? 

//modified method on the formdatasource field 
public void modified()
{
    real oldVal = TempTable2.orig() 
    ///using the name of the table as is because
    it has the same meaning as using cursor.///
    real newVal = TempTable2.Value; //New value, after update
}

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Orig method not working

    Existing record

  • Abigail Profile Picture
    Abigail 550 on at
    RE: Orig method not working

    You would just put a pre-event handler on the table update method, then use Orig method.

  • Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,083 on at
    RE: Orig method not working

    Hi ShravyaD,

    Do you modify field for new record or existing one?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Orig method not working

    I do not get any value. It always returns null.

    Regards,

    Shravya

  • WillWU Profile Picture
    WillWU 22,344 on at
    RE: Orig method not working

    Hi ShravyaD,

    What do you mean by "not working"?

    Can you get any value or not?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Orig method not working

    I tried that too but it is still not working

  • WillWU Profile Picture
    WillWU 22,344 on at
    RE: Orig method not working

    Hi ShravyaD,

    Try to add your field after the method:

    TempTable2.orig().yourfield;

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Orig method not working

    Hey Will,

    Yes, I did

    Shravya

  • WillWU Profile Picture
    WillWU 22,344 on at
    RE: Orig method not working

    Hi ShravyaD,

    Did you put the method before super()?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Orig method not working

    I am trying to compare buffers as well. To find the difference in value for one field. I am using it in the form in the modified method of the datafield

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,513 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,862 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans