Dynamics AX
  RSS Feed  LinkedIn  Twitter
Want to turn you're data into a true asset? Ready to break free from the report factory?
Ready to gain true insights that are action focused for truly data informed decisions?
Want to do all of this across mutliple companies, instances of Dynamics and your other investments?
Hillstar Business Intelligence is the answer then! (www.HillstarBI.com)

Hillstar Business Intelligence for Microsoft Dynamics AX and NAV on Mobile, Desktop, Tablet


Let us prove to you how we can take the complexity out of the schema and truly enable users to answer the needed questions to run your business! Visit Hillstar Business Solutions at: www.HillstarBI.com

Wednesday, August 16, 2006

Returning the Current SQL Server, Database, and Configuration

Recently I needed to add business logic around code, that acted differently based on what Ax instance I was in. I wanted to know the best way to always determine that, and after doing some searching I cam across the following line of code:

SqlSystem::databaseBackendDesc();

The above line of code will return in string value the: [Server Name] [Database Name]

This is not documented really anywhere, and the SqlSystem class is not something that can even be seen from the AOT itself. It's one of those hidden, but very useful classes that we have all had to deal with, or wish we knew more about. Anyway, this method works great and returns the correct information everytime!

Another method that is great comes from the xInfo class, and it looks like this:

xInfo::configuration();

This method will return the name of the current configuration in use, which in turn can also help you determine which instance of Ax you are using.

I know that I will have use for this in the future and so I have posted this little tidbit in hopes that it will helps others as well!

Find a job at: www.DynamicsAXJobs.com

0 Comments:

Post a Comment

<< Home


Copyright 2005-2011, J. Brandon George - All rights Reserved