Change a report destination based on the SOP Type

Yesterday we had a forum post requesting almost the same thing, and I used the same logic to accomplish this task. 

When you print a SOP document, normally you get 'Standard' In the Report Destination dialog. If you have templates turned on, it defaults to template. 

The requirement is to change that so that it defaults to 'Template' only for Quote documents and defaults to 'Standard' for all other documents. The solution is below.

Because our code is going to reference the TypeTypeID dropdown on the SalesTransactionEntry window, you have to include that window in VBA, along with the Report Destination window. Be sure to export them together. 

Add the Report Destination form to VBA, and add the ReportType dropdown list. 

The trick is to traps the ReportType_Changed event. Normally, I'd trap the Window_Open event, but the logic behind this form changes the Report Type dropdown after the form opens. So trap the ReportType_Changed event and add the logic below. 

 

 

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences