編輯

共用方式為


System.GetUrl(ClientType [, Text] [, ObjectType] [, Integer] [, Record] [, Boolean]) Method

Version: Available or changed with runtime version 1.0.

Generates a URL for the specified client target that is based on the configuration of the server instance. If the code runs in a multitenant deployment architecture, the generated URL will automatically apply to the tenant ID of the current user.

Syntax

String :=   System.GetUrl(ClientType: ClientType [, Company: Text] [, ObjectType: ObjectType] [, ObjectId: Integer] [, Record: Record] [, UseFilters: Boolean])

Note

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

Parameters

ClientType
 Type: ClientType
Specifies the client that you want to generate the URL for. If you want to generate a URL that depends on the client that the user is accessing the URL from, choose Current. A runtime error occurs if the ClientType is set to SOAP or OData but the specified object type and ID has not been published as a web service.

[Optional] Company
 Type: Text
Specifies the company that the URL must contain. If you do not specify a company, the URL will run in the user’s current company.

[Optional] ObjectType
 Type: ObjectType
Value: Table, Page, Report, Codeunit, Query, or XmlPort. Specifies the object type that the URL must open. If you specify an object type, you must also specify an object ID in the ObjectId parameter. Otherwise, the user will see a runtime error. If you set the ObjectType parameter to Page, you can also specify a record variable in the Record parameter.

[Optional] ObjectId
 Type: Integer
Specifies the ID of the specified object type that the URL must open.

[Optional] Record
 Type: Record
Specifies the Record variable that specifies which record to open.

[Optional] UseFilters
 Type: Boolean
Specifies whether to include filters that are defined on the object as a text string in the URL. Note, UseFilters is supported only for ClientType: Desktop, OData, Phone, Tablet, Web, Windows, Default, ODataV4, Teams and Current, when CurrenClientType is one of the ClientType mentioned. An empty string is returned otherwise.

Return Value

String
 Type: Text

System Data Type
Get Started with AL
Developing Extensions