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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Blocking access to the filtering in a form

(0) ShareShare
ReportReport
Posted on by 50

Hi Guys,

I have a form in which there is a filter applied to it to show certain results that the users need, this filtering if a user erase it it will show many records that the user don't need to see, below is a screenshot for the thing I want it to be disable from editing by the normal user:

pastedimage1672045399118v2.png

Is this can be disabled? or is there is something can be done from VS to achieve this?

Thanks,

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,843 Moderator on at

    Hi mohamd.dhaif ,

    Yes, it can be disabled by code but make sure it won't affect other filters.

    You need to add the code in the init method of the form like below.

    Public void init()
    {
        FormCommandButtonControl filter;
        #SysSystemDefinedButtons
        super();
        filter= this.control(this.controlId(#SystemDefinedShowFiltersButton)) as FormCommandButtonControl;
        filter.visible(false);
    }

    Thanks,

    Girish S.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    304,925 Super User 2026 Season 1 on at

    Hi Mohamd,

    When you apply filter ranges via x++ coding, you can make the ranges hidden. In that case, the user will not see those ranges, but still can add other filters when he needs to search for particular records.

    The code suggestion from Girish will not block the option for the Advanced filter/sort form which the user then can still use. Note that in case there is an option to use the 'Open in Excel' function on this form, it will have access to all records again. You can consider implementing a security policy using XDS which will always ensure the user will only see records that are intended for him to see. This can be extended to data entities as well. Extensible Data Security and data entities - Microsoft Dynamics 365 for Finance and Operations - (dynamicspedia.com)

  • mohamd.dhaif Profile Picture
    50 on at

    Thank you, Girish and Andre, for your responses, it's so helpful your clarification you highlight.

    For doing this task, is there is a tutorial online to applying this idea?

    Thanks,

    Mohammed

  • André Arnaud de Calavon Profile Picture
    304,925 Super User 2026 Season 1 on at

    Hi Mohammed,

    Which exact idea do you want to try out first?

    - Disable filter pane,

    - Hide query range

    - Security policy (XDS)

  • mohamd.dhaif Profile Picture
    50 on at

    Hi Andre,

    Hide query range

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    304,925 Super User 2026 Season 1 on at

    Hi Mohamd,

    I'm not aware of a blog, but the standard application has a lot of examples in it. E.g. the class HcmPersonLookup. The Status on the QueryBuildRange object can be set to Hidden.

                    QueryBuildRange qbr = _workerDataSource.addRange(fieldNum(HcmWorker, RecId));
                    qbr.value(queryvalue(reportsEnumerator.current()));
                    qbr.status(RangeStatus::Hidden);

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 660

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 655 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 557

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans