how can get Server NAme from NAV 2009 RTC
Tatevik
Member Posts: 28
I need to get server name from Role tailored client ..
In classic client I used ContextURL function. But it's not supported in RTC.
Also I it is not allowed to read data from Server virtual table. Please advice.
Beforehand thanks a lot...
In classic client I used ContextURL function. But it's not supported in RTC.
Also I it is not allowed to read data from Server virtual table. Please advice.
Beforehand thanks a lot...
0
Comments
-
Can you tell me what you need it for? (different scenarios might have different solutions)Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Hello the scinaro is the following. I need just to get sql server name, just for passing its name to the VB project by automation. In the Classic NAV I used CONTEXTURL function, and probably you know it is not supported from NAV 2009 RTC.0
-
For that you would need to read the CustomSettings.config on the service tier, which is located in (I think) the APPLICATIONPATH.
You should be able to read that and find the DBSERVER key (and the DBINSTANCE key for SP1)Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Please Help!
How can I get the Computername of the NAV server???
That is not saved in the customsettings.config and I can't use the ENVIRON command in RTC?
What I'm trying to achieve is to build dynamically the address to call the NAV web services but without the PC name I can't do that!
Any Idea is much appreciated!Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
you can use windows host script and send a command set
It will return a lot of parameters. One of them is computername.0 -
Thank you ara3n!
I think I have found an even easier method using WshNetwork!
You can get the value of the property "ComputerName"!
Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
That's great that you found another way.0
-
I would create a field in a system table to hold the base URL of the Web Service listener - it is more flexible and who knows, maybe one day you will add another service tier (without an extra Web Service listener) or you decide to move the web service listener to a different machine.
/FreddyFreddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Thanks Freddy, which system table do you think would be better?
the company table?
I was trying to make it setup free....
Also can you please shed some light on this? ](*,) ](*,)Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
Found this old thread, while searching for a solution to build a SQL Connection String to connect to the current NAV DB. It seems this simply isn't possible anymore, and even Microsoft tried a rather strange way to do exactly the same in codeunit 8705 (NAV 2009 SP1 & R2). Take a look at in GetSessionInfo and the usage in LoadWindowsGroups.
It seems to assume the code (in this case the NAS) is running on the SQL server, and the used SQL server is installed as the default instance. Otherwise this doesn't seem to work, or am I missing something? :-kRegards
Peter0 -
Isn't this one of the new features in R2?
I have not looked at it yet - maybe it could be ported to SP1 or base 2009?David Machanick
http://mibuso.com/blogs/davidmachanick/0 -
If you just need the server name of the NAV Service Tier (not the actual service you are connected to, in the case of multiple services running on the same server) you can get it in the Session table in the Host Name field.0
-
@davmac1: Which new function are you refering to? I can't find anything that should give me what I need. :-(
The functions in codeunit 8705 are re-written from NAV5 SP1, where it used CONTEXTURL to get the db-name and SQL-instance name. The re-writing is now finding the db-name from the Session table which is ok. But it tries to find the SQL instance name from the Host Name field of the Session table, which is the computer name of the client executing the code. This would rarly work, but I guess it worked at the developers setup :?Regards
Peter0 -
Can't you get the SQL server name from the database information?
Or otherwise you can easily do it creating a SQL view and then link it to a nav table...Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
Yes it is basically the information from the Database Information window I need. However, I can't find a system table containing this info anywhere. HEY! Finally! I can get the current SQL Instance from the "Server" table, and the database from either the "Session" or the "Database" table. My problem is solved - thanks \:D/PureHeart wrote:Can't you get the SQL server name from the database information?
I'm kinda old school. I prefer making solutions that works both with SQL and Native DB, and both with the RTC and Classic client. And I should be able to restore my DB at a different server, and be up and running without having to change all kinds of setup and configuration. I know this approach is not the way the world is turning, but hech, I'm old school 8)PureHeart wrote:Or otherwise you can easily do it creating a SQL view and then link it to a nav table...Regards
Peter0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

