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 get a source expression from another table extension

(0) ShareShare
ReportReport
Posted on by 481

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

I have the same question (0)
  • jdrco Profile Picture
    481 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
    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

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
Sohail Ahmed Profile Picture

Sohail Ahmed 2,689 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,631

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,212

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans