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...
Answered

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

(1) ShareShare
ReportReport
Posted on by 479

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

  • Verified answer
    YUN ZHU Profile Picture
    82,745 Super User 2025 Season 1 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
    479 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
    479 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
    479 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
    479 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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 446 Super User 2025 Season 1

#2
Sagar Dangar, MCP Profile Picture

Sagar Dangar, MCP 347

#3
Mansi Soni Profile Picture

Mansi Soni 327

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans