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

Dimension Value From Sales invoice Line

(0) ShareShare
ReportReport
Posted on by 50

Hi All,

 I am doing Aging report for that report i had a column named Project name  it is the dimension value from shortcut dimension 4, if the customer ledger entries source code field is set to sales then i want project name from the salesinvoice line. i am writing my code from onaftergetrecord of customer ledger entry but it is not coming, correctly can anyone help me.

 if CustLedgEntryEndingDate."Source Code" = 'Sales' then begin

                            GLSetup.Get();

                            DeimensionSetEntry.Reset();

                            DeimensionSetEntry.SetRange("Dimension Code", GLSetup."Shortcut Dimension 4 Code");

                            DeimensionSetEntry.SetRange("Dimension Set ID", SalesInvLine."Dimension Set ID");

                            if DeimensionSetEntry.FindFirst() then

                                Var_JobNo := DeimensionSetEntry."Dimension Value Code";

                            DimensionValue.Reset();

                            DimensionValue.SetRange(code, Var_JobNo);

                            if DimensionValue.FindFirst() then

                                Var_JobNo := DimensionValue.Name;

                        end;

Thanks & Regards,

Satish.

  • Suggested answer
    Gianfranco C. Profile Picture
    374 on at

    hi, try this code:

        procedure GetDimValueName(var  DimValueName: Text[50]) 
        var
            CustLedgEntryEndingDate: Record "Cust. Ledger Entry";
            GLSetup: Record "General Ledger Setup";
            DimensionSetEntry: Record "Dimension Set Entry";
            SalesInvLine: Record "Sales Invoice Line";
            DimensionValue: Record "Dimension Value";
            DimValueCode: Code[20];
           
        begin
            if CustLedgEntryEndingDate."Source Code" = 'Sales' then begin
    
                GLSetup.Get();
    
                DimensionSetEntry.Reset();
                DimensionSetEntry.SetRange("Dimension Code", GLSetup."Shortcut Dimension 4 Code");
                DimensionSetEntry.SetRange("Dimension Set ID", SalesInvLine."Dimension Set ID");
                if DimensionSetEntry.FindFirst() then begin
                    DimValueCode := DimensionSetEntry."Dimension Value Code";
    
                    if DimensionValue.get(GLSetup."Shortcut Dimension 4 Code", DimValueCode) then
                        DimValueName := DimensionValue.Name;
                end;
            end;
        end;

    Don't forget to help the community by Verifying the answer and Like it if your question has been answered. It will let others know that the topic has verified answer.

    Thanks & Regards,
    Gian

  • Suggested answer
    YUN ZHU Profile Picture
    104,157 Super User 2026 Season 2 on at

    Hi, hope the following can give you some hints.

    Dimension Set Entries Overview

    https://learn.microsoft.com/en-us/dynamics365/business-central/design-details-dimension-set-entries-overview

    Thanks.

    ZHU

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 570 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 390 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 220 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans