Exporting from SmartList Dynamics GP “returned 29”

Are you experiencing a dialog box with the following text on attempting to export a Smartlist to Excel?

“RUN APPLICATION ERROR”

"C:\Users\user\AppData\Local\Temp\7\somefilename.xlsx returned 29"

This seems to be an error passed back from Excel regarding permissions issues, or lack of communication to excel from GP via DDE (Dynamic Data Exchange).

The option in excel in advanced options (File>>Options>>Advanced)

“Ignore other applications that use Dynamic Data Exchange (DDE)” should be unchecked.

Ignore other applications that use Dynamic Data Exchange (DDE)

There are a couple of threads on this on the GP forums:

SmartList export to Excel Run Application Error "[filepath]" returned 29

Run application error 29 in SmartList

FP: Couldn’t close table! Dynamics GP Error Solution

I talked before in a previous blog post about the “syContentPageXMLCache cannot find table” error. This and its cousin the “FP: Couldn’t close table!” error are caused when something disrupts Dynamics GP’s long lived open SQL connections between the client and server.

FP: Couldn't close table! 

This might be due to networking issues like bad routing, changing drivers on network cards, intermittent physical faults with NIC cards, faulty Ethernet cables, faulty intermittent Ethernet sockets on walls when doors in that wall are slammed shut , servers or client machines going to sleep, server NIC card problems, connectivity problems (WIFI), firewall outages, or many other potential causes. However there is always a break in communication between the server and client, just finding the root cause can be tricky.

My long standing problem

I found myself involved in this today. A new employee started, since they have been working for us, every time the Dynamics GP application is closed at the end of the day (or even mid way through the day), the application generates the “FP Couldn’t close table” error. They have also been getting other SQL related errors such as syContentPageXMLCache cannot find tableor “Invalid object name ‘##1470453’” – for reference, the latter is a temp table dropped when the connection dropped.

IT support had already tried:

  • New GP user ID for the user
  • Rebuilding the PC from the standard image
  • Swapping the newer PC hardware the new user got, for the same hardware the rest of the users are using, involving another new image rebuild.
  • Deleting the user’s AD profile and rebuilding it.
  • Swapping the Ethernet cables
  • Swapping to another wall port of a user that is known to work, also on another network switch
  • Checking power saving sleep options on the NIC and PC

None of the above has stopped the issue occurring. It came to a head when a quotation was entered, that ended up pulling the wrong currency for pricing. I suspect the SQL connection broke under the hood during the session. I was stumped as to what could possibly be causing the connection outages bearing in mind what had already been tried.

Attempting to resolve the issue

The user was instructed to email me the screenshots of the errors, the second they happened. Not long after, I came back from my lunch to see an email come in. Attached was the stereotypical errors caused by connection loss,” FP: Couldn’t close table!” error dialog.

I connected to the event log on the offending machine, looked at recent history and found the problem.

Event viewer shows Kernel Power event shortly before problem

The power settings in Windows 10 were checked and they all looked ok from the top level screen, set to sleep “Never”.

Power Options window

However when drilling into “Change advanced power settings” and checking through all the options, the “Allow hybrid sleep” setting was set to ON. Looking at the other machines in the area, they all were set to OFF.

Advanced power settings

So my current working assumption is that the user had come back from lunch, during which time the machine had snoozed, causing the SQL connection to drop, with the following errors on resuming using GP:

An unknown SQL error occurred.

A SQL network connection error occurred and your connection was cleared.

 

[Updated from original post]

A few days later…

The user experienced the issue again, the  fix had not worked. I did some more research and found some people reporting that although the advanced power settings are set to "never", sometimes by setting them to a very large number of minutes, then later setting back to “never” works. Almost as if the setting has not properly taken.

I updated the machine to have an 18 hour sleep time, to see what happened the next day.

There were also reports of overheating CPUs causing machines to sleep, but this user's machine hardware had been changed before, so I ignored that possibility.

Following day…

First thing in the morning I saw the user go for a coffee, this reminded me to go look at the machine log, but I couldn’t connect or "ping" the machine. On visiting the machine I found it asleep, this is when it dawned on me that what we were seeing may be a "machine-chair interface" issue.

I woke the machine with the mouse, checked the log to see it had gone to sleep moments before the user had gone for coffee. This time frame was too short for any reasonable timeout to have occurred, as the machine would be sleeping every few moments surely? The machine log had previously shown a pattern of sleeps at lunchtime and morning and mid afternoon. I had been assuming these sleeps were the user’s breaks due to some kind of inactivity timeout.

On the user returning from coffee I enquired about how they lock the machine when leaving it (note that our staff handbook mandates machines be locked when unattended). The user then showed me how they lock the machine…

user selects sleep menu

...the user selects the sleep menu!

Goodness knows how much time had been wasted tracking this down, but my recommendation might be now that we disable sleep for desktop machines in group policy!

So it turns out that the user was manually putting the machine to sleep so as to “lock it” each time they went for a break, thus causing the Dynamics GP database connection to break as the network card would be off and causing havoc with the application. The user had not made any association in the discussions at their desk about how we are stumped as to why the machine keeps sleeping and the action of what they saw as “locking” it. This is where being able to stand next to a user to observe an issue can be so valuable in problem solving!

Needless to say we have had no further issues since showing the user how the [Windows]+L key locks the machine.

Further reading

David Musgrave has in the past posted some more information on these kinds of issues that are worth a read:

TCP Chimney Setting and SQL Server Error: TCP Provider: An existing connection was forcibly closed by the remote host

More on SQL Server Connection issues with Microsoft Dynamics GP

What do you call that window GP?

Steve Endow mentioned on twitter the other day about the naming of objects in GP when programming. The inconstancies are astounding, I have to agree, you can spend half an hour trying to determine if the object named something almost like what you want is actually the object you want or not, then two mins to actually write the mod! The fact you end up using a tool to work out what the object name of the window is in the code, well that just tells the story.

api naming dynamics gp steve endow

What Steve might not realise is that it is even worse if you speak English rather than American. See that window he’s looking at in the tweet, look at it on my screen…

puchaseinv

So we have Enquiry rather than Inquiry, no big deal? Well mostly no we learn the translations, but it confusing to the new developers who have to get used to this translations issue. Sometimes the translated terms are not as obvious as this. However even this would be an issue if you were looking at the object explorer ordered alphabetically or doing a search for the object.

There  is fun though with Debtors and Customers. I still don’t really know why we can’t have customers too, for our users it would make more sense than the accounting term debtors!

Steve kindly furnished me with this screen shot of an American GP customer window.

GP2015CustMaint

Compare that to what we see…with a English Debtor Window. These are the same windows, replacing customer everywhere, now imagine searching for this in visual studio, or a field called debtor id…

dmuk

In visual studio when developing addins we have RMCustomerMaintenance, good job I didn’t go searching for debtor when looking for the object, eh?

customerobject

So I conclude it is all fun and games developing visual studio addins for GP!

 

Thanks for Steve inspiring this post with his tweet and helping with the screen shot.

Installing Dynamics GP Intrastat Module

If you are looking for the Intrastat module, it is part of the Main GP install, I think fromGP2013 when more of the product extras were bundled in - but certainly from GP 2015. When running the GP installer the various features that can be installed are offered in the installer, find Enhanced Intrastat, click on the icon to change if it is installed or not by the installer. This can also be performed retrospectively to add the feature to an existing install.

intrastat installer Dynamics GP

You must switch the module on in company options and use the intrastat setup window to get it going. Look for the user guide on line or on the installation media for full details.