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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Refresh Quick Filter Controls Dialogue on InventOnHandItem Form using X++

(0) ShareShare
ReportReport
Posted on by 353

Hi –

Form - InventOnHandItem

  Currently, users add the filters-criteria to the On-hand list grid and when the user wants to change the criteria selected on the filters, they must press “Reset” button and the current “Reset” button completely removes any filters that a user may have added to the grid. This information is valuable to the users but there is no current functionality that will allow the users to clear and change it to the new criteria without resetting all the filters. 

I will be creating a new button on the On-hand list form titled ‘Clear Filters’ 

  • It should only clear the criteria to the filters.
  • It should not completely reset all the filters selected to the grid by user.

 

Example Screenshots

pastedimage1655738496465v1.png 

 

When the user presses “Clear Filters” button system should only remove the criteria selected to the Style, Tag number and Form/Shape filters i.e “Stock, 000009 and Angle. 

pastedimage1655738518950v2.png

I’m noticing that the filter controls on the InventOnHandItem is built through the Quick Filter Control classes. These classes are part of Application Platform.

pastedimage1655739350531v2.png

My Current Code does clear the Filter criterie but the issue is it only does this after I reopen the quick control dialogue by closing it and re opening it.

Is it possible to refresh the Quick Filter Control dialogue through x ? I want to achieve this through a button onclicked event? 

My Code so far –

Main Issue with this code – This code does clear the Filter criteria but the issue is it only does this after I reopen the quick control dialogue by closing it and re-opening it manually. Can I close and reopen the dialogue (Refresh it) through code ?

[FormControlEventHandler(formControlStr(InventOnhandItem, ClearFilters), FormControlEventType::Clicked)]
    public static void ClearFilters_OnClicked(FormControl sender, FormControlEventArgs e)
    {

        FormRun form = sender.formRun();
        FormDataSource ds  = form.dataSource(formDataSourceStr(InventOnhandItem,InventDim)) as FormDataSource;
       // ds.queryBuildDataSource().clearRanges();
        for (int i = 1 ; i <= ds.queryRunQueryBuildDataSource().rangeCount() ; i   )
        {
            ds.queryRunQueryBuildDataSource().range(i).value('');
            
        }
    }

Any Ideas which can help me to achieve this functionality will be appreciated.

Thank You for you time and help.

I have the same question (0)
  • Alex VN Profile Picture
    1,994 on at
    RE: Quick Filter Controls on InventOnHandItem Form Refresh using X++

    Hi,

    Not sure but I think you can try to use form Research, refresh method after you code complete to refresh the form datasource and display the data as expected.

    Regards,

  • Muhammad_Ali Profile Picture
    353 on at
    RE: Quick Filter Controls on InventOnHandItem Form Refresh using X++

    Hi Alex-

     The form refresh and research only works on InventOnHandForm. I need to somehow refresh the Quick Filter Control dialogue. makes sense ?

    Thanks

  • Muhammad_Ali Profile Picture
    353 on at
    RE: Refresh Quick Filter Controls Dialogue on InventOnHandItem Form using X++

    No one on the forum has any idea ? or am I asking the question in the wrong forum ?

    Thanks

  • Pete Alberts Profile Picture
    3,542 on at
    RE: Refresh Quick Filter Controls Dialogue on InventOnHandItem Form using X++

    Hi Muhammad.

    The behaviour you described is not specific to the InventOnHand form. It is general. Clicking the refresh button (top right or on the mentioned “enhanced” filter paneI) will discard user specified filters.

    In your post you mentioned quite a few other things, but I am reasonably sure that your problem began (and should end) with wrapping (or addin some code to) execute query correctly.

    For the life of me I can’t think of an example. Maybe someone else can assist. There are a few lines of code that you need to write before executeQuery() for the form to “remember” the user specified filters

  • Pete Alberts Profile Picture
    3,542 on at
    RE: Refresh Quick Filter Controls Dialogue on InventOnHandItem Form using X++

    On your other reply. What do you mean with “quick control dialogue” or the “quick filter control classes”?

  • Pete Alberts Profile Picture
    3,542 on at
    RE: Refresh Quick Filter Controls Dialogue on InventOnHandItem Form using X++

    I think you are trying to reference “that special filter pane to the left”. I am not 100% sure how it is presented. But it presents the current form root datasource’s ranges. You can test my statement quite easily by adding a range to the aforementioned DS and Check whether it displays in the filter dialogue to the left.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,922

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,922

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 835 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans