Debugging Microsoft Dynamics GP 2010 Word Templates

In my previous article I outlined a few steps to add a page of terms and conditions to an invoice form. However, these changes did not come without their challenges. When I initially started out working on this customized template, my “natural instinct” was to add a new section to the Word template and unlink the header and footer from the previous section, then add the text. To complicate matters a bit more, I had added this new template as a modified version of a modified report – SOP Blank Invoice Form Template (Modified). Typically this is what would be encountered in a GP environment anyways as most standard GP invoice forms were customized even before the Word Templates functionality even existed in GP.

Somehow, these changes managed to crash and display a message in the Template Processing Exceptions(TPE) window and I ended up with this error:

One or more templates could not be processed. View the exception log for more details.
Well, that was a good start… but, where was the exception log?
Of course, being the well connected individual that I am – Ehem! – I sent this one off to my good friend Rob Wagner over at Microsoft Business Division, who is also known as “The Word Templates God” in some circles. Rob pointed me to a new DEX.INI setting available for Word Templates:

TPELogging=TRUE

In Rob’s own words, “FYI, dex.ini TPELogging=TRUE is used to gather where an exception has occurred. It points the combine process where I will go in and debug the TPE.”.

The log is created in the %temp% directory where the actual Word document is rendered and its content looks something like this:

10 hours. 57 minutes.13 seconds. 901 milliseconds. :20050: Combine.Unhandled

TPE was indicating that there was an issue with an exception not being handled when the XML data from Report Writer was being combined with the actual Word template.

This allowed Rob and his team to start tracking down the issue with my template from the source code and provide me with an alternate route to solve my problem.

As a final note, it seems there is an issue as well with TPE not clearing some process after choosing to remove the exception from the Report Processing Status window. In turn, this prevents shutting down GP via the Exit option, having to use the Windows Task Manager to force the termination of the DYNAMICS.EXE process. Rob’s team is on this too.

Until next post!

MG.-
Mariano Gomez, MVP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com/

6 Responses to Debugging Microsoft Dynamics GP 2010 Word Templates

  1. Anonymous says:

    Hi Mariano,I probably missed this, but is there an alternate solution to the problem?Leslie

    • Rafael says:

      Hello, I solved the problem using the following procedure
      1. In SQL, run this statement: Select @@servername
      2. Create a new datasource
      2.1 the datasource name must be that is returned from step 1.
      2.2 the descripction is “GP Datasource” (no matter)
      2.3 For the SQL Server name, it should match the dsn you use for GP. It is probably an IP address.
      2.4 the data source up identical to the data source that they use to log into GP.
      2.5 Test the connection.
      3. you don’t have to use it for anything, it just has to be there. For this example, the servername returned from step 1 is “GPSERVER”.
      4. Then try to run the word template again

      Regards

  2. What specific problem are you referring to? If by problem you mean the issue caused while attempting to exit Dynamics GP, then the answer is, I will have to follow up with Rob. I will keep you posted.MG.-Mariano Gomez, MVP

  3. Anonymous says:

    >Hi Mariano,So what was the alternsate solution to the problem with the Templates?I am having the same error but works when logged in as sa.

  4. Rafael says:

    Hi Mariano,
    you had any news abaut how to solve the problem of templates. I have no problem to generate the reports with sa user, but anyone else get this error.
    Regards

  5. Jeff says:

    hi Mariano,

    I had experienced the same problem shown on the Report processing status window. Any idea what was the solution to get past that issue?

    thanks much

Leave a comment