Skip to main content

Notifications

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!
  • Suggested answer
    YUN ZHU Profile Picture
    84,479 Super User 2025 Season 1 on at
    How to revert a field back to its previous value
    Another way is to enable the Change log, find the old value of this field in the code, and update it to your table.
  • Suggested answer
    YUN ZHU Profile Picture
    84,479 Super User 2025 Season 1 on at
    How to revert a field back to its previous value
    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
    Mohamed Amine Mahmoudi Profile Picture
    23,882 Super User 2025 Season 1 on at
    How to revert a field back to its previous value
    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
    Saurav.Dhyani Profile Picture
    14,316 Super User 2025 Season 1 on at
    How to revert a field back to its previous value
    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
    Gerardo Rentería García Profile Picture
    19,837 Most Valuable Professional on at
    How to revert a field back to its previous value
    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

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans