Ok, this is directly or indirectly a Report Writer subject, but nonetheless a topic related to Report Writer. In this example, I take the General Posting Journal transaction document and enable it under Word Templates. However, this example will not develop the Word Template itself, but rather show how easy it is to make the journal document template enabled.
The steps are very simple and in fact, with a little bit of creativity, a developer could potentially write code that quickly enables critical reports.
To enable an existing Microsoft Dynamics GP report:
1. Register a trigger against the IsTemplateEnabledReport() function of the syReportLookup form. Template enabled reports can be selected in the Reports lookup window.
Note: You will need to save the Startup script first (CTRL+S), and compile the dictionary when the trigger processing function is implemented.
2. Now that we have our Startup script and the trigger registered, we can implement the trigger processing function. In this case, I have labeled this function glPostingJournalReport().
Note: In the above code I am using the dictionary constant DYNAMICS for the product ID as our report belongs to the core dictionary. Also, rather than hardcoding the resource Id for the report, I am using SanScript’s resourceid() function to obtain the resource Id for the report.
3. Open Dexterity Utilities to extract and autochunk your dictionary into a final product. The following are the settings I used for this particular project:
|Auto-Chunk and Product Information windows|
4. Drop your chunk file in the Dynamics GP folder and make sure that you can see your trigger in action in the Reports lookup window under Report Template Maintenance.
|Reports Lookup window|
Now that we have won half the battle, I will show in my follow up post, how to actually implement the template and make it all work together.
Until next post!
Mariano Gomez, MVP
Maximum Global Business, LLC