This article describes how to improve the performance of user-defined Report Writer functions in Microsoft Dynamics GP 9.0 or in Microsoft Business Solutions - Great Plains.
In Microsoft Dynamics GP, you can add the prefix "RW_" to a function to create a user-defined Report Writer function. However, when you use a user-defined Report Writer function in a report, you may experience a decrease in performance when you run the report. This decrease in performance is more likely to occur if the following conditions are true:
- The user-defined Report Writer function is used in the body of the report.
- The user-defined Report Writer function opens a table that is not directly attached to the report.
- In the same dictionary in which the function is located, create a form that has no windows. Attach the appropriate table or tables to this form. To attach a table to the form, use the Options command in the Form Definition window.
Note Make sure that each table is set to open during the Form Open operation.
- Create a form procedure that is named "Close," and then add the following script to this procedure.
close form <form_name>
- Add the following FORM_PRE script to this procedure.
call background Close of form <form_name>
- Add the following entries to the start of the function.
if not isopen(form <form_name>) then
open form <form_name>
- The function opens the form. This form automatically closes when the report has finished running.
- The form opens the attached tables during the Form Open operation. These tables remain open when the form is being generated. Therefore, Dexterity in Microsoft Dynamics GP can access these tables more quickly.
- If the form closes before the report has finished running, the function automatically reopens the form.