Opening an External URL from a Form in Dynamics 365 Finance and Operations

In this article, we will demonstrate how to open an external link (URL) from any form within Dynamics 365 Finance and Operations (D365FO). This functionality can be useful for redirecting users to external resources, such as documentation, support pages, or third-party applications.

Implementing the Solution

To achieve this, we need to create a runnable class in X++ that will open the URL in a new browser tab. Follow the steps below:

Step 1: Create a Runnable Class

1. Navigate to Visual Studio and open your D365FO project.

2. Create a new class named LinkNavigator.

3. Implement the following logic inside the main method:

X++ Code Implementation

class LinkNavigator  
{  
    public static void main(Args _args)  
    {  
        Browser browser = new Browser();  
        browser.navigate('https://microsoft.com', true);  
    }  
}  

4. Call this class using a Action Menu Item that can be placed on the form as per the requirement. 

Explanation of the Code:

• We create an instance of the Browser class.

• The navigate method is used to open the specified URL (https://microsoft.com).

• The second parameter (true) ensures that the link opens in a new browser tab.

Conclusion

By implementing this simple X++ class, you can easily open external links from within D365FO. This approach can be extended to dynamically pass URLs based on business requirements, such as opening a customer’s portal or vendor website.

Comments