How to use Customization Manager to add a button that prints a report in Microsoft Dynamics SL
Thai article describes how to use Customization Manager to add a button that prints a report in Microsoft Dynamics SL.
Applies to: Microsoft Dynamics SL 2011
Original KB number: 932131
Use Customization Manager to add a button
Note
To follow the instructions in this article, you must have Customization Manager in Microsoft Dynamics SL registered.
The following steps print a list from the Voucher and Adjustment Entry (03.010.00) screen. The list contains vendors that have a nonzero balance.
In the Modules list, click Accounts Payable.
In the Accounts Payable pane, click Voucher and Adjustment Entry in the Input area.
On the Customize menu, click Customize Mode.
On the Customize menu, click Insert Object Wizard to open the Insert Object Wizard (91.252.00) screen.
Click Button, click Apply, and then close the Insert Object Wizard (91.252.00) screen.
Left-click the new button, and then drag the button to the Voucher and Adjustment Entry (03.010.00) screen.
Right-click the new button, and then click Property Window to open the Properties dialog box.
On the Caption property, type Print.
Right-click the new button, and then click Visual Basic Editor to open the Microsoft Visual Basic screen.
Copy the following code into the Microsoft Visual Basic screen.
For Microsoft Dynamics SL version 7 and earlier:
Private Sub Button1_Click() Call ApplSetParmValue("", "", "03670/RUN") Call ApplSetParmValue("", "", "03670S/FORMAT") Call ApplSetParmValue("", "", "vr_03670s.CurrBal >0 /WHERE") Call ApplSetParmValue("", "", "/PSCRN") serr1 = Launch("ROI", True, True, 0) End Sub
For Microsoft Dynamics SL 2011:
Private Sub Button1_Click() Call ApplSetParmValue("", "", "03670/RUN") Call ApplSetParmValue("", "", "03670S/FORMAT") Call ApplSetParmValue("", "", "{vr_03670s.currbal} >0 /WHERE") Call ApplSetParmValue("", "", "/PSCRN") serr1 = Launch("ROI ", True, True, 0) End Sub
Click Save, and then close the Microsoft Visual Basic screen.
Close and then reopen the Voucher and Adjustment Entry (03.010.00) screen.
Click Print to test the customization.