Client side error logging

Hi all.

I was interested to know if there is someway to generate a log on the individual clients PCs, that can be used to analyse what errors they receive?

Specifically, ‘table locked by another user’ type errors - we are monitoring the DB for these, but I would like to be able to complete the picture by cross referencing these blocks to user error messages, without having the user make a note of when it occurs.

I should add we running Dynamics NAV 5.0 on a SQL2005 Database.

Any insights into client side logging would be greatly appreciated.

thanks, Mark

this request sounds like a blog idea. May I use this request? I think I have a good solution :slight_smile:

Absolutely. Please let me know when you post your blog!

cheers,Mark

Besides enabling logging SQL Server I don’t know many other solutions. I would love to listen your solution Rashed.

I’m confused. Hasn’t this already been solved on this (http://blogs.msdn.com/microsoft_dynamics_nav_sustained_engineering/archive/2008/03/28/simple-query-to-check-the-recent-blocking-history.aspx)

blog? In Lars’ query, he doesn’t include the blocking, or blocked user id, but that shouldn’t be too hard to do.

(After all, they are generating this report server side at Starboard, Ahmed :slight_smile: )

Here is the Solution. Legosz is requesting any errors the users get, whether locking or entering the wrong value. You can identify who the bad users and how much time is spent on getting errors, instead of doing work. http://mibuso.com/blogs/ara3n/2008/05/24/monitoring-user-errors-in-navision/

Thanks for the post. I’ve downloaded the fob and I’ll put into our test system and have a play around.

Would you expect any significant performance impact by using this?

Would having this run supress the error for the user, or log it in addition to continuing to display the messages to the user?

thanks, Mark

One other question for you - the table number 50005 - we already have a table with that ID number. What is the recommended procedure to handle this? Change the ID of the exsting, import the new, rename the new and put the existing back to 50005?

I would rename new object before import it and import with new ID.

Performance is minimal. SQL server gets an insert only if the user gets an error. So if you have 200 users connected. You’ll get insert when any user gets an error. You could change the code and write the error to Event Log. That way SQL server won’t see any performance. But you have to then query all the client pc for events. All this does is log the error. Navision user will still see the message.

I have included the txt file as well. So you can change the ID and import the txt file. Also in Cu you need to change the variable for table ID.

I guess you learn something new every day. I imported via the text file after changing the ID in the required places.

I’ve been doing some playing, and from what I can tell it works really well - better than I anticipated when I first placed this question. You mentioned on your blog the code would enable it to run for all users on startup.

Is there a simple way we could control this on a per user basis, mainly as part of our testing process to ensure we don’t create any additional problems for users. For example, our implementation plan would be:

  1. Test within IT by manually running the code unit (which I’m doing now)
  2. Insert some code to run for IT and ‘power users’ automatically
  3. Use below code to run for all users.

CompanyOpen()
//Mod02 Start
CODEUNIT.RUN(CODEUNIT::“Error Listener”);
//Mod02 End

thanks, Mark

You can add a new boolean field to the User Setup table “Enable Logging”. Change the code to this.

CompanyOpen()

//Mod02 Start

if UserSetup.get(UserID) and UserSetup.“Enable Logging” then CODEUNIT.RUN(CODEUNIT::“Error Listener”);

//Mod02 End You can enable it for users you want to log

Thankyou again for the help. That sounds like a pretty nice solution.

Perhaps I jumped the gun a little…

I added the initial code to the CompanyOpen() function. Initially all appeared to be well. When I produced the first error, it was displayed, but not logged. However a few seconds later I get a message:

You do not have permissions to read the User Errors table.

The message would re-appear every 6 seconds or so, which I presume is related to the timer interval setup in the codeunit.

Thinking I was being smart, I went into the ‘All’ role and added for its permissions ‘Table Data’ and yes to all for the User Errors table. I closed my Dynamics client and restart, however the same problem was present.

Am I looking at a licensing issue here? Any ideas?

Are you on standard or Enhanced security model? if you are on Enhanced, you need to synchronize security as well. If you are on standard model then yes it’s a licensing issue. You need to purchase the table and order a new license. I would suggest to To find out on which security model you are. File->database->alter>Advanced tab.

So I ran the syncronise, still had the issue. After checking our license I realised I had used an ID number that was outside our licensed range. So thats all sorted now and the testing can begin.

Thanks so much for your help

You are welcome.

Quick question for you.

I’ve been testing this on some other PCs.

When they open the company, the get an error “Could not load the selected type library”. They press Ok and they can proceed as normal.

Do you have any pointers where to look for this? It only happens on some PCs which points to a PC specific issue - doesn’t happen on all PCs. So far I have not worked out the difference between a working PC and non working.

Can you suggest anything based on the components your solution here uses?

thanks, Mark

Ok, so I figued it out. After trying many options, a repair of the client installation fixed the issue.