Hi,
In this post we will view the X code to display the development URL, domain name and build version of the D365FO environment.
Created a runnable class CG_ApplicationEnvironemtn(namely) and added the below code. On executing the class, we get the info message provided as Output.
class CG_ApplicationEnvironment { ////// Runs the class with the specified arguments. /// /// The specified arguments. public static void main(Args _args) { var env = Microsoft.Dynamics.ApplicationPlatform.Environment.EnvironmentFactory::GetApplicationEnvironment(); // Environment URL str url = env.Infrastructure.HostUrl; info(strFmt("Environment URL: %1", url)); // Domain Name str domainName = env.Infrastructure.FullyQualifiedDomainName; info(strFmt("Domain Name: %1", domainName)); // Build Version str buildVersion = env.Infrastructure.BuildVersion; info(strFmt("Build Version: %1", buildVersion)); } }
Output:
Thanks,
Chaitanya Golla
*This post is locked for comments