Hello everyone!
I have created a report to do some data updates on sales headers and sales lines.
The report obviusly has one data item for Sales Header and one indented/nested data item Sales Line that have data item link "Sales Header"."Document Type"="Sales Line"."Document Type" and "Sales Header"."Document No."="Sales Line"."Document No."
The unusual thing about this report is that I would like filters set on the indented Sales Line data item to also affect what sales headers are processed. For example: If the user sets a filter on the filed Quantity on the sales line data item, only sales headers where there is at least one sales line with the same document type, document no. and a value in the field Quantity that pass the filter set on the field, shold be processed.
Sales Header 1.
Document Type Documetn No.
Order 1
Sales Lines
Document Type Documetn No. Line No. Quantity
Order 1 10000 10
Order 1 20000 200
Sales Header 2
Document Type Documetn No.
Order 2
Sales Lines
Document Type Documetn No. Line No. Quantity
Order 2 10000 10
Order 2 20000 300
If I run the report with the above sales headers and saleslines in the database and set the filter "Quantity>200" in the Sales Line data item, only Sales Header 2 should be processed and Sales Header 1 should be skipped.
The problem for me with this is that the filters set by the user on the fields of the Sales header data item doesn't seam to take effekt until the execution get to the sales line OnPreDataItem trigger and then it's to late to add additional filters on the Sales Header data item.
Is there any way to get the filters set by the user on the data items before execution get to the OnPreDataItemTriggers?
I can not simply reverse the order of data items and have the sales header indented under sales line since I also want to be able to filter the sales lines on data that is located in the fields of their respective sales headers. Also i thing the preformence would suffer since there are a lot more sales lines then there are sales headers.
0
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I think Matttrax sugestion would work although I'm not sure how to present this data item in a way that makes the prupose of it obvius to the user. Maby it would be enough to set a good descriptiv caption on it.
Thanks guys!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!