Work Description-type field on Purchase Order email?
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;
}