Options

Security Filtering using Extension in AL Code

johannajohanna Member Posts: 369
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
Best regards,

Johanna
Sign In or Register to comment.