Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Unanswered

Security Filters - show totals but hide data

Posted on by 5

Hello,

I wanted to share the way to show totals when using SecurityFilters in NAV. Normally security filters process filters on sql layer and push them to NAV. 

Sometimes there is need to only hide so here is some example how to do it.

On trigger OnAfterGerRecord create local record which corresponds Rec like follows:

//Check SECURITYFILTERING of REC

IF "SECURITYFILTERING" = SECURITYFILTER::Filtered THEN BEGIN

//SET SecurityFilter to Ignored
lreGLAccount."SECURITYFILTERING" := SECURITYFILTER::Ignored;
lreGLAccount.SETAUTOCALCFIELDS("Net Change",Balance, "Balance at Date",
"Debit Amount","Add.-Currency Balance at Date",
"Additional-Currency Balance", "Additional-Currency Net Change",
"Credit Amount");
IF lreGLAccount.GET(Rec."No.") THEN BEGIN

//Parse CalcFields to Rec from local record
"Net Change" := lreGLAccount."Net Change";
Balance := lreGLAccount.Balance;
"Balance at Date" := lreGLAccount."Balance at Date";
"Debit Amount" := lreGLAccount."Debit Amount";
"Add.-Currency Balance at Date" := lreGLAccount."Add.-Currency Balance at Date";
"Additional-Currency Balance" := lreGLAccount."Additional-Currency Balance";
"Additional-Currency Net Change" := lreGLAccount."Additional-Currency Net Change";
"Credit Amount" := lreGLAccount."Credit Amount";

//do not use modify here!

END;
END;

The result is as expected, when you drilldown on flowfield the data behind would be hidden.


Do you have any other walkaround? 

  • Marco Mels Profile Picture
    Marco Mels on at
    RE: Security Filters - show totals but hide data

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    www.dynamicsuser.net/.../14

    I will open this up to the community in case they have something to add.

    Thanks.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans