Sunday, May 22, 2022

Get Application Environment link IN D365FO

 I got a requirement to get the current application environment and I need to pass to some other integration. Just check the below code.


public static void getEnvironmentAddr() {    
    var env;

    env = Microsoft.Dynamics.ApplicationPlatform.Environment.EnvironmentFactory::GetApplicationEnvironment();

    Info(strFmt("%1", env.Infrastructure.FullyQualifiedDomainName));               

Info(strFmt("%1", env.Infrastructure.HostUrl));// with https

}

Keep daxing!!

No comments:

Post a Comment