Announcements
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?
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.
I will open this up to the community in case they have something to add.
Thanks.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156