Hi, when you run report 208 'Sales - Shipment' you can enter the
NoOfCopies inside the option tab on the Request form.
Now i added a Field to the customer card, nl. "No. of Sales Shipment Copies".
So my goal is that when the report is Run, it should automatically fill in the NoOfCopies on the request form with the value of the Customer field "No. of Sales Shipment Copies"
So i added this functionallity to the print button in the "Posted Sales Shipment" form:
lv_Customer.GET(Rec."Sell-to Customer No.");
lv_SalesShptRpt.SetNoOfCopies := lv_Customer."No. of Deliveries";
lv_SalesShptRpt.SETTABLEVIEW(Rec);
lv_SalesShptRpt.RUNMODAL;
Now the problem is that the NoOfCopies is not set when it opens the request form and the TableView is not working cause it just prints the report for every sales shipment there is...
Whats going wrong here?
That SetNoOfCopies function inside the report looks like this:
SetNoOfCopies(varNoOfCopies : Integer)
NoOfCopies := varNoOfCopies;
So it just fills up the Global Variable inside the report which is displayed in the "No of Copies" field on the request form
0
Answers
It's just the tableview which is not working.
It now prints for every sales shipment a Report, while it should just do this for the Sales Shipment which was selected in te Form when i pressed print
Just had to create a variable and set a filter on that variable instead of passing the Current Rec to the tableview
you add
Variable->Customer->Record->Customer
OnPreDataItem()
Customer.GET("Sales Shipment Header"."Sell-to Customer No.");
If NoCopies = 0 then NoCopies := Customer."No Of Deliveries";
...
NoLoops := 1 + ABS(NoCopies);
IF NoLoops <= 0 THEN
NoLoops := 1;
CopyNo := 0;
Tested & works fine
This way the reqest form can override the settings in the cust card if needed
http://www.BiloBeauty.com
http://www.autismspeaks.org
Imagine that on the Customer Card the No of Copies is set to 5.
But for one special occasion you just only need 2 copies.
You press print and there will be a 5 displayed on the Request form.
Now the user can easily change this to 2.
When i would declare the No of Copies inside the DataItem i guess this 2 will get changed to 5 copies?
this is just a quick example of where you can put the code this code doesn't fill the request form
http://www.BiloBeauty.com
http://www.autismspeaks.org