編輯

Use GetImageResource in a control add-in

Gets the URL for an image resource specified in the control add-in manifest. Business Central stores the resource in the database as part of the control add-in's .zip file. The method returns a URL that the control add-in script can use to retrieve the resource.

Learn more about control add-ins in Control add-in object.

Method signature

string Microsoft.Dynamics.NAV.GetImageResource(resourceName)

Parameters

Parameter Description
resourceName Type: String

The name of the image resource as declared in the control add-in manifest.

Return value

Type: String

Returns a URL for the specified image resource.

Example

The following example assigns the returned URL to an image element with the ID pushpinImage.

var imageUrl = Microsoft.Dynamics.NAV.GetImageResource('PushpinImage.png');  
document.getElementById('pushpinImage').src = imageUrl;

AL method reference
GetEnvironment method
InvokeExtensibilityMethod method
OpenWindow method