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 :
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,827 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
    300,911 Super User 2025 Season 2 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
    300,911 Super User 2025 Season 2 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
    300,911 Super User 2025 Season 2 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans