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

Notifications

Announcements

Community site session details

Community site session details

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

Query Shortcut Dimension 1,2 and 3 from G/L Entry

(0) ShareShare
ReportReport
Posted on by 45

Hi all,

I have created a Query object which looks into G/L Entry. I have 3 dimensions named

  • Project
  • Department
  • Company

I have set them in General Ledger setup as Global Dimension1, Global Dimension 2 and Shortcut dimension 3.

When i query, I cannot find Shortcut dimension in  G/L Entry. when i tried to join it with Dimension Set Entry, i get 3 separate rows.

Here is my Dataitem query.

dataitem(G_L_Entry; "G/L Entry")
{
    column(G_L_Account_No_; "G/L Account No.") { }
    column(G_L_Account_Name; "G/L Account Name") { }
    column(Amount; Amount) { }
    column(Posting_Date; "Posting Date") { }
    column(Document_No_; "Document No.") { }
    column(External_Document_No_; "External Document No.") { }
    column(Description; Description) { }
    dataitem(Project; "Dimension Set Entry")
    {
        DataItemLink = "Dimension Set ID" = G_L_Entry."Dimension Set ID";
        column(Dimension_Value_Code; "Dimension Value Code")
        {
        }
        dataitem(Project_Name; "Dimension Value")
        {
            DataItemLink = "Dimension Value ID" = Project."Dimension Value ID";
            column(DimName; Name) { }
        }
    }
}

and my output is:

{
    "G_L_Account_No_":"60510",
    "Amount":-100,
    "Posting_Date":"2020-06-30",
    "Document_No_":"GEN000032",
    "External_Document_No_":"12232",
    "Description":"Drug Substance GMP Manufacturing",
    "G_L_Account_Name":"Drug Substance GMP Manufacturing",
    "Dimension_Value_Code":"LAB1636",
    "DimName":"Lab1636","Name":"",
    "AuxiliaryIndex1":302,
    "AuxiliaryIndex2":7,
    "AuxiliaryIndex3":"COMPANY",
    "AuxiliaryIndex4":"COMPANY",
    "AuxiliaryIndex5":"LAB1636",
    "AuxiliaryIndex6":0,
    "AuxiliaryIndex7":"",
    "Document_Type_FilterOnly":null
},
{
    "G_L_Account_No_":"60510",
    "Amount":-100,
    "Posting_Date":"2020-06-30",
    "Document_No_":"GEN000032",
    "External_Document_No_":"12232",
    "Description":"Drug Substance GMP Manufacturing",
    "G_L_Account_Name":"Drug Substance GMP Manufacturing",
    "Dimension_Value_Code":"BIOLOGY",
    "DimName":"BIOLOGY",
    "Name":"",
    "AuxiliaryIndex1":302,
    "AuxiliaryIndex2":7,
    "AuxiliaryIndex3":"DEPARTMENT",
    "AuxiliaryIndex4":"DEPARTMENT",
    "AuxiliaryIndex5":"BIOLOGY",
    "AuxiliaryIndex6":0,
    "AuxiliaryIndex7":"",
    "Document_Type_FilterOnly":null
},
{
    "G_L_Account_No_":"60510",
    "Amount":-100,
    "Posting_Date":"2020-06-30",
    "Document_No_":"GEN000032",
    "External_Document_No_":"12232",
    "Description":"Drug Substance GMP Manufacturing",
    "G_L_Account_Name":"Drug Substance GMP Manufacturing",
    "Dimension_Value_Code":"LAB-001|GABA ASD",
    "DimName":"LAB-001 - GABA - Ginty",
    "AuxiliaryIndex1":302
    ,"AuxiliaryIndex2":7,
    "AuxiliaryIndex3":"PROJECT",
    "AuxiliaryIndex4":"PROJECT",
    "AuxiliaryIndex5":"LAB-001|GABA ASD",
    "AuxiliaryIndex6":0,
    "AuxiliaryIndex7":"",
    "Document_Type_FilterOnly":null
}

How can i get all relevant dimensions in same row instead of 3 rows as shown.

Regards

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

    Thanks.

  • mscalamogna Profile Picture
    80 on at

    This issue should be (partially) resolved in the most recent release of Business Central.

  • Suggested answer
    JAngle Profile Picture
    135 on at

    If you’re not on the latest version this is another option: www.olisterr.tech/.../exposing-dimension-and-dimension-values.html

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,651

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 808 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 718 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans