Skip to main content

Notifications

Business Central forum

Adding new BLOB field and accessing it in Report

Posted on by 60

Hi experts,

I have added a new BLOB field using Table Extension and added the field in page using Page Extension. But the field displays as read only.

4628.Capture1.PNG

I would like to display it like a BLOB field present in Sales Order page.

2210.Capture.PNG

I assume I need to add some additional code to handle BLOB fields in Table extension and Page Extension. But couldn't find any step by step documentation or sample code to give me a clue.

Also if you could guide me on steps I need to take to add the BLOB field to a report dataset, that would be helpful.

Is there any other place to look for help or sample code, other than Official Dynamics Business Central documentation which seems to cover very basic coding examples and syntax's. I am starting my MS journey with Business Central.

Thanks,

Amar

Categories:
  • Amar Deep Profile Picture
    Amar Deep 60 on at
    RE: Adding new BLOB field and accessing it in Report

    Thank you guys for your support. Amar

  • Verified answer
    Divesh Profile Picture
    Divesh 327 on at
    RE: Adding new BLOB field and accessing it in Report

    Hi Amar,

    Sorry was away from system when i was replying to you, so i couldn't describe it fully as done by Nissay Halas Tia.

    Try the below steps:

    Create a Group - "Work Description" and under that Add the WorkDescription Variable and set the following properties.

    1. ShowCaption = false

    2. MultiLine = true // This will increase the height as in the Sales Order Page

    Note: You can still view the existing code from C/Side if you have installed the BC via Docker with includeCSide switch.

  • Amar Deep Profile Picture
    Amar Deep 60 on at
    RE: Adding new BLOB field and accessing it in Report

    Thank you guys for your reply. I was aware of GetWorkDescription, SetWorkDescription, CREATEINSTREAM and CREATEOUTSTREAM. What I didnt know was how and where to use them.

    So thanks for the main clue that The Work Description you see in the Sales Order Page is not a BLOB but a variable of type text declared as a global variable.

    Now I am able to display this global variable as a normal text field, but not able to adjust it's RowSpan. When I check the documentation (link), it says RowSpan not supported in BC web client, so I am not sure how to increase the height of the work description field. Any suggestions please...

    I want to display the work description field just like its displayed in Sales Order

    7144.Capture.PNG

    Many thanks,

    Amar

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Adding new BLOB field and accessing it in Report

    Hi Amar,

    You cannot read text that is stored in BLOBs in a page directly and you cannot also write text directly in a BLOB field. This can be made only by creating input and output streams (with CREATEINSTREAM and CREATEOUTSTREAM functions).

    The Work Description you see in the Sales Order Page is not a BLOB but a variable of type text declared as a global variable (behind there is the function GetWorkDescription that reads text from the Work Description BLOB field of the Sales Header table and assign the text value to the the global text variable WorkDescription that you see in the Sales Order page layout).  

    The field of type BLOB is always read only and empty in a page (you can not view BLOB fields data directly in page).

    Note: You cannot view the code of the GetWorkDescription & SetWorkDescription functions of the Sales Header table. In AL, you cannot view the function implementation of native objects (you can only view its signature).

    .

    Please verify my answer if you find my answer helpful. Doing so you'll show other community members that there was found a solution and you credit my help.

    .

  • Suggested answer
    Divesh Profile Picture
    Divesh 327 on at
    RE: Adding new BLOB field and accessing it in Report

    Hi

    You can check the existing code in the Sales Order / Sales Invoice Page on how MS has handled the "Work Description" blob field. I think there are two functions in the Sales Header table GetWorkDescription & SetWorkDescription, which you can check

    on how it's implemented. Let me know if you need more details.

    Thanks

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans