Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Create Dimension CreateDim() function changes - deprecated in V23

(1) ShareShare
ReportReport
Posted on by 18
Hi Experts!
 
I had this code and its going to be deprecated on V23 with a new variable List of List of [Dictionary of [Integer, Code[20]]] 
Any ideas how to replace the code :) ? Thanks in advance 
 
  • Verified answer
    ThathsaraH Profile Picture
    18 on at
    Create Dimension CreateDim() function changes - deprecated in V23
    Here I found a solution. Check all parameters of CreateDim() function. There is a pattern as Type1 - No1 , Type2 - No2 ... We can use this as the key and value.
     
     
    I added this pattern to the list of dictionary. Here I defined the DimSource List if Dictionary and DimDictionary.
    Then , used like this.
     
     
    Hope this will helpful.
    Thanks !
     
  • Suggested answer
    DAnny3211 Profile Picture
    9,274 Moderator on at
    Create Dimension CreateDim() function changes - deprecated in V23
    hi
     
    The error message you're seeing is because the CreateDim method of the Sales Line record expects an argument of type List of [Dictionary of [Integer, Code[20]]], which represents a list of dimensions. However, in your SetSetupAZTranslator procedure, you're calling salesline.CreateDim() without passing any argument.
    Here's a simplified example of how you might use the CreateDim method:
     
    procedure createDim()
    var
        SalesLine: Record "Sales Line";
        DimValueList: List of [Dictionary of [Integer, Code[20]]];
        DimValue: Dictionary of [Integer, Code[20]];
    begin
        // Initialize the DimValue dictionary
        DimValue := DimValue.Create(1, 'DIM001');
     
        // Add the DimValue dictionary to the DimValueList list
        DimValueList.Add(DimValue);
     
        // Call the CreateDim method with the DimValueList list
        SalesLine.CreateDim(DimValueList);
    end;
     
     

    In this example, a new dimension is created by initializing a Dictionary of [Integer, Code[20]] (which represents a single dimension with a dimension ID and a dimension value) and adding it to a List of [Dictionary of [Integer, Code[20]]] (which represents a list of dimensions). The CreateDim method is then called with this list of dimensions.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,886 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,766 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans