Business Central Command Line

Update Dimension Sets

Dimensions on transactional data are one of the more difficult areas of exporting and importing with Business Central.

A transaction has a Dimension Set ID field, this is just a number, like 567. 567 is then translated into a unique combination of dimension values, so it’s not actually 567, but:

  • DEPARTMENT = SALES
  • CUSTOMERGROUP = NORTH
  • REGION = WESTCOAST

BCCL gives you the option of using the dimension as normal columns, both for import and export.

You must use a mapping file, then select the Dimension Set ID field and add a Function, like this:

    {
      "FieldNo": 480,
      "FieldName": "Dimension Set ID",
      "MappedName": "Department",
      "Function": "DimensionFromSet(DEPARTMENT)",
      "Validate": true
    },
    {
      "FieldNo": 480,
      "FieldName": "Dimension Set ID",
      "MappedName": "Customer_Group",
      "Function": "DimensionFromSet(CUSTOMERGROUP)",
      "Validate": true
    },

The DimensionFromSet() function knows how dimension sets works, and will do all the gymnastics to handle the dimension behind the scene.

If you want to map 8 different dimensions, simply add eight fields to the mapping, all pointing to the same Dimension Set ID field (example above is from sales header, table 36) and specify the different dimensions you want.

With this method, BCCL can export transactions and import journals and documents, all fully loaded with all your dimensions.