web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Work Description-type field on Purchase Order email?

(1) ShareShare
ReportReport
Posted on by 184
I am trying to add a blob field on the PO Page and then include it in the PO Report so that the value can show on the email as text. I have taken the Work Description field from the Sales Quote & Sales Order tables/pages/reports as inspiration, copying and adjusting the files in the extension. However, when attempting to use the send email function, the output value is not in the correct format.
 
Any ideas?
 
Field on PO page
 
Field value output upon Send Email action, from the PO report
 
 
Code below
 
I have the same question (0)
  • Suggested answer
    Tonya Profile Picture
    16 on at
    Hi there! 
    You are definitely on the right path! 

    The first thing I want to address is why your code isn't working. When you tried to "output" the Work Description to the report, you gave your dataset the encoded blob. You need to utilize the code inside the GetWorkDescription procedure to decode the blob into a text field. 

    If you look at your page extension, you use a text variable for WorkDescription, and OnAfterGetRecord() you populate the variable from the table by calling Rec.GetWorkDescription()
     
    So using that same logic on your report, you will want to create a variable of type text. 
    In the OnAfterGetRecord() of the Purchase Header, I would first clear your variable, then do the same code that you used on the page. 
    You don't need to recreate those procedures on the report since they already exist at the table level. 
    Your final product should look something like this. 
     
    reportextension 70100 "TBM_StandardPurchaseOrder" extends "Standard Purchase - Order"
    {
        dataset
        {
            add("Purchase Header")
            {
                column(TBM_WorkDescription; WorkDescriptionVar) { }
            }
            modify("Purchase Header")
            {
                trigger OnAfterAfterGetRecord()
                begin
                    Clear(WorkDescriptionVar);
                    WorkDescriptionVar := TBM_GetWorkDescription();
                end;
            }
        }
     
        var
            WorkDescriptionVar: Text;
    }

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,606

#2
YUN ZHU Profile Picture

YUN ZHU 931 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans