Waldo's Blog
Microsoft Dynamics NAV

Recent Posts

Tags

Community

Email Notifications

Other Blogs

Communities

Archives

Tip: Where am I?

Here is a very simple tip.

These days, In NAV 2009, you got the RoleTailored Client, the Classic Client, web service and the NAS Server. So, you got more "clients", "environments", … or how you kids call it these days … then you had in 5.0.

Now, you can trigger each environment you want in code. This might be helpful when you want certain things to behave differently in a specific environments.

You only need two statements … and combine them:

  • GUIALLOWED: you already know this for a long time. In previous versions, this statement was called to "avoid the User Interface" (like dialogs and forms).
  • ISSERVICETIER: this is a "new" one since NAV 2009. This one tells you whether if code is executed on the ser vice tier or not … or in other words … when you're using the service tier in this specific case, environment, … or not.

If you combine these two statements, then you can very easily figure out "where you are", like this:

IF ISSERVICETIER THEN BEGIN
 
IF GUIALLOWED THEN
   
//RTC
 
ELSE
   
//WEBSERVICE
END
ELSE BEGIN
 
IF GUIALLOWED THEN
   
//CLASSIC
 
ELSE
   
//NAS 
END;

Like I said … it was a small (but may be useful) tip.

If you're looking for a certain applicable area … may be you would like to avoid printing a report for printing it in the classic environment.

Bookmark and Share

Comments

Waldo's Blog Microsoft Dynamics NAV said:

Here is a very simple tip. These days, In NAV 2009, you got the RoleTailored Client, the Classic Client

# December 1, 2009 4:54 PM

Marq said:

Very good! Thanks...

# December 1, 2009 5:43 PM

waldo said:

We've got a copycat amongst us:

blogs.msdn.com/.../astuce-3-o-suis-je.aspx

:-)

# December 24, 2009 3:26 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)