Table of Content
HAL Forum
function boolean RecordLinkFile (
string FileName,integer Reserved,record AnyRecord,integer CompCode)
Description:
Loads file contents and attaches it to the specified record
Parameters:
FileName The path and name of the attachment file.
Reserved Reserved for internal use
AnyRecord The record that will receive the attachment link.
CompCode The code of the company where the record link is created
updating procedure CreateAndAttachPdfIV(record IVVc IVr)
begin
  string 255 fname,docname;
  
  fname = "tmp/" & IVr.SerNr & ".pdf";
  SetDocumentFilename(fname);
  SetMedia(mtPdf);
  docname = "InvForm";
  if (IVr.InvType==2) then begin docname = "CashInvForm"; end;
  if (IVr.InvType==3) then begin docname = "CredInvForm"; end;
  if (IVr.InvType==4) then begin docname = "IIInvForm"; end;
  if ((nonblank(IVr.PRCode)) and (IVr.InvType==1)) then begin
    docname = "ProjInvForm";
  end;
  PrintDocument(IVr,docname,false);
  if (FileExists(fname)) then begin
    RecordLinkFile(fname,0,IVr,CurrentCompany);
  end;
  SetDocumentFilename("");
  Delete_File(fname);
  
  RETURN;
END;
Related topics:
««