Hi All:
I'm trying to display a variable on the Sales Order Form, that displays the total number of time the Order Confirmation" report is printed.
:-k I was thinking of... incrementing the "No. Printed" Variable in the Sales Header table, each time I push the "Print" button from the Order Confirmation report. But, I'm not sure where to code this..
I understand that, "Print, Preview, Cancel, and Help" are all default buttons off any report, how do I access the "Print" button's OnPush Tigger?
Any suggestions?
Thanks...
0
Comments
There is variable called Currreport.preview, that returns a boolean if you are actually printing.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
On the Order Confirmation Report on the Sales header Dataitem
put
OnAfterGetRecord()
"No. Printed" := "No. Printed" + 1;
You could Create a new counter just for the confirmation's as compared to Picking tickets. :-k
http://www.BiloBeauty.com
http://www.autismspeaks.org
(Sales Invoice won't work .. just because I need it on the Sales Order Form...)
The suggestion was to check out the sales invoice report because it also has a "No. Printed" finctionality. Which you can see how it is done there and apply it to the sales order.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thanks for clarifying that.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks..
I guess i really spoke to soon..
I used Order Confirmation just as an example to describe my situation. When I retested it, i noticed, "No. Printed" is an auto incremented variable by the system when you print the report, no need for any code change (note: the variable ONLY increments when you print an Order Confirmation Report)
... and when I tried to put the following code PrCtr := PrCtr + 1; under the Sales Header (dataitem) OnAfterGetReport (for the report I wanted to keep a track of.), nothing happens
I also tried reading a bit on currentreport.preview... variable, but - it didn't seem to do what I need..
navision does alot of behind the scene processing, e.g. counting the number of sales invoices/order confirmations printed per SI/SO respecti...
how do I see this code
thanks in advance..
My Blog - nav.education
One word of caution: becareful about your record locking and updating in reports. If you lock a record at the beginning of a report being printed but don't commit it ever...that record is locked through the whole process. So make sure to do your table locks & updates (inlc. commits) either at the beginning OR end of the report to avoid impacting other users.
Epimatic Corp.
http://www.epimatic.com
Off the top of my head..
If you want to create a new field that just counts Confirmation reports.
You need to add your new field to the sales header
"ConfCounter" type integer
on the Confirmation Report
OnAfterGetRecord()
"ConfCounter" := "ConfCounter" + 1;
You will need a "Sales Header".MODIFY;
to set the change on the Sales header.
http://www.BiloBeauty.com
http://www.autismspeaks.org