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 :
Small and medium business | Business Central, N...
Suggested Answer

How to revert a field back to its previous value

(1) ShareShare
ReportReport
Posted on by 54
Dear All,
 
I have added two fields in PO line - Status(Enum) and Rejected(Checkbox), If I reject the line, its status should change to Rejected, however, If I later uncheck the Rejected checkbox, the status to change to its previous value(Submitted, approved, canceled.. etc). 
I can achieve the first condition, however, I cannot revert the status using xrec.
 
Any suggestion?
 
Thank you in advance!
I have the same question (0)
  • Suggested answer
    Gerardo Rentería García Profile Picture
    26,761 Most Valuable Professional on at
    Hi
    You could save the previous state in a different field. You will always have the previous state there to revert if necessary.
    BR
    GR
  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,419 User Group Leader on at
    Hi,
     
    In that case you will have to create an additional field like status.
     
    OnValidate of Rejected, you need to save status value to New Field and then reset the Status field.
     
    Regards,
    Saurav Dhyani
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,803 Super User 2026 Season 1 on at
    Hi,
     
    You must create another field to save the last value of enum when you reject the line !
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Suggested answer
    YUN ZHU Profile Picture
    100,919 Super User 2026 Season 1 on at
    Because there is no concept of caching, as mentioned by several experts above, you must use another field to save this value for restoration.
     
    Hope this helps as well.
    Thanks.
    ZHU
  • Suggested answer
    YUN ZHU Profile Picture
    100,919 Super User 2026 Season 1 on at
    Another way is to enable the Change log, find the old value of this field in the code, and update it to your table.

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,961 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,211 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,141

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans