Muokkaa

Jaa


System.Hyperlink(Text) Method

Version: Available or changed with runtime version 1.0.

Passes a URL as an argument to an Internet browser, such as Microsoft Edge.

Syntax

 System.Hyperlink(URL: Text)

Note

This method can be invoked without specifying the data type name.

Parameters

URL
 Type: Text
A URL that is passed to the Internet browser as an argument.

Remarks

The syntax must be a valid URL, such as https://www.microsoft.com, or path to a file on file share, such as file://d$/myfiles/myfile.txt. If you want the URL to be configurable, you can get the URL from a field or a variable instead. If you pass an empty string, then no browser window is opened.

At runtime, a new tab is opened in the same browser window where Dynamics 365 Business Central is running.

The HyperLink method works with different protocols and file types as along as the syntax is valid.

Note

When using the file:// protocol to open a file, the file should be stored on a network file share, not locally; otherwise the file will not open. Browsers block hyperlinks to files from a web page for security reasons and the hyperlink must be manually copied and pasted into a manually opened tab page.

The HyperLink method does not work on NAS services.

Example

The following example shows two uses of the HyperLink method to open the specified URL in the default browser. In the first line of code, the URL is specified in code. The second line of code illustrates how you can get a URL that is stored in a field on the current table.

HyperLink('https://www.microsoft.com');   
...  
HyperLink(Rec.UrlField);  

System Data Type
Get Started with AL
Developing Extensions