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
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
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.
Hope this helps.
Thanks.
ZHU
Hi,
Pls check with technical person in AL, option or enum values changed in the AL code.
Regards
Amit Sharma
www.erpconsultors.com
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.
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,558 Super User 2024 Season 2
Martin Dráb 228,647 Most Valuable Professional
nmaenpaa 101,148