Monday 23 May 2011

Login Stored Procedure

Here's something I stumbled across when I was looking for something else in the NAV Developer and IT Pro Documentation (http://msdn.microsoft.com/en-us/library/bb219495.aspx).

It is possible to have a SQL stored procedure run automatically when a user logs in.

To enable this it is necessary to name the proc[sp_$ndo$loginproc] and it must have two parameters - the name of the application and the C/SIDE version number, neither of which need be used (http://msdn.microsoft.com/en-us/library/dd338930.aspx).

"Cool", I thought. "That could be useful for something."

So I setup an example as per the documentation, fired up the classic client and up popped the message.

Then I fired up the RTC, and guess what? No message.

So it only works with the classic client. Not so useful after all.....

Sunday 22 May 2011

Find your way back.

Here's a simple trick I use when I'm somewhere in a large block of code and I need to scroll somewhere else and then return.

For example, I may be scrolled half way through a large codeunit when I find I need to return to the documentation trigger as I've forgotten the modification version which I need to use in a comment. Getting to the documentation trigger is easy (Ctrl + Home), but getting back to my new code can mean using Page Down until I find my new code.

So, before I hit Ctrl + Home I will enter some rubbish code e.g. asdfasdf.

Then, when I've returned to the documentation trigger I can simply hit F11 (compile), the error in code is found and you are returned to the very spot from whence you came.