Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Save last selected value on a form

(0) ShareShare
ReportReport
Posted on by 75

I am selecting the status on a form

pastedimage1685540412651v2.png

but when I am closing the form and reopen it then it changes the value

How to save last selected value on a form

  • Martin Dráb Profile Picture
    231,766 Most Valuable Professional on at
    RE: 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.

  • Ashraf_ahk Profile Picture
    75 on at
    RE: Save last selected value on a form

    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.

  • Martin Dráb Profile Picture
    231,766 Most Valuable Professional on at
    RE: Save last selected value on a form

    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.

  • GirishS Profile Picture
    27,823 Moderator on at
    RE: Save last selected value on a form

    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.

  • Ashraf_ahk Profile Picture
    75 on at
    RE: Save last selected value on a form

    I have applied your suggested blog but it was not working

  • Suggested answer
    GirishS Profile Picture
    27,823 Moderator on at
    RE: Save last selected value on a form

    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.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,886 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,766 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans