Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

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

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
    YUN ZHU 64,563 Super User 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
    RE: How to add field from custom table as a column to a report extension?

    You can vote my respinse?

  • jdrco Profile Picture
    jdrco 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);

  • 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
    jdrco 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"

  • 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
    jdrco 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
    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
    Alok.kulshreshtha 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
    jdrco 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?

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans