I am selecting the status on a form
but when I am closing the form and reopen it then it changes the value
How to save last selected value on a form
I am selecting the status on a form
but when I am closing the form and reopen it then it changes the value
How to save last selected value on a form
Oh, you didn't say it should be a bound control (and you just forgot to bind it to a data source). We can't give you the right answer if you don't explain your problem property.
Note that binding it to the data source doesn't necessarily meet the requirement "to show the last selected value on a form". It depends on what record is loaded from the data source and whether you mean the value last selected by the particular user or by any user.
There is not any code behind that is why it is not necessary to debug the issue every time. I just added new control on a form and it was not working according to req.
Btw I found out the issue and fixed it just by modify DS property.
You should use the debugger to find out what's going on, instead of simply saying that it doesn't work and give up.
If you need our help, show us your code (especially unpack()) and tell us what you found when debugging your code.
May be that blog doesn't show how to set value to control in the run method.
Refer to the below blog and see if it helps.
https://www.arbelatech.com/insights-resources/blog/get-last-selected-value-on-form-control.html
Thanks,
Girish S.
I have applied your suggested blog but it was not working
Hi Ashraf,
Status field is DataSource bound or unbound control?
If it's an unbound control, you need to use pack and unpack method on a form.
Refer to the below blog.
https://community.dynamics.com/ax/b/dynamicsaxsolutions/posts/save-last-value-on-on-form-form
Thanks,
Girish S.
André Arnaud de Cal...
292,886
Super User 2025 Season 1
Martin Dráb
231,766
Most Valuable Professional
nmaenpaa
101,156
Moderator