How to upload File from URL using Extension in Business Central

Today we will see how we can upload picture from live URL on item card with extension.

For the above process created extension by extending item card.

Lets see how extension work to upload the picture from URL.

  1. Create new AL file with required name and by using page extension snippet extend Item card Page as below

2. Create a function to upload the fileĀ 

In the above function used HttpClient and HttpResponseMessage method to upload the file from URL.

3. Call this function on action on item cardĀ 

While passing parameter in function passed directly the URL from where I need to upload the picture on item card.

4. Compile and publish the extension and check the result.

5. Once you click on Upload file it will automatically upload the picture from URL on Item card.

This way you can upload the picture from URL rather than downloading on local drive and upload.

Isn’t it cool..