Views:

SUMMARY
This article describes how to use Customization Manager to add a button that prints a report in Microsoft Dynamics SL
RESOLUTION

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.

1. In the Modules list, click Accounts Payable.

2. In the Accounts Payable pane, click Voucher and Adjustment Entry in the Input area.

3. On the Customize menu, click Customize Mode.

4. On the Customize menu, click Insert Object Wizard to open the Insert Object Wizard (91.252.00) screen.

5. Click Button, click Apply, and then close the Insert Object Wizard (91.252.00) screen.

6. Left-click the new button, and then drag the button to the Voucher and Adjustment Entry (03.010.00) screen.

7. Right-click the new button, and then click Property Window to open the Properties dialog box.

8. On the Caption property, type Print.

9. Right-click the new button, and then click Visual Basic Editor to open the Microsoft Visual Basic screen.

10. 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


11. Click Save, and then close the Microsoft Visual Basic screen.
12. Close and then reopen the Voucher and Adjustment Entry (03.010.00) screen.
13. Click Print to test the customization.