> For the complete documentation index, see [llms.txt](https://docs.locoia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.locoia.com/connectors/connectors/microsoft-dynamics-365.md).

# Microsoft Dynamics 365

Microsoft Dynamics 365 Business Central

### Introduction

* There are [three ways to connect](https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/web-services) to web services: API, SOAP, and OData
* [OData overview video](https://www.youtube.com/watch?v=Iwh-AgJ4uF4)

{% hint style="info" %}
By default, Locoia's connector connects to the regular Microsoft Dynamics 365 Business Central **API**.
{% endhint %}

### Authentication

To authenticate, your users need to have the correct level of access. You may need to request an additional access level from your system admin.

### OData

To get to the OData settings, click on the search icon in the upper left corner and type `web services` and click on the `> Web Services` :

![Web Services](https://291121471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McrRFZHYH27bqKzOVDd%2Fuploads%2FJZCxXZeZfeQ8IVEQ9Bi4%2Fimage.png?alt=media\&token=b0fbf4f3-6d1c-464e-a8ed-e881a871cefb)

To get the Username and Password for the OData services, go to Users, select a user and get the key from `Web Service Access Key`. The Username corresponds to the user's name.

#### Adding a new an OData services

E.g. to add a new oData service for **Sales Line Item Discounts**,&#x20;

1. go to the corresponding view in Business Central
2. get the page id from the URL as per the image below
3. Go to the **web service view**
4. Click **New**
5. As **Object Type**, select page
6. Click in the **Object ID** field and then a window pops up
7. Select in the **bottom right** of the window **Select from full** **list,** and the window enlarges
8. In the newly enlarged window, click the **search icon**, type the page ID, e.g. 7004
9. The Sales Line Item Discounts show up. Select it
10. Give the service a **name** without spaces
11. Make the final selections and you are done

The page and its objects are now available as OData service.

![](https://291121471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McrRFZHYH27bqKzOVDd%2Fuploads%2FURNjJpDCQ2CvdNlKwUjp%2Fimage.png?alt=media\&token=72597ae3-3998-44e1-a0bb-c96ff2b47fde)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.locoia.com/connectors/connectors/microsoft-dynamics-365.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
