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.
Startup
{ Created by Mariano Gomez, MVP
This code is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 2.5 Generic license.
}
local integer l_result;
pragma (disable warning LiteralStringUsed);
l_result = Trigger_RegisterFunction(function IsTemplateEnabledReport of form syReportLookup, TRIGGER_AFTER_ORIGINAL, function glPostingJournalReport);
if l_result <> SY_NOERR then
warning "Trigger registration for General Posting Journal report failed.";
end if;
pragma (enable warning LiteralStringUsed);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().
glPostingJournalReport()
{ Created by Mariano Gomez, MVP
This code is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 2.5 Generic license.
}
function returns boolean result;
in 'Product ID' nProdID;
in Resid nResID;
if nProdID = DYNAMICS then
{It's our report. Indicate that it is template enabled.}
case nResID
in [resourceid(report 'General Posting Journal')]
result = true;
end case;
end if;
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 |
![]() |
| 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.
Downloads:
Extracted dictionary - Click here
Chunk file - Click here
Until next post!
MG.-
Mariano Gomez, MVP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com/


0 comments:
Post a Comment