Good day Andre
I am now just trying to see if it is possible on the LedgerJournalTransDaily form to filter the data based on the Policy. On Contoso USRT General Ledger > General Journals > All I select Journal 25119. Below is the data. Just to test a policy I want toonly show records where the Account Type = Ledger. (So 5 record)
My Query is now the simplest that I could think to test it with
The security Policy I created is as follows :
The Role I created and assign to my test user is :
But the result is always : So it is showing nothing not even the records that should be showing.
From Sql
select MODELEDQUERYDEBUGINFO from ModelSecPolRuntimeEx
where name = 'ACCRecSec_LedgerJournalTrans'
The result is
SELECT T1.RECID FROM LEDGERJOURNALTRANS T1 WHERE (((PARTITION=5637144576) AND (DATAAREAID=N'dat')) AND (ACCOUNTTYPE=?)) ORDER BY T1.JOURNALNUM,T1.DATAAREAID,T1.LINENUM,T1.PARTITION
And if I debug LedgerJournalTrans and add breakpoint to LedgerJournalTrans.executequery() after super() the result in this.query is :
{Query object a7173b20: SELECT FIRSTFAST FORUPDATE * FROM LedgerJournalTrans(LedgerJournalTrans) USING INDEX NumVoucherIdx ORDER BY LedgerJournalTrans.Partition ASC, LedgerJournalTrans.dataAreaId ASC, LedgerJournalTrans.JournalNum ASC, LedgerJournalTrans.Voucher ASC, LedgerJournalTrans.LineNum ASC WHERE ((Invisible = 0)) AND LedgerJournalTable.JournalNum=LedgerJournalTrans.JournalNum OUTER JOIN FORUPDATE Id FROM LedgerVoucherType_CN(Ref_LedgerVoucherType_CN_LedgerVoucherType_CN) ON LedgerJournalTrans.LedgerVoucherType_CN = LedgerVoucherType_CN.RecId OUTER JOIN FORUPDATE DisplayValue, DisplayValue FROM DimensionAttributeValueCombination(Ref_DimensionAttributeValueCombination_LedgerDimension) ON LedgerJournalTrans.LedgerDimension = DimensionAttributeValueCombination.RecId OUTER JOIN FORUPDATE DisplayValue FROM FinTag(Ref_FinTag_FinTag) ON LedgerJournalTrans.FinTag = FinTag.RecId OUTER JOIN FORUPDATE DisplayValue, DisplayValue FROM DimensionAttributeValueCombination(Ref_DimensionAttributeValueCombination_OffsetLedgerDimension) ON LedgerJournalTrans.OffsetLedgerDimension = DimensionAttributeValueCombination.RecId OUTER JOIN FORUPDATE DisplayValue FROM FinTag(Ref_FinTag_OffsetFinTag) ON LedgerJournalTrans.OffsetFinTag = FinTag.RecId OUTER JOIN FORUPDATE TaxWithholdItemGroup FROM TaxWithholdItemGroupHeading_TH(Ref_TaxWithholdItemGroupHeading_TH_TaxWithholdItemGroupHeading_TH) ON LedgerJournalTrans.TaxWithholdItemGroupHeading_TH = TaxWithholdItemGroupHeading_TH.RecId OUTER JOIN FORUPDATE PersonnelNumber FROM HcmWorker(Ref_HcmWorker_Approver_FK) ON LedgerJournalTrans.Approver = HcmWorker.RecId OUTER JOIN FORUPDATE Tax1099Box FROM Tax1099Fields(Ref_Tax1099Fields_Tax1099Fields) ON LedgerJournalTrans.Tax1099Fields = Tax1099Fields.RecId OUTER JOIN FORUPDATE InvoiceDeclarationId FROM VendInvoiceDeclaration_IS(Ref_VendInvoiceDeclaration_IS_InvoiceDeclarationId_FK) ON LedgerJournalTrans.VendInvoiceDeclaration_IS = VendInvoiceDeclaration_IS.RecId OUTER JOIN FORUPDATE BankCurrencyTransferId FROM BankCurrencyTransferLog_RU(Ref_BankCurrencyTransferLog_RU_BankCurrencyTransferLog_RU) ON LedgerJournalTrans.BankCurrencyTransferLog_RU = BankCurrencyTransferLog_RU.RecId OUTER JOIN FORUPDATE Description FROM LogisticsLocation(Ref_LogisticsLocation_RemittanceLocation_FK) ON LedgerJournalTrans.RemittanceLocation = LogisticsLocation.RecId}.
The above query is exactly the same that I get when I run the same form as system admin and get all the records.
What am I doing wrong and how can I see the last select that determines why some of the records are now not showing.
I will greatly appreciate any feedback. Please note that I am trying to actually filter the LedgerJournalTrans records by the LedgerDimension field, but have now just made the query and policy as simple as possible to see if it works.
Kind regards