web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    23,590 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
  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,362 Super User 2025 Season 2 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
    Mohamed Amine Mahmoudi Profile Picture
    26,348 Super User 2025 Season 2 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
    YUN ZHU Profile Picture
    93,438 Super User 2025 Season 2 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
    YUN ZHU Profile Picture
    93,438 Super User 2025 Season 2 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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,204

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 1,933

#3
YUN ZHU Profile Picture

YUN ZHU 1,885 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans