Table of Content
HAL Forum
function boolean RecordInsert (
record AnyRecord,boolean UseEvents)
Description:
Inserts a new record into the specified register.
Parameters:
AnyRecord The record that will be inserted into the register that was used when declaring the record variable (e.g. record INVc INr).
UseEvents Use record events when inserting the new record.
global
updating procedure StoreTheMessageMail(record MailVc Mailr,LongInt fromlink,LongInt tolink)
begin
  record MailVc Mail2r;
  
  Mailr.SerNr = NextSerNr("MailVc",Mailr.TransDate,-1,false,"");
  if (RecordInsert(Mailr,false)) then begin
  end;
  if (tolink>0) then begin
    Mail2r.SerNr = tolink;
    if (ReadFirstMain(Mail2r,1,true)) then begin
      CreateRecordLink(Mailr,CurrentCompany,Mail2r,CurrentCompany);
    end;
  end;
  if (fromlink>0) then begin
    Mail2r.SerNr = fromlink;
    if (ReadFirstMain(Mail2r,1,true)) then begin
      CreateRecordLink(Mail2r,CurrentCompany,Mailr,CurrentCompany);
    end;
  end;
  return;
end;
Related topics:
««