Greetings,
I've checked out the COPYFILTER, SETFILTER posts and still haven't been able to figure out the following:
For Report 10056 I've added a textbox with SourceExpr FORMAT(SalesHeader.Status) in the Sales line, GroupHeader (1) area of the sections. That's displaying fine.
I'd like to filter on SalesHeader.Status to be able to see which orders are released or open.
Does anyone have any ideas?
Any help is appreciated. Thank you. gad1
0
Comments
The user can then put a filter in it.
If you want to do define it. Put in property DataItemTableView this:WHERE(Status=FILTER(Open|Released))
Or in the "Sales Header" - OnPreDataItem()-trigger
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
The issue with this report is that "Sales Header" is not a dataitem...the only dataitems are Customer and Sales Lines.
How do I allow a filter to a report without a Sales Header dataitem? SalesHeader only appears as a Global variable...?
Thank you - gad1
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Add to the request form and option filter "myfilterstatus" Open/Released.
On the onAfterGetRecord.
Salesheader.GET("Document Type","Document No.");
now depending on what your request form filter was say OPEN in this case.
or maybe SHOWOUTPUT(false) not sure which is best.
then add code for the opposite
Quick & sloppy but you get the point
Mabe one of the codemasters can clean it up
http://www.BiloBeauty.com
http://www.autismspeaks.org
"MyFilterStatus"
Check it for Open Orders Only of leave it unchecked for Releases Orders only.
Create a Function called ReportCalculations & move all the report calc into the function. You will call the function when needs on the onaftergetrecord trigger with something like this.
OnAfterGetRecord()
http://savatage99.googlepages.com/10056 ... tus-NE.txt
fob version available
http://www.BiloBeauty.com
http://www.autismspeaks.org
I added a new dataitem referencing the Sales Header and named it DummySalesHeader. I set the required filter as Status.
I created a text variable FilterString2.
In the C/AL for OnPreReport() I added the following:
FilterString2 := DummySalesHeader.GETFILTER(Status);
In the C/AL for Sales Line - OnAfterGetRecord() I added:
SalesHeader.GET("Document Type","Document No.");
IF FilterString2 <> '' THEN BEGIN
IF FilterString2 <> FORMAT(SalesHeader.Status) THEN CurrReport.SKIP;
END;
Also if you don't want to move the reports original calculation formula into it's own function then just copy & paste the formula twice into the <reportcalculations> sections.
If your way works too then great - there are usually more than 1 way to skin a cat. :shock:
http://www.BiloBeauty.com
http://www.autismspeaks.org
Create a boolean on the request form for Released orders and another for open orders. Like this you can select which you want to see and which not.
Booleans:
blnShowReleasedOrders
blnShowOpenOrders
OnAfterGetRecord()
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
gad1