GetImageResource Method

Gets the URL for an image resource specified in the control add-in manifest. The image resource is stored in the database as part of the .zip file for the control add-in and is exposed to the control add-in script running on the Business Central client using the URL that this method returns.

For more information, see Control Addin Object.

Method signature

string Microsoft.Dynamics.NAV.GetImageResource(imageName)


Parameter Description
imageName Type: String

A string that contains the name of the image resource to get a URL for. The image name is the name that is used in the control add-in manifest to reference the image.

Return value

Type: String

Returns a URL for the specified image resource.


var map = new VEMap('controlAddIn');  
    var pushpin = map.AddPushpin(map.GetCenter());  
    var imageUrl = Microsoft.Dynamics.NAV.GetImageResource('PushpinImage.png');  
    pushpin.SetCustomIcon("<div><img src='" + imageUrl +"'/></div>");   

See Also

AL Method Reference
InvokeExtensibilityMethod Method