Add, Add by Dimension, Add by Filter, Add Related Entries, Analysis Views, BC18, Business Central, Change, Combinations, Completed, Correction, Correction Setup, Delete, Dimension, Dimension Corrections, Draft, Dynamics 365, Functional Tips, G/L Entries, G/L Register, General Ledger Entries, History, How To, Information, Modify, Posted General Journal, Reversing, Run, Schedule, Select Manually, Tip & Tricks, Trace, Undo, Updating, Validate, What's New

How can we Correct Dimension in Microsoft Dynamics 365 Business Central?

You can do correction by reversing the journal or creating a credit memo for the document, which will be time consuming and can attract to even more errors.

Now you can correct dimensions for general ledger (G/L) entries to ensure your financial reports is providing you with accurate insights. For G/L entries, you can now

  • change the dimension values
  • add new dimensions
  • remove wrong ones

You can also trace a history of the corrections that you have done and can undo corrections in case you had made a mistake in the corrections itself.

Before you continue let me remind you:

Although the Dimension Correction feature only updates general ledger entries, still it can be helpful in many cases with creating accurate financial reports.

You must decide when to use the corrections because when you perform correction, it will result in differences between the dimensions in finance and sub-ledgers. The earlier you decide on what corrections to use, the less manual corrections you’ll need to do in the future.

I am using BC18 Demo database.

 How to run the Dimension Correction

General Ledger Entries. You can change the dimensions for single or multiple entries just by selecting the entries.

G/L Register. You can change the dimension per batch posting. By using “From Entry No.”, “To Entry No.” as a filter for General Ledger Entries.

Posted General Journal. You can use “Document No.” and “Posting Date” as filters for General Ledger Entries.

Search for Dimension Corrections Page.

Draft Dimension Correction Screen:

Depending upon from where you Launched the Dimension Correction, it may come with pre-filled or as blank screen.

You have several options to work with dimensions:

  • You can Add New Dimensions
  • You can Remove existing Dimensions
  • You can Change the existing Dimensions

For Selecting Entries to which above changes applies you have different options to work with.

  • Add related entries. This requires at least 1 G/L Entry already to be selected, and then it adds all other G/L Entries with the same “Transaction No”.
  • Select Manually. You can manually select in the G/L Entries by just choosing them.
  • Add by Filter. Here you have all freedom of choice, how to filter your G/L Entries for the dimension corrections.
  • Add by Dimension. This can be useful if you want to change the dimension value Sales to Admin for all G/L entries. So, you find all G/L Entries with the Dimension Sales.

You can omit/remove selected entries, or change selection criteria for your entries to be applied with changes.

Updating Dimension Values

Above we create a Dimension Correction, the Status is initially DRAFT, it means the G/L Entries Dimension is NOT yet updated.

Once you are done in the Dimension change to move forward you have two option to go thru:

  • Click the Validate dimension change then click RUN.
  • Click RUN.

Validate change

This will check if it’s possible to make the dimension changes you specified.

  • Check Dimension Correction Setup.
  • Check Dimension Combinations.

Once the validation run successfully you can see it in the Validation status.

You can choose to run the job immediately or schedule in case you are operating on larger data set.

Next you can now use the Run action button. This will Apply changes to the General Ledger Entry Dimensions.

How to trace the correction

General Ledger Entries. You can see all the dimension corrections that you’ve done for the selected entries.

Search the Dimension Corrections. You can see all the Dimension corrections that you’ve done even the ongoing dimension corrections will be listed here.

Undo a Correction


In the dimension correction page just click the UNDO. This will be executed as a Job. The user will have to choose, how he wants to apply changes: running the job immediately or schedule it.

It is recommended to run the schedule if you are working with larger data set, to avoid the table locking during posting of other transactions.

Once the Job execution completes, you will see the status change to UNDO COMPLETED.

How to Update the Analysis Views

From the Dimension Correction page, you can also update you’re Analysis Views by clicking the Update Analysis Views button. This will be executed as a Job. You will have to choose, how you want to apply changes: running the job immediately or schedule it.

It is recommended to run the schedule if you are working with larger dataset, to avoid the table locking during posting of other transactions.

Hope you enjoyed the information. Will come with more similar information in my next posts. Till then keep exploring, learning and sharing your knowledge with others.

Remain safe, take care of your loved ones, put your mask, maintain safe distance and don’t forget to get vaccinated.

Corfu Navision 2016, Data, Development Tips, Dimension, Excel, Functional Tips, How To, Information, Tip & Tricks

How to attach additional 6 Shortcut Dimensions to Dimension Set when copy data to Journal from Excel

 

In my previous post I explained how we can copy data to-and-fro between Excel and Navision. Also we saw the limitation of additional 6 Shortcut Dimensions neither can be exported nor imported back.

Today we will see solution to this limitation, as it is required from several customers and we keep getting request for same. The same reader for whom I have posted my previous post have requested similar need.

If you missed my previous post you can find here : Copying data to-and-fro between Excel & Navision

Let us see how we can get this part working, yes it will require a small customization to get this working. Below I explain the steps we require to achieve this.

My example refers to Table 81 & Page 39. You can do same with other Journals too.

We will Add Custom Fields for these additional 6 Shortcut Dimensions.

 

ExcelToNavJnl-8

Add the Fields and write the above code to OnValidate trigger and set the Property accordingly for all of the 6 Shortcut Dimension Fields.

ExcelToNavJnl-9

Similarly add a piece of code to OnInsert trigger of the Table.

ExcelToNavJnl-10

Add our newly created Fields to Page too.

Now Let us check if it works as expected.

ExcelToNavJnl-11

 

Perform the operation as in previous post, this time add the newly created fields for Dimensions as shown in above screen.

If you missed my previous post you can find here : Copying data to-and-fro between Excel & Navision

Export and Import back by adding value to these additional Dimensions 1 &2 is Global 3-6 is my additional Shortcut Dimensions, 7-8 I have not included as not setup in my database.

After importing back check the Dimensions and you will find due to above customization my all the Shortcut Dimensions are attached to Dimension Set Entry.
ExcelToNavJnl-12

Yes we are done.

I will come up with more information in my upcoming posts. Till then keep exploring and Learning.

 

 

Corfu Navision 2016, Development Tips, Dimension, How To, Information, Instalation & Configuration, upgrade

Design Overview of Dimension handling in Navision 2016

Hold on,

Way of handling Dimension have changed from Navision 2009 not a new concept. Till now everyone is aware of this technical change, but still to keep handy reference today I decided to share the same with community, which can help for new comers in this industry.

Detailed technical insight into the concepts and principles that are used to redesign the dimension entry storing and posting feature in Microsoft Dynamics NAV 2016. Helpful when upgrading from earlier version to 2009.

Dimension Sets

A dimension set is a unique combination of dimension values. It is stored as dimension set entries in the database. Each dimension set entry represents a single dimension value.

The dimension set is identified by a common dimension set ID that is assigned to each dimension set entry that belongs to the dimension set.

Dimension Set Entries

Dimension sets are stored in the Dimension Set Entry table as dimension set entries with the same dimension set ID.

When you add, edit and close the Edit Dimension Set Entries window, a check is performed to see whether the combination of dimension values exists as a dimension set in the table.

If the combination occurs in the table, then the corresponding dimension set ID is assigned to the journal line, document header, or document line.

Otherwise, a new dimension set is added to the table, and the new dimension set ID is assigned to the journal line, document header, or document line.
Performance Improvement
By storing dimension sets once in the database, database space is preserved, and overall performance is improved.

Searching for Dimension Combinations

Building Search Tree
Table 481 Dimension Set Tree Node is used when Microsoft Dynamics NAV evaluates whether a set of dimensions already exists in table 480 Dimension Set Entry table.

The evaluation is performed by recursively traversing the search tree starting at the top level numbered 0.

The top level 0 represents a dimension set with no dimension set entries. The children of this dimension set represent dimension sets with only one dimension set entry.

The children of these dimension sets represent dimension sets with two children, and so on.

Finding Dimension Set ID

At a conceptual level, Parent ID, Dimension, and Dimension Value, in the search tree, are combined and used as the primary key because Microsoft Dynamics NAV traverses the tree in the same order as the dimension entries.

The GET function (record) is used to search for dimension set ID.

DimSet.”Parent ID” := 0;  // ‘root’

IF UserDim.FINDSET THEN

REPEAT

DimSet.GET(DimSet.”Parent ID”,UserDim.DimCode,UserDim.DimValueCode);

UNTIL UserDim.NEXT = 0;

EXIT(DimSet.ID);

However, to preserve the ability of Microsoft Dynamics NAV to rename a dimension and dimension value, table 348 Dimension Value is extended with an integer field of Dimension Value ID.

This table converts the field pair Dimension and Dimension Value to an integer value.

When you rename the dimension and dimension value, the integer value is not changed.

DimSet.”Parent ID” := 0;  // ‘root’IF UserDim.FINDSET THEN  REPEAT      DimSet.GET(DimSet.ParentID,UserDim.”Dimension Value ID”);  UNTIL UserDim.NEXT = 0;EXIT(DimSet.ID);

Table Structure

New Tables

Three new tables have been designed to manage dimension set entries.

Table 480 Dimension Set Entry
Table 480 Dimension Set Entry is a new table. You cannot change this table. After data has been written to the table, you cannot delete or edit it.

Deleting data requires that you check against all occurrences of the dimension set ID in the entire database, including partner solutions.

Field No. Field Name Data Type Comment
1 ID Integer >0.0 is reserved for the empty dimension set. References field 3 in table 481.
2 Dimension Code Code 20 Table relation to table 348.
3 Dimension Value Code Code 20 Table relation to table 349.
4 Dimension Value ID Integer References field 12 in table 349. It is the secondary key that is used when traversing table 481.
5 Dimension Name Text 30 CalcField. Lookup to table 348.
6 Dimension Value Name Text 30 CalcField. Lookup to table 349.

Table 481 Dimension Set Tree Node

Table 481 Dimension Set Tree Node is a new table. You cannot change this table.

It is used to search for a dimension set. If the dimension set is not found, a new set is created.

Field No. Field Name Data Type Comment
1 Parent Dimension Set ID Integer 0 for top level node.
2 Dimension Value ID Integer Table relation to field 12 in table 349.
3 Dimension Set ID Integer AutoIncrement. Used in field 1 in table 480.
4 In Use Boolean False if not in use.

Table 482 Reclas. Dimension Set Buffer
Table 482 Reclas. Dimension Set Buffer is a new table.

The table is used to edit a dimension set ID.

It is required when you edit a dimension value code and a new dimension value code, for example, in the Item Reclas. Journal table.

Field No. Field Name Data Type Comment
1 Dimension Code Code 20 Table relation to table 348.
2 Dimension Value Code Code 20 Table relation to table 349.
3 Dimension Value ID Integer References field 12 in table 349.
4 New Dimension Value Code Code 20 Table relation to table 349.
5 New Dimension Value ID Integer References field 12 in table 349.
6 Dimension Name Text 30 CalcField. Lookup to table 348.
7 Dimension Value Name Text 30 CalcField. Lookup to table 349.
8 New Dimension Value Name Text 30 CalcField. Lookup to table 349.

Modified Tables
All transaction and budget tables have been modified to manage dimension set entries.

Changes to Transaction and Budget Tables
A new field has been added to all transaction and budget tables.

Field No. Field Name Data Type Comment
480 Dimension Set ID Integer References field 1 in table 480.

Changes to Table 83 Item Journal Line
Two new fields have been added to table 83 Item Journal Line.

Field No. Field Name Data Type Comment
480 Dimension Set ID Integer References field 1 in table 480.
481 New Dimension Set ID Integer References field 1 in table 480.

Changes to Table 349 Dimension Value
A new field has been added to table 349 Dimension Value.

Field No. Field Name Data Type Comment
12 Dimension Value ID Integer AutoIncrement. Used for references in table 480 and table 481.

Tables That Get New Field 480 Dimension Set ID
A new field, 480 Dimension Set ID, has been added to the following tables.

For the tables that store posted data, the field only provides a non-editable display of dimensions, which is marked as Drill-down.

For the tables that store working documents, the field is editable. The buffer tables that are used internally do not need editable or non-editable capabilities.

The 480 field is non-editable in the following tables

Table No. Table Name
17 G/L Entry
21 Cust. Ledger Entry
25 Vendor Ledger Entry
32 Item Ledger Entry
110 Sales Shipment Header
111 Sales Shipment Line
112 Sales Invoice Header
113 Sales Invoice Line
114 Sales Cr.Memo Header
115 Sales Cr.Memo Line
120 Purch. Rcpt. Header
121 Purch. Rcpt. Line
122 Purch. Inv. Header
123 Purch. Inv. Line
124 Purch. Cr. Memo Hdr.
125 Purch. Cr. Memo Line
169 Job Ledger Entry
203 Res. Ledger Entry
271 Bank Account Ledger Entry
281 Phys. Inventory Ledger Entry
297 Issued Reminder Header
304 Issued Fin. Charge Memo Header
5107 Sales Header Archive
5108 Sales Line Archive
5109 Purchase Header Archive
5110 Purchase Line Archive
5601 FA Ledger Entry
5625 Maintenance Ledger Entry
5629 Ins. Coverage Ledger Entry
5744 Transfer Shipment Header
5745 Transfer Shipment Line
5746 Transfer Receipt Header
5747 Transfer Receipt Line
5802 Value Entry
5832 Capacity Ledger Entry
5907 Service Ledger Entry
5908 Service Header
5933 Service Order Posting Buffer
5970 Filed Service Contract Header
5990 Service Shipment Header
5991 Service Shipment Line
5992 Service Invoice Header
5993 Service Invoice Line
5994 Service Cr. Memo Header
5995 Service Cr. Memo Line
6650 Return Shipment Header
6651 Return Shipment Line
6660 Return Receipt Header
6661 Return Receipt Line

The 480 field is editable in the following tables

Table No. Table Name
36 Sales Header
37 Sales Line
38 Purchase Header
39 Purchase Line
81 Gen. Journal Line
83 Item Journal Line
89 BOM Journal Line
96 G/L Budget Entry
207 Res. Journal Line
210 Job Journal Line
221 Gen. Jnl. Allocation
246 Requisition Line
295 Reminder Header
302 Finance Charge Memo Header
5405 Production Order
5406 Prod. Order Line
5407 Prod. Order Component
5615 FA Allocation
5621 FA Journal Line
5635 Insurance Journal Line
5740 Transfer Header
5741 Transfer Line
5900 Service Header
5901 Service Item Line
5902 Service Line
5965 Service Contract Header
5997 Standard Service Line
7134 Item Budget Entry
99000829 Planning Component

The 480 field has been added to the following buffer tables.

Table No. Table Name
49 Invoice Post. Buffer
212 Job Posting Buffer
372 Payment Buffer
382 CV Ledger Entry Buffer
461 Prepayment Inv. Line Buffer
5637 FA G/L Posting Buffer
7136 Item Budget Buffer

Codeunit 408 Dimension Management
Codeunit 408 Dimension Management is a function library that handles common tasks that are related to dimensions, such as copying from one table to another or from one document to another.

Many functions are deleted because there is no need for copying between dimension tables at the other hand many functions are modified.

Modified Functions

Function Name Modification Description
CheckDimSetIDComb New function that substitutes the other check functions and takes a Dimension Set ID as an argument instead of a dimension table.
CheckDimSetIDComb

CheckDocDimComb

CheckServContractDimComb

CheckDimBuffer

CheckDimComb

CheckDimValueComb

Delete. All usage should be changed to CheckDimSetIDComb.
GetDefaultDim Modify to return an integer Dimension Set ID instead of a set of records.
CopyJnlLineDimToICJnlDim

CopyICJnlDimToJnlLineDim

CopyDocDimtoICDocDim

CopyICDocDimtoICDocDim

Modify to work with DimSetID -> ICJnlLineDim

Deleted Functions

Functions that are deleted from codeunit 408 in connection with the Dimension Set Entries feature are listed below.

During the upgrade of application code from Microsoft Dynamics NAV 2009 or earlier versions to Microsoft Dynamics NAV 2016, the following functions are not available in Microsoft Dynamics NAV 2016.

If you have customizations that use one or more of the functions, you must upgrade that code accordingly.

InsertJnlLineDim

UpdateJnlLineDefaultDim

GetJnlLineDefaultDim

GetPreviousDocDefaultDim

GetPreviousProdDocDefaultDim

InsertDocDim

UpdateDocDefaultDim

ExtractDocDefaultDim

InsertProdDocDim

UpdateProdDocDefaultDim

InsertServContractDim

UpdateServcontractDim

UpdateDefaultDimNewDimValue

GetDocDim

GetProdDocDim

TypeToTableID1

TypeToTableID2

TypeToTableID3

TypeToTableID4

TypeToTableID5

DeleteJnlLineDim

DeleteDocDim

DeletePostedDocDim

DeleteProdDocDim

DeleteServContractDim

ShowJnlLineDim

SaveJnlLineDim

ShowJnlLineNewDim

SaveJnlLineNewDim

ShowDocDim

SaveDocDim

ShowProdDocDim

SaveProdDocDim

ShowTempDim

SaveTempDim

ShowTempNewDim

SaveTempNewDim

SaveServContractDim

MoveJnlLineDimToLedgEntryDim

MoveDocDimToPostedDocDim

MoveOneDocDimToPostedDocDim

MoveLedgEntryDimToJnlLineDim

MoveDimBufToJnlLineDim

MoveDimBufToLedgEntryDim

MoveDimBufToPostedDocDim

MoveDimBufToGLBudgetDim

CopyJnlLineDimToJnlLineDim

CopyLedgEntryDimToJnlLineDim

CopyDocDimToDocDim

CopyPostedDocDimToPostedDocDim

CopyDocDimToJnlLineDim

CopyDimBufToJnlLineDim

CopyDimBufToDocDim

CopySCDimToDocDim

MoveDocDimToLedgEntryDim

MoveDocDimToDocDim

MoveDocDimArchvToDocDim

MoveLedgEntryDimToDocDim

MoveProdDocDimToProdDocDim

MoveJnlLineDimToProdDocDim

MoveJnlLineDimToDocDim

MoveJnlLineDimToJnlLineDim

CopyLedgEntryDimToLedgEntryDim

MoveTempFromDimToTempToDim

TransferTempToDimToDocDim

MoveJnlLineDimToBuf

CopyICJnlDimToICJnlDim

TestDimValue

TestNewDimValue

MoveDimBufToItemBudgetDim. (Delete because the ItemBudgetDim Table is deleted.

GetServContractDim

MoveTempDimToBuf

UpdateSCInvLineDim

CopyJnlLineDimToBuffer

UpdateDocDefaultDim2

Code Examples of Changed Patterns in Modifications

Posting a Journal Line

Key changes are listed as follows:

  • Journal line dimension tables are removed.
  • A dimension set ID is created in the Dimension Set ID field.

Old Code

ResJnlLine.”Qty. per Unit of Measure” :=  SalesLine.”Qty. per Unit of Measure”;

TempJnlLineDim.DELETEALL;

TempDocDim.RESET;

TempDocDim.SETRANGE( “Table ID”,DATABASE::”Sales Line”);

TempDocDim.SETRANGE( “Line No.”,SalesLine.”Line No.”);

DimMgt.CopyDocDimToJnlLineDim( TempDocDim,TempJnlLineDim);

ResJnlPostLine.RunWithCheck( ResJnlLine,TempJnlLineDim);

New Code

ResJnlLine.”Qty. per Unit of Measure” := SalesLine.”Qty. per Unit of Measure”;

ResJnlLine.”Dimension Set ID” := SalesLine.” Dimension Set ID “;

ResJnlPostLine.Run(ResJnlLine);
Posting a Document
When you post a document in Microsoft Dynamics NAV 2016, you no longer have to copy the document dimensions.

Old Code

DimMgt.MoveOneDocDimToPostedDocDim(

TempDocDim,DATABASE::”Sales Line”,

“Document Type”,

“No.”,

SalesShptLine.”Line No.”,

DATABASE::”Sales Shipment Line”,

SalesShptHeader.”No.”);

New Code

SalesShptLine.”Dimension Set ID”  := SalesLine.”Dimension Set ID”
Editing Dimensions from a Document
You can edit dimensions from a document. For example, you can edit a sales order line.

Old Code

Table 37, function ShowDimensions:

TESTFIELD(“Document No.”);

TESTFIELD(“Line No.”);

DocDim.SETRANGE(“Table ID”,DATABASE::”Sales Line”);

DocDim.SETRANGE(“Document Type”,”Document Type”);

DocDim.SETRANGE(“Document No.”,”Document No.”);

DocDim.SETRANGE(“Line No.”,”Line No.”);

DocDimensions.SETTABLEVIEW(DocDim);

DocDimensions.RUNMODAL;

New Code

Table 37, function ShowDimensions:

“Dimension ID” := DimSetEntry.EditDimensionSet( “Dimension ID”);
Showing Dimensions from Posted Entries
You can show dimensions from posted entries, such as sales shipment lines.

Old Code

Table 111, function ShowDimensions:

TESTFIELD(“No.”);

TESTFIELD(“Line No.”);

PostedDocDim.SETRANGE(“Table ID”,DATABASE::”Sales Shipment Line”);

PostedDocDim.SETRANGE(“Document No.”,”Document No.”);

PostedDocDim.SETRANGE(“Line No.”,”Line No.”);

PostedDocDimensions.SETTABLEVIEW(PostedDocDim);

PostedDocDimensions.RUNMODAL;

New Code

Table 111, function ShowDimensions:

DimSetEntry.ShowDimensionSet(“Dimension ID”);
Getting Default Dimensions for a Document
You can get default dimensions for a document, such as a sales order line.

Old Code

Table 37, function CreateDim()

SourceCodeSetup.GET;

TableID[1] := Type1;

No[1] := No1;

TableID[2] := Type2;

No[2] := No2;

TableID[3] := Type3;

No[3] := No3;

“Shortcut Dimension 1 Code” := ”;

“Shortcut Dimension 2 Code” := ”;

DimMgt.GetPreviousDocDefaultDim( DATABASE::”Sales Header”,”Document Type”,

“Document No.”,0, DATABASE::Customer, “Shortcut Dimension 1 Code”,

“Shortcut Dimension 2 Code”);

DimMgt.GetDefaultDim(TableID,No,SourceCodeSetup.Sales,

“Shortcut Dimension 1 Code”, “Shortcut Dimension 2 Code”);

IF “Line No.” <> 0 THEN

DimMgt.UpdateDocDefaultDim( DATABASE::”Sales Line”,”Document Type”,

“Document No.”,”Line No.”, “Shortcut Dimension 1 Code”, “Shortcut Dimension 2 Code”);

New Code

Table 37, function CreateDim()

SourceCodeSetup.GET;

TableID[1] := Type1;

No[1] := No1;

TableID[2] := Type2;

No[2] := No2;

TableID[3] := Type3;

No[3] := No3;

“Shortcut Dimension 1 Code” := ”;

“Shortcut Dimension 2 Code” := ”;

GetSalesHeader;

“Dimension ID” :=  DimMgt.GetDefaultDimID(

TableID,No,SourceCodeSetup.Sales, “Shortcut Dimension 1 Code”,

“Shortcut Dimension 2 Code”, SalesHeader.”Dimension ID”, DATABASE::”Sales Header”);

Development Tips

Filtering on Dimension Values

Microsoft Dynamics NAV supports unlimited dimensions and unlimited dimension values. You can create as many as you want, and you can use those all across the application.

However two of these dimensions have got special treatment by setting them up them as global dimensions.

Why special? Answer could be because the global dimensions values are stored directly on the records they belong to. All other dimension values are stored in a separate table.

This means that you can filter on these two dimensions. In many places in the standard application, these Global Dimension are used on Filter fields that can be used to filter FlowFields.

However, to get any data on any of the other dimensions, you would have to rely on Analysis Views to retrieve the information.

In Microsoft Dynamics NAV 2013 onwards version, the dimensions functionality has been heavily redesigned.

Instead of storing all individual dimension values for each record in separate tables, each unique combination of dimensions and values gets an ID, and this dimension set ID is stored directly on the record that those values belong to.

With this change, all information about dimensions and their values are directly stored on the record.

Since all the required information is stored on the record, though somewhat indirectly, it will now be possible to filter on any dimension and any dimension value. As it turns out, it is, and it’s not that hard to do.

As mentioned, the records contain dimension set IDs, which are integers that represent the combination of dimension values for a specific record. The biggest problem is to convert a typical filter on a dimension into a filter of dimension set IDs.

Fortunately, we already have a few functions in Microsoft Dynamics NAV that can provide that information. With these functions in mind, we can build a logic where you can input any combination of dimensions and dimension values in the form of filters, and you can then calculate the corresponding set of dimension set IDs. With all of these IDs, we can build one long filter string and use it to filter on the dimension set ID field. This enables, with relative ease, direct filtering on Dimension Values.

In Codeunit 408 – DimensionManagement we have functions which can help us getting our task done:

  • GetDimSetIDsForFilter

DimFilter-1

  • GetNextDimSetFilterChunk

DimFilter-2

In Codeunit 46 – SelectionFilterManagement we have functions which can help us getting our task done:

  • GetSelectionFilterForDimensionValue

DimFilter-3

Using these functions we can build our logic to retrieve the required records from tables filtering on Dim Set ID field.

Let’s see the pseudocode of logic to get our work done.

This logic applies to Dimension table. With all values for which filter need to be applied.
DimFilter-4

Before executing above piece of code we have to prepare a Dimension Value record with [Dimension Code + Code (filter)] values with all the required filters we wish to apply filter for.

We can also find out which records do not have a value for one or more dimensions, for this we will add [Dimension Code] but for [Code] we will not provide the value/filter or blank.

Make sure when you define variables of Dimension & Dimension Value don’t forget to set Temporary property to Yes.