Skip to content

VSC Project

Prerequisites

  • a python installation on your computer
  • an up-to-date local git repository of the following projects
    • pwrp/product-dwh-bc
    • pwrp/py-bc
    • pwrp/py-azure
    • pwrp/py-db
  • a .venv for the following projects
    • pwrp/product-dwh-bc/af
    • pwrp/py-bc
    • pwrp/py-azure
    • pwrp/py-db
  • access to BC, specifically to the Dev Endpoint

Overview

  1. get code range

  2. identify and copy a recent project to the local git repository

  3. adjust the configuration in app.json

  4. adjust the configuration in vscode/launch.json

  5. adjust the queries in the al files

Get Code Range

Ask your client contact what code range you can use.

Background

BC has a concept of Objects (Pages, Queries, Reports, Codeunits, Table Extensions, and more).
Each object - both base objects as well as objects defined in extensions - has a code. For example, the Sales Invoice Header table has Object ID 112. Object IDs are unique within the object type and per environment (so e.g. there can be a Page and a Query with object id 50000). The most common

Copy Project

  1. identify a recent project

  2. copy the following folders:

    1. code/af
    2. code/sql
    3. code/al
  3. rename the workspace file (e.g. from kun.code-workspace to huy.code-workspace)

  4. rename the client-specific project names in the workspace file (af, sql, al)
    dwh-bc-vsc-project-names.png

Adjust the configuration in app.json

  1. id: assign a random id (use e.g. a guid generator from the web)

  2. name: adjust to the client

  3. version:

    1. first number: bc version
    2. last number: counting up from 1
  4. dependencies: add dependencies if you know them, else leave empty for now

  5. application: adjust to last major BC version (e.g. 26 below)

  6. if the client provided id ranges, use them. Else try. For on prem, you will probably need an assigned range. Ask the client!

dwh-bc-vsc-project-adjust-app.png

Adjust the configuration in vscode/launch.json

Cloud / SaaS

dwh-bc-vsc-project-launch.png

On Prem

dwh-bc-vsc-project-launch-on-prem.png

Test

Test if you can download the dependencies by running:

  1. Ctrl+Shift+P

  2. AL: Download Symbols

  3. select environment (for cloud: needs to be a sandbox)

  4. authenticate

dwh-bc-vsc-project-download-symbols.png

Adjust the Queries

Each *.al File corresponds to one query.

See bc-extension for ID ranges and naming conventions.

Commit

  1. commit to git

  2. push to github

Checklist

If everything works, you have the following:

  • A VSC workspace for the client
  • A client-specific al project
    • the ID Range is agreed with the client
    • the AL files follow our conventions (naming, code range, folders, etc.)