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

Community site session details

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

How to add field from custom table as a column to a report extension?

(1) ShareShare
ReportReport
Posted on by 481

I am trying to add a column on my report extension that is linked to a field from a custom table I made.

The custom table is called "Program"

Here is how I am trying to do it:

Screen-Shot-2022_2D00_05_2D00_18-at-9.09.06-AM.png

Screen-Shot-2022_2D00_05_2D00_18-at-9.10.23-AM.png

But I get this error:

The Program does not exist. Identification fields and values: Program Code='', ID=0.

This is the way I have been grabbing fields from default tables onto my report extension, so is there anything different I have to do since this time I am trying to access a field from a custom table?
How would I go about accomplishing this requirement?

Thanks,

J

I have the same question (0)
  • Verified answer
    YUN ZHU Profile Picture
    90,632 Super User 2025 Season 2 on at
    RE: How to add field from custom table as a column to a report extension?

    Hi, It looks like you have a problem with Get method. Please confirm the primary key in the ProgramCard, and whether the content of the primary key can be retrieved in the Report.

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Giambattista Malvasi  Profile Picture
    195 on at
    RE: How to add field from custom table as a column to a report extension?

    You can vote my respinse?

  • jdrco Profile Picture
    481 on at
    RE: How to add field from custom table as a column to a report extension?

    Thank you all. I was able to achieve what I wanted. I basically just added this under OnAfterAfterGetRecord():

    ProgramCard.get("Program Code", ID);

  • Giambattista Malvasi  Profile Picture
    195 on at
    RE: How to add field from custom table as a column to a report extension?

    Were is the connection from "Sales Invoice Header" to "program Card"?

  • jdrco Profile Picture
    481 on at
    RE: How to add field from custom table as a column to a report extension?

    It is a Record of "Sales Invoice Header"

  • Giambattista Malvasi  Profile Picture
    195 on at
    RE: How to add field from custom table as a column to a report extension?

    What is the Record of the DataItem "Header?"

  • jdrco Profile Picture
    481 on at
    RE: How to add field from custom table as a column to a report extension?

    How do I deal with using SetRange to target the field?

  • Verified answer
    Giambattista Malvasi  Profile Picture
    195 on at
    RE: How to add field from custom table as a column to a report extension?

    You can use trigger OnAfterAfterGetRecord()

  • Suggested answer
    Alok.kulshreshtha Profile Picture
    934 on at
    RE: How to add field from custom table as a column to a report extension?

    Hi,

    When i say , "Field I Want" in header, I am actually referring a  value in "Field I want".

    so the value in ProgramCard."Field i want" is exist in any column in header table? if yes than use that field in place of

    "Field I want" in ProgrameCard.get(Header."Field i want")

    Regards,

    Alok

    Please Verify my answer if you find my post helpful.

  • jdrco Profile Picture
    481 on at
    RE: How to add field from custom table as a column to a report extension?

    Thanks for this, unfortunately the requirement I have is a bit more abstract than what is explained in the docs.

    Is there a a site or service where I could get live on-call help regarding this AL implementation?

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,857

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,687 Super User 2025 Season 2

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,203

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans