Welcome to mibuso.com

mibuso account = Forum account

To login to mibuso.com, you need a forum account. The same forum account is used through the site.

Don't have a forum account yet?

Please register yourself first in the forum: registration

Member Login

Lost your password?

18 May 2013
 Home | Forum | Downloads | Business Directory | Product Directory | How Tos | Blogs | Jobs Feedback 
Become a sponsor
Our sponsors

How Tos

How To retrieve servername and servertype?

Author: Luc Van Dyck

Starting from Navision Attain 3.01, the C/AL function CONTEXTURL is available. This function returns a context string that defines the current position of the running objects.
Example:
navision://client/run?database=filename&company=companyname&servertype=NAVISION
navision://client/run?servername=server&company=companyname&servertype=MSSQL

When connected to a server (both Navision and SQL), this string contains the servername and servertype ('NAVISION' or 'MSSQL').

The function fctGetServerName returns the servername or '' when connected to a local database.
The function fctGetServerType always returns either 'NAVISION' or 'MSSQL'.
fctGetServerName() : Text[30]
ltxtTemp := CONTEXTURL;
i := STRPOS(ltxtTemp,'servername=');
IF i > 0 THEN BEGIN
  ltxtTemp := COPYSTR(ltxtTemp,i + 11,999);
  i := STRPOS(ltxtTemp,'&');
  EXIT(COPYSTR(ltxtTemp,1,i - 1));
END
ELSE
  EXIT('');

fctGetServerType() : Text[30]
ltxtTemp := CONTEXTURL;
i := STRPOS(ltxtTemp,'servertype=');
IF i > 0 THEN
  EXIT(COPYSTR(ltxtTemp,i + 11))
ELSE
  EXIT('');

 

 Download code

Author: Luc Van Dyck
Date: 03/03/2003
Size: 2.5 KB
Downloads: 1905
Views: 10888  (Page views are only logged since 3 May 2005)
 
Avg. rating:  (rated 18 times)
 
Discuss this How To in the forum (5 reactions)
 
What's this MUID? [MUID:MIHY]  SMS this title to a friend
 Mail this title to a friend
 
Rate this HowTo
 
- Please do not vote for the same HowTo more than once.
- Please be objective.
   poor



   excellent



Copyright © 1999-2013 mibuso.com. All rights reserved. About | Link to us | Recommend it! | Disclaimer
mibuso.com is not in any way affiliated or associated with Microsoft Corporation or any of the companies in the Microsoft Corporation Group.