Business Central 2021 wave 2 (BC19) new features: AL API for sharing files in Microsoft 365 (Cloud Storage and Open in OneDrive)

Dynamics 365 Business Central

Hi, Readers.
The preview environment for Dynamics 365 Business Central 2021 release wave 2 (BC19) is available now. Learn more:

Update: Generally available: Dynamics 365 Business Central 2021 release wave 2 (BC19)

I will continue to test and share some new features that I hope will be helpful.

AL API for sharing files in Microsoft 365:

Business value:

Bring the best of Microsoft’s business and productivity suites together to initiate collaborative, review and sharing activities directly from Business Central.

Feature details:

AL developers will be able to implement sharing of their reports or other files using standard Microsoft 365 capabilities for cloud-based file sharing. For example, this could be used to build an experience where users share a custom financial report over email.

Since Microsoft does not provide a lot of information for this, I am not sure if the content I write next is related to the title, but it may bring readers a lot of new information is not bad.

Okay, when you open the My setting in BC19, you will see an additional item.

Cloud Storage
Specifies a link to explore your Business Central folder in OneDrive. Select the link to open the folder in a new window.

You can click the value of the Cloud Storage field.

Then a login window will pop up.

1. You need always allow pop-ups and redirects from for your browser.

Otherwise, an error will occur.

Failed to acquire an access token.

2. Need admin approval

Business Central Integration to

Business Central Integration to SharePoint needs permission to access resources in your organization that only an admin can grant. Please ask an admin to grant permission to this app before you can use it.

3. You need a license for Office 365, otherwise, OneDrive cannot be opened.

If there is no problem with the verification, the page will jump to OneDrive.

Test video:

The next question is, where is this feature used? Since it is file sharing, the first thing I think of is Attachments.

Sure enough, a new button has been added on the Document Attachment Details (1173, List) page.

Open in OneDrive

Copy the file to your Business Central folder in OneDrive and open it in a new window so you can manage or share the file.

Choose Open in OneDrive.

Then OneDrive will be opened.

Directory of files: Business Central -> Company Name

Test video:

Note: When the same file is detected on OneDrive, you can choose between Keep Both or Overwrite

One last question, how does it work.
Let’s see some details in base application.
The key point in Open in OneDrive action.

DocumentServiceMgt: Codeunit "Document Service Management";

DocumentServiceMgt.OpenInOneDriveFromMedia(FileName, FileExtension, "Document Reference ID".MediaId());

codeunit 9510 “Document Service Management”

I tried to compare the 18.4 and 19.0 Preview versions of the file.

Microsoft has added a number of methods.

I think we can do the same or more😃, I will test it in detail after I get more information about this and the Official Release of BC19.

Update from Microsoft 2021/09/10:

Release Plan item: AL access to viewing and sharing files in OneDrive

Enabled for:End-users by admins, makers, or analysts

Business value

Bring the best of Microsoft’s business and productivity suites together to view and edit files, or initiate collaborative, review, and sharing activities directly from Business Central. Users benefit from a familiar file viewing and sharing experience, and reduce the need to download files to their device.

Feature details

Business application features that store, manage or present files can now be enhanced with actions to view a file in the browser, or share the file with others, by integrating with OneDrive for Business.

Available with Version 19.0

  • New AL objects in the system and base application that integrate with OneDrive. Developers only need to write minimal code when they need to open a Business Central file in the browser. This copies the file from Business Central to OneDrive, then opens the file using the native web applications for Excel, Word, and PowerPoint, or with OneDrive’s file viewer for all other files such as PDFs. This functionality is intended for interactive scenarios where users initiate the action during their session, and not for automating file transfer.
  • A documented AL code pattern and guidelines that developers can apply to any page or process used to represent files. This pattern consists of a Download action and Open in OneDrive action that developers can apply consistently across their extensions. For an example of this pattern applied in the business application, see the Attachments FactBox.

Available later this wave

  • Developers will be able to implement a third action, Share, that displays the standard Microsoft 365 file sharing window, directly within Business Central. The Share window allows users to share a link with others, email a link, or attach a copy of the file to an email.
  • Improvements to the end-user sign-in experience when using OneDrive from Business Central, reducing the number of windows required to handle identity and consent.
  • Variations to the AL methods will be made available that give more granular control over where and how the file is copied to OneDrive before it is opened or shared.

Update from Microsoft 2021/11/10:

Update 2021/11/11: Implement your custom “Open in One drive” action in Dynamics 365 Business Central


Hope this will help.

Thanks for reading.



Copied title and URL