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)

Forms: How to add filters to a form? similar to a setup header

(0) ShareShare
ReportReport
Posted on by 1,036

Hello awesome community!

I want to learn how to add custom filters to a form.

I have a form with a grid, the grid for example has a date field, I want to add filters on the header part of the form that will be "From Date" and "To Date". So the user can filter the form using these "From To Dates" filters.

How can I do that?/ Where can I learn that?

Any advice would be appreciated!

Thanks in advance! :)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You can take a look of the standard forms. For example General journal (General ledger - Journals - General journal) and see how the "Show All/Open/Posted" filter is implemented.

  • Verified answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    The example is given in below standard documentation . Its for enum field but you can follow the same procedure for date fields.

    docs.microsoft.com/.../how-to-add-filter-controls-to-a-simple-list-form

    For date filter follow below link

    community.dynamics.com/.../date-in-advance-filter-dynamics-ax-2012

  • Momochi Profile Picture
    1,036 on at

    Thanks Mr. Sukrat for your reply,

    I'm still facing a problem following the guides you provided, please tell me where i'm wrong:

    I have made a simple form with a grid and the datasource is "LedgerJournalTrans".

    I changed the name of the datasource to "LedgerJournalTrans_ds".

    My problem is: whenever I try to call the methods of LedgerJournalTrans_ds, for example LedgerJournalTrans_ds.executeQuery(), it gives me an error saying "The table LedgerJournalTrans does not have executeQuery() method.

    What am I missing?

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You should not name the data source "LedgerJournalTrans_ds". Just LedgerJournalTrans.

    Then you can access the data source with "ledgerJournalTrans_ds" variable.

    [DataSourceName] gives you the table buffer of that data source.

    [DataSourceName]_ds gives you the data source instance.

  • Verified answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Nikolaos already gave you direction but I will repeat it,  keep the name LedgerJournalTrans as it is and access datasource instance  using _ds.  Naming it as LedgerJournalTrans_ds doesn't give you datasource  instance variable but gives you database buffer.

  • Momochi Profile Picture
    1,036 on at

    Thanks guys! I was able to do it thanks to your help! :)

    What I learened too is that each datasource has a predefined or an auto defined instances for its datasource "TableName_ds" and its query "TableName_q".

    Is that correct?  

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Yes, that is correct.

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans