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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to clear Form?

(0) ShareShare
ReportReport
Posted on by

How to have clear form(without any previous data on fields) when a user clicks on menu item of that form?

Without having to hit "New" menu button on form every time to enter new data?

Thanks in advance for help!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    This is a bit of an odd question, as this is not a usual AX user experience pattern. I always suggest to people that if you can't find a form in standard AX that does it, you are probably on the wrong track. So please consider that.

    That being said, in the interest of helping you anyway... how is your form setup? Do you controls bind to a datasource? You say hitting the "new"  button so I assume that means you have bound controls.

    If you just want to replicate the "new" functionality, you can create a command button and choose the new command.

    If you need to do it from code, you can call create() on your datasource.

    If your controls are not bound, you should consider doing something with a temp table potentially, depending on your scenario. That way you're not storing the data if you don't need it, but it's easy to clear the data and also easy to read the data out when your form is done doing its work (I'm assuming you want to use the data).

    So again, I'm questioning your approach on what you are trying to do, but then again I have no info on what your goal or scenario is exactly.

  • Community Member Profile Picture
    on at

    Hi,

    I do have custom build form bind to data source (table).  On the form, I have "new" menu button. When user enters data on fields on form and then comes back to open the form. It doesn't clear out the data automatically. User has to click "new" to enter new data. I'm wondering if there is code I should write that says clear data on form when clicked?

    Thanks for your help. I'm fairly new to AX development.

  • Verified answer
    Community Member Profile Picture
    on at

    Resolved this issue by creating a "new" MenuItemButton on Form's design level under ActionPane Tab's button group. Now every time that MenuItemButton is clicked to create a new entry on form, it clears out the pervious entry. Hope this helps for those who might run into this same issue. I'll be glad to clarify further if needed.  

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…

Neeraj Kumar – Community Spotlight

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

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans