Skip to content

Tips, tricks and hints#

SharePoint Online#

  1. Document storage in SharePoint Online uses the standardized interface architecture of the Microsoft1 Graph API for connectivity. This can lead to differences in the connection compared to the SharePoint API.

  2. The search for keywords is always done with a set http header "prefer" with the value "HonorNonIndexedQueriesWarningMayFailRandomly" in order to be able to search over index terms that are not mapped in an index.

  3. Documents are always stored in SharePoint Online with conflict handling for renaming. As a result, a document of the same name, which is stored with identical index terms, never overwrites the existing document, but receives an automatically numbered, customized file name. This is done automatically using the URL parameter \@microsoft.graph.conflictBehavior=rename

Setting up app registrations#

In order to access SharePoint Online using OAuth 2.0 authentication using the Graph API, app registrations must be created that are designed for delegated access or application permissions. In the following chapters, a brief overview is given of which settings and procedures can be used for creating app registrations.

Set up an app registration for delegated access in Azure AD#

In order for users to authenticate to the Microsoft1 Graph API from within BMicrosoft Dynamics 365 Business Central1 to use SharePoint access, an app registration for delegated access must be set up.

For details on how to set up an app registration, see the Microsoft1 documentation.

  1. Open the app registrations in Azure AD, create a new app registration, and give it a unique name.

  2. Under Authentication, specify the address https://businesscentral.dynamics.com/OAuthLanding.htm as a redirect -URI of type Web.

  3. Under "Certificates & Secrets", create a new client secret key and reserve it.
    Attention! After closing the pop-up window, this key can no longer be copied!

  4. Under "API Permissions" for SharePoint access, assign "Delegated permissions" to the Microsoft1 Graph scopes:

    • Files.ReadWrite.All
    • Sites.ReadWrite.All
    • User.Read.All

Set up app registration for application permissions in Azure AD#

If, for example, a service is to log on to SharePoint Online for background processing and store or query documents, it may be necessary to use SharePoint Online. Create an app registry with application permissions.

For details on how to set up an app registration, see the Microsoft1 documentation.

  1. Open the app registrations in Azure AD, create a new app registration, and give it a unique name.

  2. Under Authentication, specify the address https://businesscentral.dynamics.com/OAuthLanding.htm as a redirect -URI of type Web.

  3. Under "Certificates & Secrets", create a new client secret key and reserve it.
    Attention! After closing the pop-up window, this key can no longer be copied!

  4. Under "API Permissions" for SharePoint access, assign "Application permissions" to the Microsoft1 Graph scopes:

    • Files.ReadWrite.All
    • Sites.ReadWrite.All

    It is also possible to work with Sites.Selected instead of Sites.ReadWrite.All. However, setting up selective authorizations is only possible via APIs and not via a graphical user interface.

Crawled Properties vs. Managed Properties#

In the SharePoint structure, a basic distinction is made between "crawled properties" and "managed properties".

Crawled properties are created by adding new columns to a SharePoint list, for example. If necessary, an index can be placed on top of these columns, so that these columns can also be directly indexed and filtered. However, the disadvantage arises with regard to the Graph API as soon as an index term is used across lists in several thousand documents (e.g. the customer number). Here, the filtering mechanism of the Graph API can no longer perform structured filtering and accordingly returns an http error 422 "The request is unprocessable because it uses too many resources".

The "DMS & ECM Interface" offers the possibility to automatically switch to a search query (graph query) if there are too many hits and to obtain the documents via it. However, there are the following limitations that must be taken into account:

  • For a graph query, properties must be marked as "Refinable". This is only possible via the already supplied properties with the names "Refinable\\ (example "RefinableString00"! So, in order to make your own property searchable and make it available for return, managed, "refinable" properties must be mapped to the searchable properties. How to do this is explained in the next section.

  • Managed properties are not available until after indexing. Indexing in SharePoint Online is automated in a time cycle between 5 minutes and 2 hours and cannot be controlled by the user or administrator. As a result, it can happen that a document that has just been filed cannot yet be found via the search!

Assignment of "Refinable" properties#

Open the Microsoft1 365 admin center and select SharePoint under "Admin centers" in the left navigation tree.

In the "SharePoint admin center" in the left navigation tree, select "More features" and then select the "Open" button in the "Search" tile in the main area to open the search settings.

Then, on the following screen, select the "Manage Search Schema" list item.

Now, assign to the Managed Properties with the Refinable the individual crawled properties that you created from the columns of the Document Library.

Corresponding data types for the Refinable properties are:

  • RefinableDate (00-19)

  • RefinableDateFirst (00-04)

  • RefinableDateInvariant (00-01)

  • RefinableDateSingle (00-04)

  • RefinableDecimal (00-09)

  • RefinableDouble (00-09)

  • RefinableInt (00-49)

  • RefinableIntFirst (00-04)

  • RefinableString (00-219)

  • RefinableStringFirst (00-39)

  • RefinableStringLn (00-09)

  • RefinableStringWbOff (00-49)

  • RefinableStringWbOffFirst (00-49)

  • RefinableYesNo (00-04)

An overview of the various properties and their characteristics can be found in this link: Microsoft1 documentation

Listing of the Business Central Standard Pages that have been extended by a document fact box#

The following overview contains all standard pages from Business Central that are currently extended with an info box for displaying archived documents. In the case of customised pages or other functional areas, the info box can be displayed on other pages via custom programming. However, these are not included in the standard scope of the application and are therefore not displayed here.

Object Name Remark
Bank Account Card
Bank Account List
Cash Receipt Journal
Contact Card Separate Fact boxes for Contact, Vendor, Customer, Bank Account and Employee
Contact List Separate Fact boxes for Contact, Vendor, Customer, Bank Account and Employee
Customer Card
Customer Ledger Entries
Customer List
Finance Charge Memo
Finance Charge Memo List
Finished Production Order Separate Fact boxes for Production Order, Production Order Lines and Item Documents
Finished Production Orders
Firm Planned Prod. Order Separate Fact boxes for Production Order, Production Order Lines and Item Documents
Firm Planned Prod. Orders
Fixed Asset Card
Fixed Asset G/L Journal
Fixed Asset List
General Journal
General Ledger Entries
Insurance Card
Insurance List
Issued Reminder List
Issued Finance Charge Memo
Issued Fin. Charge Memo List
Issued Reminder
Item Card
Item List
Job Card Separate Fact boxes for Jobs and Job Task Documents
Job G/L Journal
Job Ledger Entries
Job List
Lot No. Information Card
Lot No. Information List
Machine Center Card
Machine Center List
Payment Journal
Planned Production Order Separate Fact boxes for Production Order, Production Order Lines and Item Documents
Planned Production Orders
Posted Direct Transfer
Posted Direct Transfers
Posted Purchase Credit Memo
Posted Purchase Credit Memos
Posted Purchase Invoice
Posted Purchase Invoices
Posted Purchase Receipt
Posted Purchase Receipts
Posted Return Shipment
Posted Return Shipments
Posted Sales Credit Memo
Posted Sales Credit Memos
Posted Sales Invoice
Posted Sales Invoices
Posted Return Receipt
Posted Return Receipts
Posted Sales Shipment
Posted Sales Shipments
Posted Service Credit Memo
Posted Service Credit Memos
Posted Service Invoice
Posted Service Invoices
Posted Service Shipment
Posted Service Shipments
Posted Whse. Receipt
Posted Whse. Receipt List
Posted Whse. Shipment
Posted Whse. Shipment List
Prod. Order Components Separate Fact boxes for Production Order Components, Item and BOM Line Documents
Prod. Order Routing Separate Fact boxes for Production Order Routing, Machine Center / Work Center Documents and Routing Line Documents
Production BOM Separate Fact boxes for BOM and BOM Line Documents
Production BOM List
Production BOM Version
Purchase Journal
Purchase Order List
Purchase Return Order List
Blanket Purchase Order
Blanket Purchase Order Archive
Blanket Purch. Order Archives
Blanket Purchase Orders
Purchase Credit Memo
Purchase Credit Memos
Purchase Invoice
Purchase Invoices
Purchase List
Purchase List Archive
Purchase Order
Purchase Order Archive
Purchase Order Archives
Purchase Orders
Purchase Quote
Purchase Quote Archive
Purchase Quote Archives
Purchase Quotes
Purchase Return Order
Purchase Return Orders
Recurring General Journal
Released Production Order Separate Fact boxes for Production Order, Production Order Lines and Item Documents
Released Production Orders
Reminder
Reminder List
Requests to Approve
Resource Card
Resource List
Routing Separate Fact boxes for Routing and Routing Line Documents
Routing List
Routing Version
Blanket Sales Order
Blanket Sales Order Archive
Blanket Sales Order Archives
Blanket Sales Orders
Sales Credit Memo
Sales Credit Memos
Sales Invoice
Sales Invoice List
Sales Journal
Sales List
Sales List Archive
Sales Order
Sales Order Archive
Sales Order Archives
Sales Order List
Sales Orders
Sales Quote
Sales Quote Archive
Sales Quote Archives
Sales Quotes
Sales Return List Archive
Sales Return Order
Sales Return Order Archive
Sales Return Order List
Sales Return Orders
Serial No. Information Card
Serial No. Information List
Service Contract
Service Contract List
Service Contract Quote
Service Contract Quotes
Service Contracts
Service Credit Memo
Service Credit Memos
Service Invoice
Service Invoices
Service Item Card
Service Item List
Service Items
Service Order
Service Order Archive
Service Order Archives
Service Orders
Service Quote
Service Quote Archive
Service Quote Archives
Service Quotes
Simulated Production Order Separate Fact boxes for Production Order, Production Order Lines and Item Documents
Simulated Production Orders
Transfer Order
Transfer Orders
User Task Card
User Task List
VAT Entries
Vendor Card
Vendor Ledger Entries
Vendor List
Warehouse Receipt
Warehouse Receipts
Warehouse Shipment
Warehouse Shipment List
Work Center Card
Work Center List

  1. Microsoft, Microsoft Dynamics, and Microsoft Dynamics 365 are trademarks of the Microsoft group of companies.