Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

Can you reference a field from a page extension to fill it in a report extension?

Posted on by 30

Hello everyone.
I hope you can help me, what I want to do is grab a field from a page extension and put it in a report but when passing it it appears that they do not exist in that context

 I don't know if it can be done, thanks.

Captura-de-pantalla-2022_2D00_07_2D00_18-160034.pngCaptura-de-pantalla-2022_2D00_07_2D00_18-155540.png

Categories:
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 69,657 Super User 2024 Season 2 on at
    RE: Can you reference a field from a page extension to fill it in a report extension?

    Hi, Of course, I just put it in the same file for the convenience of screenshots.

    But if your two files do not exist in the same extension (app), you need to add the dependency property in app.json.

    More details: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-json-files#Appjson

    pastedimage1658262091381v1.png

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Vaishnavi J Profile Picture
    Vaishnavi J 3,056 on at
    RE: Can you reference a field from a page extension to fill it in a report extension?

    Hi Josue Morales 

    I tested the same thing in different objects but it does not seems a problem.

    pastedimage1658249311691v1.png

    pastedimage1658249325431v2.png

    Kindly close the VS code and reopen and then add the fields in the Report Extension or reload the window of VS code and proceed with your customization.

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

  • Josue Morales Profile Picture
    Josue Morales 30 on at
    RE: Can you reference a field from a page extension to fill it in a report extension?

    Thanks for the prompt response.
    Can it be done in different files?

    In a single file it does not give me problems, but it is an extension that is already published in business central and what I want to do is use it but in the report extension.

    Thanks.

    Attached images.

    5444.png8168.png

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 69,657 Super User 2024 Season 2 on at
    RE: Can you reference a field from a page extension to fill it in a report extension?

    Hi, I did the same test as you and it didn't seem to be a problem.

    pastedimage1658190051422v1.png

    pastedimage1658190068440v2.png

    Source code:

    tableextension 50100 MyExtension extends Vendor
    {
        fields
        {
            field(50000; "Comprador Zitro"; Boolean)
            {
                DataClassification = CustomerContent;
            }
        }
    }
    
    reportextension 50100 MyExtension2 extends "Purchase Document - Test"
    {
        dataset
        {
            addlast(PageCounter)
            {
                dataitem(Vendor1; Vendor)
                {
                    column(Comprador_Zitro; "Comprador Zitro")
                    { }
                }
            }
        }
    }

    Hope this helps.

    Thanks.

    ZHU

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…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans