web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Adding Demensions on Physical Inventory Journal

(0) ShareShare
ReportReport
Posted on by 666

Hi, 
On the Physical Inventory Journal the Dimensions per line is added with the "Calculate Inventory" action.  The only dimensions that are added are the default dimensions from the item.  Our client requested the location code dimensions be added to the dimensions of Physical Inventory Journal lines. The problem is that we need to recreate the dimension set ID for each location code and item combination. 

How can I check the if there is a location and Item combination on the "Dimension Set Entry" table if it exists assign the Dimesion Set ID to the Physical Inventory Journal Line if it does not create a new Dimensions Set ID. I was thinking of doing this after the Item Journal Line is created. 

Many thanks

  • Jun Wang Profile Picture
    8,220 Moderator on at

    I see there is no Dimension for a location for NAV 2018 and doubt BC has it. Do you know why the client is requesting it?

  • Hein Kruger Profile Picture
    666 on at

    Hi Appliwin, 
    There are a lot of changes in BC from NAV 2018. Dimesions on the Lcoation Card is one of them. See the picture attached for standard BC21. 

  • Jun Wang Profile Picture
    8,220 Moderator on at

    good to know this! then you might consider testing by creating SKU which I'm hoping could help.

    since a SKU is related to both the item and location. Try set up default dimension on item card, also set up dimension on location, create a SKU and check if both dimensions flows to the SKU.

  • Suggested answer
    Hein Kruger Profile Picture
    666 on at

    Here is my solution. 
    The Solution was made simple by the procedure (GetDimensionSetID) in the codeunit Dimension Management. This Procedure handles generating a new Dimension Set ID as well has checking if the combination of Dimension Set Entries already exist. 
    All we needed to do was to add the Dimensions we wanted in a temporary Dimension Set Entry and send the Temporary Dimension Set Entry to the (GetDimensionSetID) AFTER the Item Jnl Line has been created. 

    Take Note: The relationship between the values and the combination are one-to-one. If your Item has a dimension AREA and your location also has a Dimension AREA the insert will error. 

    local procedure OnAfterFunctionInsertItemJnlLine(var ItemJournalLine: Record "Item Journal Line")
        var
            TempDimensionSetEntry: Record "Dimension Set Entry" temporary;
            DimesionManagement: Codeunit DimensionManagement;
            DefaultDimension: Record "Default Dimension";
            DimensionValue: Record "Dimension Value";
            RecRef: RecordRef;
            Location: Record Location;
            Item: Record Item;
        begin
            If Item.Get(ItemJournalLine."Item No.") then begin
                DefaultDimension.Reset();
                DefaultDimension.SetRange("Table ID", Database::Item);
                DefaultDimension.SetRange("No.", Item."No.");
                if DefaultDimension.FindSet() then
                    repeat
                        DimensionValue.Get(DefaultDimension."Dimension Code", DefaultDimension."Dimension Value Code");
                        TempDimensionSetEntry.Init();
                        TempDimensionSetEntry.Validate("Dimension Code", DefaultDimension."Dimension Code");
                        TempDimensionSetEntry.Validate("Dimension Value Code", DefaultDimension."Dimension Value Code");
                        TempDimensionSetEntry."Dimension Value ID" := DimensionValue."Dimension Value ID";
                        TempDimensionSetEntry.Insert();
                    until DefaultDimension.Next() = 0;
            end;
            if Location.Get(ItemJournalLine."Location Code") then begin
                DefaultDimension.Reset();
                DefaultDimension.SetRange("Table ID", Database::Location);
                DefaultDimension.SetRange("No.", Location.Code);
                if DefaultDimension.FindSet() then
                    repeat
                        DimensionValue.Get(DefaultDimension."Dimension Code", DefaultDimension."Dimension Value Code");
                        TempDimensionSetEntry.Init();
                        TempDimensionSetEntry.Validate("Dimension Code", DefaultDimension."Dimension Code");
                        TempDimensionSetEntry.Validate("Dimension Value Code", DefaultDimension."Dimension Value Code");
                        TempDimensionSetEntry."Dimension Value ID" := DimensionValue."Dimension Value ID";
                        if TempDimensionSetEntry.Insert() then;
                    until DefaultDimension.Next() = 0;
            end;
            ItemJournalLine."Dimension Set ID" := DimesionManagement.GetDimensionSetID(TempDimensionSetEntry);
            ItemJournalLine.Modify();
        end;

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 711 Super User 2026 Season 2

#2
Teagen Boll Profile Picture

Teagen Boll 377 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 367 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans