Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

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

Posted on by 70

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

  • Moony253 Profile Picture
    Moony253 70 on at
    RE: 51 Purchase Invoice, trying to print dimension values for each line in the grid

    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

  • ManishS Profile Picture
    ManishS 6,578 on at
    RE: 51 Purchase Invoice, trying to print dimension values for each line in the grid

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

  • Moony253 Profile Picture
    Moony253 70 on at
    RE: 51 Purchase Invoice, trying to print dimension values for each line in the grid

    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

  • Suggested answer
    TeddyH Profile Picture
    TeddyH 12,868 Super User 2024 Season 1 on at
    RE: 51 Purchase Invoice, trying to print dimension values for each line in the grid

    Get the dimension set ID from the record, and the go to Dimension Set Entry table and retrieve the 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans