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

Security Filtering using Extension in AL Code

(0) ShareShare
ReportReport
Posted on by 640

Issue :

When I use security filter in field "Code" in table "No. Series", I get error "A security filter has been applied to table No. Series. You cannot access records that are outside that filter" when create new Sales Order.

I debug and it break on code below in function "CheckNumberSeries" (codeunit 1400) :
IF RecVariant.ISRECORD AND (NoSeriesCode <> '') AND NoSeries.GET(NoSeriesCode) THEN BEGIN

In NAV, I will add code like below.
NoSeries.SecurityFiltering := SecurityFilter::Ignored; //my additional code
IF RecVariant.ISRECORD AND (NoSeriesCode <> '') AND NoSeries.GET(NoSeriesCode) THEN BEGIN
..

How to do this using extension with AL Code in Business Central?
In extension, I cannot add code
Please help.
Thank you.

**To Reproduce**
Steps and to reproduce the behavior:
1. Go to Permission
2. In table No. Series, add security filter on field "Code" (for example : 101-A..101-Z)
3. Create No. Series Code (for example : 100-SO, 101-SO, 102-SO)
3. Create new Sales Order (error "A security filter has been applied to table No. Series. You cannot access records that are outside that filter")

**Expected behavior**
I can create new Sales Order without any error.

**Versions:**
- AL Language: 4.0.209944
- Business Central: 14.0.36457

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    In D365BC simply you cannot do that. You cannot directly modify standard code but you can only attach to raised events. You should check if codeunit 1400 raises some events useful for your case (to bypass security filter). If there are no events, you cannot do that.

  • pearl_jo Profile Picture
    640 on at

    Hi Stefano,

    Thank you for your response.

    Unfortunately, there is no publisher in function CheckNoSeries (Codeunit 1400).

    So, we cannot use security filter in Business Central?

    Best regards,

    Johanna

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    If so, you cannot add the modification you want to the standard object. This means that security filters are always applied (as the standard behaviour wants).

  • pearl_jo Profile Picture
    640 on at

    Dear Stefano,

    Yes, you are right. But, I want the user can create Sales Order with filtered No. Series.

    So, to achieve this, I cannot use security filter. Because if I use security filter, I get error when create new sales order and I cannot add security filtering code in standard code.

    Best regards,

    Johanna

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Ok so your problem is different. What do you mean by "filtered No. Series"? As standard, you can assign different No. Series to documents and a user can choose between those No. Series. Just go to No. Series page and click on Relations.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 720 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 436 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 409 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans