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 :
Small and medium business | Business Central, N...
Suggested Answer

Apply security filter on item table and other forms that item is used

(0) ShareShare
ReportReport
Posted on by 85

Hello all,

I have applied a security filter on Item Table,for the user not to see a specific item , for example item with number 10001.

But when i go to the sales order and open an order that contains this item, the item is visible.Is that any way that the security filter for this item to be applied even on other places or forms that this table or item is used? Or should i add the security filter even in Sales Table on this case.

Thank you in advance.

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    Security filter is per table. In your case add it to table 37. You may also want it on item ledger entries, archived sales line. It is worth considering the user can only see that item as the data is already present. If they try to select an item then they lookup directly to the item table

  • Lars Lohndorf-Larsen Profile Picture
    on at

    Hello,

    Depending on requirements, some times a global filter is an easier way compared to security filters. Global filter is in FILTERGROUP(1). About filtergroups: FILTERGROUP Function (Record) - Dynamics NAV | Microsoft Docs 

    So if you add a fitler in that group anywhere, the filter will last the whole session. To test it out you can add an action for example to the Customer List with an action:

                    action(AddFilter)
                    {
                        Caption = 'Add Filter';
                        trigger OnAction()
                        begin
                            item.FilterGroup(1);
                            Item.SetFilter("No.", '<>1000');
                            item.FilterGroup(0);
                            Message('Filter done');

                        end;
                    }
    After you run this action, Item 1000 will disappear no matter from what page you try to access it.
    If this works, then of course a better place to add a global filter would be on Login, so you could add it like this:
    codeunit 50102 MyCodeunit
    {
        trigger OnRun()
        begin

        end;

        [EventSubscriber(ObjectType::CodeunitCodeunit::LogInManagement, 'OnBeforeLogInStart''', false, false)]
        local procedure MyProcedure()
        begin
            Item.FilterGroup(1);
            Item.SetFilter("No.", '<>1000');
            Item.FilterGroup(0);
        end;

        var
            Item: Record Item;
    }
    Again depending on requirements, maybe this method is worth considering.
  • Mathias Leprince Profile Picture
    10 on at

    Hello,

    I would like to put a warning on this FilterGroup(1) solution.

    Except it is now solved in latest BC versions, this feature could lead to records not inserted in tables (seen in Nav versions).

    For example :

    - put a filtergroup(1) on table G/L Entry for a G/L Account No. value (to hide a particular No. like '<>123456')

    - post a document or journal lines that will (should) post entries with this G/L Account No. '123456'

    - the G/L entries with the G/L Account No. 123456 won't be inserted in the table

    - moreover, Nav will not raise an error, thus leading to inconsistent ledger

    KR,

    Mathias

  • Mathias Leprince Profile Picture
    10 on at

    "Except it is now solved in latest BC versions, this feature could lead to records not inserted in tables (seen in Nav versions)."

    => I confirm this is still the case in BC

    => this filtergroup(1) should be handled with a lot of care and not applied to "entries" tables

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans