Hello Dynamics Community and forum members,
I'm trying to figure out how Electronic Reporting identifies the current object that is being printed out, and how that filtering is applied when accessing the database. I'm printing out free text invoices, and from what I can tell when a reference is made to CustInvoiceJour, this includes filtering on the current invoice being printed.
However, I added a calculated field to the model mapping, which is referencing CustInvoiceJour. The purpose is to identify if the current invoice has values in certain fields. This reference to CustInvoiceJour does not seem to include filtering on the current invoice being printed.
Here is the formula my calculated field is using in the model mapping's data source section, under calculated fields:
FIRSTORNULL( WHERE( CustInvoiceJour.'$CustInvoiceTrans_OrderByLineSeqNum', CustInvoiceJour.'$CustInvoiceTrans_OrderByLineSeqNum'.Prefix_CompanyId <> "" ) )
I would assume that since CustInvoiceJour is being referenced, the report would have added, or already done, the filtering of the current invoice number. But that does not happen.
I was wondering if the filtering on current object being printed is controlled by where in the model mapping the call to the calculated field is located. So I moved it from under the root definition InvoiceCustomer to under InvoiceCustomer>InvoiceBase. But this made no difference.
I probably need to refine the description above but do let me know what is unclear. I'm trying to avoid sharing screenshots as I suspect this could be sensitive to share.