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?