Skip to content

BC API

OData

Extensions

BC is extendable using AL. AL is developed and built in VSC.

For an example, see Finacc BC the financial_accelerator_bc VSC project: Setting up Business Central.

How to include a dependency in an extension

You can see this in action for example with #vdm.

Suppose you want to create an extension for vdm. Suppose that vdm uses
an extension called Van Damme that adds a custom field to the table.

You can see that using the Alt+Ctrl+F1 trick:

invoice-company.png

Note the following:

  1. we want to get the data from table 112, Sales Invoice Header
  2. the field has ID 50010, this is a hint that it's a table extension

  3. we can actually see that the field is from an extension called Van Damme

To use this field, we need to do the following:

  1. we need to create an extension specifically for this client

  2. we need to add the Van Damme extension as a dependency to our extension

  3. we need to connect to the development endpoint for that client and download the symbols

Once this is done, we can add the custom fields.

Create Extension

This is just like any extension.

Add Dependency

bc-add-dependency.png

Warning

If you are using a dependency that requires a license, or that itself depends on an extension that requires a license, then you can only use ObjectIDs that are in the range of the licensed package.

For example, Van Damme extension is only allowed to use ObjectIDs between

If you don't respect the licensed ObjectID range, you will get a failure saying that you don't have Execution rights on the respective queries:

You do not have the following permissions on Query ...: Execute.

To inspect dependencies:

  1. add the relevant environments to .vscode/launch.json

  2. run >AL: Download symbols

  3. click on the app in .alpackages

  4. inspect and search

bc-inspect-al.png

Download Symbols

To do that, you need to know the development endpoint. You configure it in launch.json:

bc-download-symbols.png
For BC Cloud clients, log in to office.com and go to BC
office-login.png
Then show sandbox environment

show-sandbox-environment.png

select-environment.png
in vscode update the launch.json with the environment name

launch-json-environment-name.png

Once configured, run >AL: Download Symbols.

You should then be able to add the custom field using e.g. AZ AL Tools:

bc-az-al-tools-add-fields.png
Some tables do not show fields when trying to add with AZ AL Tools, so we need to manually write them. For example Production Order Component table
production-order-eg.png
Columns in Business Central:

bc-columns.pngHow to write them in vscode:

manually-written-columns.png