Using 3rd Party Series Reports in the Report Template Maintenance Lookup Window

A few weeks ago we ran into an interesting case regarding the new Word Report Templates in Dynamics GP 2010.

An ISV was working on adding templates to her Dynamics GP customization but was stymied by the "Reports" window which is the report lookup window for the Report Template Maintenance window.

In her customization, all of her reports were set to the 3rd Party series. Unfortunately in the Reports lookup window, the 3rd Party series doesn't appear as a list of choices and so couldn't be selected. The ISV naturally wondered if this was a bug in Dynamics GP 2010 by not having this series listed.

Checking the source code, it looks like this series was purposefully omitted for some reason. But upon further investigation of the code, it appeared that if there were a 3rd party series listed, the rest of the window would "just work". That was what it looked like anyway.

The ISV was given 2 options to resolve this issue and make her reports appear in the list:

Just change the series of her report to one of the listed series.

Try using a trigger to add "3rd Party" to the drop down list as that would appear to work.

She chose the former, just change the series of the template enabled reports. That is likely what I would do as well - I typically never choose "3rd Party" series for anything and always choose the series my customization fits into. Or if I'm feeling wild & crazy, I'll choose the Project series.

But to see if this would work just as easily as it appeared, I had to test it. And as it turns out - it really was just that easy.

Startup script - Trigger Registration

{Need this trigger so lookup shows 3rd party series reports}
l_result = Trigger_RegisterProcedure(script LoadSeriesDDL of form syReportLookup,
TRIGGER_AFTER_ORIGINAL, script syReportLookup_LoadSeriesDDL_Post);
if l_result <> SY_NOERR then
warning "The LoadSeriesDDL trigger is not registered.";
end if;

{Need this trigger so your application tells Dynamics that this is a template enabled report}
l_result = Trigger_RegisterFunction(function IsTemplateEnabledReport of form syReportLookup,
TRIGGER_AFTER_ORIGINAL, function isTemplateEnabledReport_Post);
if l_result <> SY_NOERR then
warning "The IsTemplateEnabledReport trigger is not registered.";
end if;

In the Startup script above, the first trigger on LoadSeriesDDL of form syReportLookup is the trigger necessary so that 3rd Party series reports will show in the list. The 2nd trigger is documented as required in the Microsoft Dynamics GP Integration Guide to make the specific reports show in the list. Just like in Dynamics GP, not every report would likely be "template enabled".

Procedure syReportLookup_LoadSeriesDDL_Post

Here we are using Dynamics dictionary constants & messages to add the word "3rd Party" and the series of 10 to the drop down list of the window if it isn't already there.

For simplicity, I hard coded the above procedure to make all of my reports in the customization template enabled. In a real life application, that probably wouldn't happen and the ISV would have an "if" or "case" statement to only specify specific reports to be template enabled.

After creating my cnk and testing it in runtime (doesn't work in Dexterity test mode because it checks the dictionary and resid of the reports before adding) my customization worked correctly showing both my Sales series reports (it did that previously) and also my 3rd Party series reports (which it did not).

I actually like using 3rd party series for my code (or system for tables need to be in the Dynamics DB).

This does mean that you need additional coding for things like setting the pathname for tables in the 3rd party series, but I have this code in my standard development template. See the KB below for info:

How to control the location of the Dexterity tables in SQL Server by using Dexterity path names in Microsoft Dynamics GP 9.0 or in Microsoft Business Solutions – Great Plains (KB 919347)