web
You’re offline. This is a read only version of the page.
close
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...
Suggested Answer

51 Purchase Invoice, trying to print dimension values for each line in the grid

(0) ShareShare
ReportReport
Posted on by 76

Hello,

I'm just trying to find some example code in C/AL to print the dimension values for each line for Page 51 Purchase Invoice. I assume I have to use the Dimension Management codeunit to do this, but not sure how to print these values in a MESSAGE(). I can access the Shortcut dims 1 and 2 from the Record object, but I need to be able to get the other dimensions as well.

thanks

I have the same question (0)
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at

    Get the dimension set ID from the record, and the go to Dimension Set Entry table and retrieve the dimensions.

  • Moony253 Profile Picture
    76 on at

    Hi Teddy,

    thank you for the reply, is there any way you could provide example c/al code? I'm trying to iterate through each Purchase Line for Purchase Invoices and print each value for all dimensions per line.

    thank you so much

  • ManishS Profile Picture
    86 on at

    Where do you want to print the dimension ? A factbox or a report.

  • Moony253 Profile Picture
    76 on at

    Hello Manish,

    I added an action button to the Purchase Invoices Page and in that method I just want

    a MESSAGE method, so this isn't C/AL code but something like

    do

    {

    MESSAGE('print here')

    } while ()

    I am sorry, I don't have much experience in C/AL coding, but I know C#. I'm trying to get the line item dimensions for Purchase Line and iterate through all dimensions for all lines.

    thank you so much

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

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 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans