I solved an interesting case yesterday and thought I would share the details with you.
The partner had installed Microsoft Dynamics GP 2010 R2 on a new Terminal Server and everything was working except the Home Page was not being rendered correctly.
The images were missing and showing as Red X's and the metrics were not being displayed.
The partner had already reviewed the standard Knowledge Base (KB) articles on home page issues:
The information in the articles did not resolve the issue, so the partner contacted Microsoft Support for assistance.
The Microsoft Dynamics GP homepage is created using a HomePage.xml file created in the local temporary folder for the workstation. The HomePage.xml file in turn uses the HomePage.xsl style sheet and HomePage.css cascading style sheet files in the Background folder in the application folder to control how it is rendered. Finally, the images are stored in the Images folder under the Background folder.
So, I asked the partner to send me copies of the HomePage.xml file from the %TEMP% folder and the HomePage.xsl and HomePage.css files from the Background folder.
Note: You can quickly open Windows Explorer to the %TEMP% folder by selecting Start >> Run >> %TEMP%.
The Homepage.xsl and HomePage.css files are standard and I could not find any issues with them.
I then compared the HomePage.xml file from the partner with one from my system using XML Notepad 2007. I found the value for the basehref attribute in the Page section of the XML at the top of the file was missing.
So I updated this value to match the value (as well as the location of the style sheet on the line above) from my HomePage.xml and the double clicked on the file to open it with Internet Explorer. The page now rendered correctly except for the metrics. As the metrics pointed to a report server that I don't have, it was expected that they would not work.
So, now we knew why the Home Page was not rendering correctly. With the basehref value missing, it was unable to locate the HomePage.css file and the images in the Images folder.
Below are the steps to check if the basehref value exists in your HomePage.xml. If it is missing then you might have the same issue as occurred on this case.
Looking at the Microsoft Dynamics GP Source code to check how the HomePage.xml file is generated, I found that the form level procedure XML_CreateStream of form syHomePageXML creates the basehref value in the xml document using the following code:
sPath = Path_MakeNative(Path_GetForApp(2)) + BACKGROUND + CH_BACKSLASH;call 'GetShortPathNameA@kernel32.dll', lReturnValue, sPath, sShortPath, length(sPath);sPath = ReplaceAllCharacters(sShortPath, CH_BACKSLASH, CH_SLASH);
This code attempts to obtain the path to the Background folder in the application install folder expressed using short (8.3) file names and with the backslashes converted to slashes. The call to GetShortPathName in the windows kernel32.dll will fail to return a valid result if there are no short file names stored in the directory structure for each folder in the path.
To test if the path to the Background folder in the application folder on your system has the short file names available for each folder in the path, we can run the following statements from the command prompt (this assumes you application is installed at "C:\Program Files (x86)\Microsoft Dynamics\GP2010\Background"):
dir "C:\Program Files (x86)*" /xdir "C:\Program Files (x86)\Microsoft Dynamics*" /xdir "C:\Program Files (x86)\Microsoft Dynamics\GP2010*" /xdir "C:\Program Files (x86)\Microsoft Dynamics\GP2010\Background*" /x
The results for each dir statement should show both the long file name and short file name, for example:
Directory of C:\
19/08/2012 11:05 <DIR> PROGRA~2 Program Files (x86)
If the short file name is missing then short file names might be disabled for your system or for the drive volume.
Referring to the Knowledge Base (KB) article below, we can learn how to turn short file names back on using the fsutil command:
The following steps check the settings for 8.3 short file name creation and turn the feature on if required:
Note: These changes take immediate effect, a reboot is not required. Any folders or files created from this point onwards will have a short file name created for them.
However, the issue is not fully resolved yet. Existing folders and file names will not be updated to add short file names. Even if you rename a folder that does not have a short file name it will not be added.
So, to finish resolving the issue, we needed create the folder structure again so that it included the short file name at each level. Below are the steps:
Note: If the higher levels in the tree did have short names associated with them, you can start the above steps from that point onwards.
Now the complete path to the Background folder will have short file names at each level and the Home Page displays correctly.
That's all folks.
PS: It looks like the short file name path to the Background folder is used to allow simpler referencing of the folder (without spaces) in the code in the HomePage.xsl style sheet file.
PPS: This will no longer be an issue with the upcoming Microsoft Dynamics GP 2013 release as the Home Page code has been completely redesigned and this dependency no longer exists.
Posting from Mark Polino at DynamicAccounting.net
Thanks David - this potentially saved me hours of frustration!
PLEASE READ BEFORE POSTING
Please only post comments relating to the topic of this page.
If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.