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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Change the value of Option Field automatically after few days

(0) ShareShare
ReportReport
Posted on by 50

There is one Requirement from client that, one Option filed having value like unsolved and solved, by default it is Unsolved but after click on action button then after three days the value should automatically change to Solved 

I have the same question (0)
  • YUN ZHU Profile Picture
    96,281 Super User 2025 Season 2 on at

    Hi, Very interesting question. Generally, you can set up the an Job Queue, for example, check the status every night, and modify the status if it is more than three days.

    pastedimage1663721490242v1.png

    Hope this helps.

    Thanks.

    ZHU

  • Amit Baru Profile Picture
    3,037 on at

    Hi,

    Pls check with technical person in AL, option or enum values changed in the AL code.

    Regards

    Amit Sharma

    www.erpconsultors.com

  • Shathika Karunaratne Profile Picture
    on at

    Hi,

    I suggest you should create a separate table to have the Button Click Log Entries.

    Therefore, you can see how it has changed from unsolved to solved with Date and Time also you can capture the User who click on the action button with the Document No and Value Changed Boolean.

    In trigger OnAction() of the Action Button you are pressing, you have to assign the values and insert a record to the Log Entries Table.

    Afterwards you have to create a codeunit to check Date & Time field whether it has passed 3 days by comparing WorkDate() and DateTime field in Log Entry Table. If so, modify the particular document via the Document No. field in the Log Entry Table and change the Option field to Solved.

    Moreover, you must modify the Value Changed Boolean field to True in Log Entry Table. Therefore, you could set the codeunit only run if the Value Changed Boolean is False.

    Finally create a job queue entry to the above created codeunit and set it to run daily.

    This solution not only a good way to change the option field after 3 days of clicking the button, but also to keep a track on what option was there on what date & time, when did the option changed with date & time with the User who clicked the button initially for the reporting and auditing purposes

    If the solution is not understandable to you, please do reply as I will give you with an example.

  • Ben Baxter Profile Picture
    6,678 Super User 2025 Season 2 on at

    Potential duplicate, but providing the same information in case someone finds this thread:

    I would add a third option to your string: "Pending"

    Have a second field, that is a date field, hidden and non-editable.  When the action button is triggered, it switches your option field to Pending and adds today's date to your date field.  Have a Job Queue batch that runs once a day and looks for records Pending with a date older than three days, and switches them to Solved.

    If the User takes action on the record, it should set status back to Unsolved and clear the date field, then the system won't mark it as Solved.

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,457

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 742 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 669 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans