Tables
The Microsoft Dynamics 365 Business Central server only exposes tables configured as Web Services in your account. It uses the Microsoft Dynamics 365 Business Central Odata services to dynamically obtain and display the list of tables when you connect. You can display additional tables. See the following section for instructions on how to add them.
Displaying Additional Tables
To display tables (endpoints) other than those the Microsoft Dynamics 365 Business Central server has displayed, you must configure the tables you want as a Web Service from your account. The server then detects the exposed endpoints and displays them.
To do this, follow these steps:
- Log in to your Dynamics 365 Business Central account.
- Navigate to Web Services and click New.
- Under Object Type, select Page or Query. The Codeunit option is available in Dynamics 365 Business Central version 16.3 or later.
- Use the Object ID dropdown and choose Select from full list.
- Select the tables to display from the Object Name column.
- Specify the Service Name to define how the service is displayed.
- Select the Published check box and wait until the OData V4 URL field is populated.
- Inspect the upper right corner of the page to make sure the changes are saved.
- Repeat this procedure for any other tables (configured as Web Services) that you want to add.
Filtering with AL Enum objects
Some Business Central API pages, including most API v2.0 pages, have fields based on AL Enum objects.
Fields based on AL Enum objects must have names that are consistent and stay the same so that filters on the report always work no matter the language or OS you are using. For this reason, the fields based on AL Enums are not translated and Business Central API requires them to be encoded to avoid any special characters.
To filter with an enum value, you must encode the value by refering to https://www.w3.org/Style/XSL/TestSuite/results/4/XEP/symbol.pdf documentation and adding _(underscore) before and after the symbol.
For example, a space is "_x0020_", so the following code snippet will work.
SELECT * FROM DimensionSetLines WHERE parentid={id} and parentType='Sales_x0020_Order'
Tip: To check whether a field is an enum object, refer to the IsEnumeration column of the sys_tablecolumns table.
API Limitation
Be aware that INSERT statements on the SalesInvoiceLines table only work when the status of the sales invoice is 'DRAFT'. If the status is 'PAID' or 'OPEN' the INSERT statement does not complete successfully. This is an API limitation.