Can you please check where i am wrong
TemplateTable.CALCFIELDS(ImportTemp);
IF TemplateTable.GET('141') THEN
TempBlob.Blob.CREATEINSTREAM(Ins);
WHILE NOT Ins.EOS DO BEGIN
Ins.READTEXT(EmailTemplateBody);
MESSAGE('%1',EmailTemplateBody);
END;
Can you please check where i am wrong
TemplateTable.CALCFIELDS(ImportTemp);
IF TemplateTable.GET('141') THEN
TempBlob.Blob.CREATEINSTREAM(Ins);
WHILE NOT Ins.EOS DO BEGIN
Ins.READTEXT(EmailTemplateBody);
MESSAGE('%1',EmailTemplateBody);
END;
I want to read HTML templates which i have already import in templates table and i want to use this templates in email to customers
mention below are the codes for import templates.
ImportTemplate - OnAction()
Rec.CALCFIELDS(ImportTemp);
IF Rec.ImportTemp.HASVALUE THEN
MESSAGE('Template is alredy Uploaded');
IF NOT CONFIRM('Do you want to ReUpload?') THEN
EXIT;
FileName := Filemgm.BLOBImportWithFilter(TempBlob, 'Upload File', '', 'All Files (*.*)|*.HTML*', '.HTML');
TempBlob.Blob.CREATEINSTREAM(Ins);
Rec.ImportTemp.CREATEOUTSTREAM(Outs);
COPYSTREAM(Outs, Ins);
IF TempBlob.Length()>5000000 THEN
ERROR('File size must be less than or equal to 3MB')
ELSE BEGIN
Rec.MODIFY(TRUE);
MESSAGE('File Uploaded');
END;
ExportTemplate - OnAction()
Rec.CALCFIELDS(ImportTemp);
Rec.ImportTemp.CREATEINSTREAM(Ins);
TempBlob.Blob.CREATEOUTSTREAM(Outs);
COPYSTREAM(Outs,Ins);
IF Rec.ImportTemp.HASVALUE THEN
FilemngCU.BLOBExport(TempBlob, FileName + 'Parcel.html', TRUE)
ELSE
ERROR('File Not found');
Hi,
You can have an idea by going to Sales Header Table and find the function to get and set work description.
procedure SetWorkDescription(NewWorkDescription: Text) var OutStream: OutStream; begin Clear("Work Description"); "Work Description".CreateOutStream(OutStream, TEXTENCODING::UTF8); OutStream.WriteText(NewWorkDescription); Modify(); end; procedure GetWorkDescription() WorkDescription: Text var TypeHelper: Codeunit "Type Helper"; InStream: InStream; begin CalcFields("Work Description"); "Work Description".CreateInStream(InStream, TEXTENCODING::UTF8); exit(TypeHelper.TryReadAsTextWithSepAndFieldErrMsg(InStream, TypeHelper.LFSeparator(), FieldName("Work Description"))); end;
Hi, hope the following helps.
Thanks.
ZHU
André Arnaud de Cal...
293,278
Super User 2025 Season 1
Martin Dráb
232,011
Most Valuable Professional
nmaenpaa
101,156
Moderator