Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

How to get a source expression from another table extension

Posted on by 479

I am trying to add a column from a custom field to my report extension. I created the custom field using a table and page extension.

More specifically, I made the two custom fields to extend the Company Information page, and I trying to add those fields as columns to a report extension that extends a Sales Invoice Report.

If you look at this screenshot below, you can see "SourceExpression" as a second parameter to the column function:

Screen-Shot-2022_2D00_05_2D00_16-at-9.48.30-AM.png

When I try adding the field name I want (the custom fields) for the SourceExpression, intellisense does not recognize it, and I get a problem saying that "the field does not exist in the current context".

How do I make the field available in the current context?

Thanks,
J

  • jdrco Profile Picture
    jdrco 479 on at
    RE: How to get a source expression from another table extension

    This works! Thank you for your help.

  • Verified answer
    Alok.kulshreshtha Profile Picture
    Alok.kulshreshtha 934 on at
    RE: How to get a source expression from another table extension

    Hi,

    Define Company information as a Global Variable in sales invoice Report extension, and than add fields from company information table as a column under in  header dataset.

    because we are defining companyinfo5 as a new variable than use a GET command to fetch record from database.

    dataset

       {

           // Add changes to dataitems and columns here

           add("Sales Invoice Header")

           {

             column(BankName;CompanyInfo5."Bank Name")

             {

             }

           }

           modify("Sales Invoice Header")

           {

               trigger OnBeforePreDataItem()

               begin

                  CompanyInfo5.get;

               end;

           }

       }

       var

       CompanyInfo5: Record "Company Information";

    Rereads,

    Alok

    Please verify if you find my answer helpful

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,570 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans