|
It make a unique record string when you perform a record link |
|
Notepadr |
Record where link is pointed to |
Company |
Company where the record belong |
|
updating function
Boolean UpdateAllNotepadLinks(record NotepadVc Notepadr,LongInt lastno)
begin
record NotepadVc Notepad2r;
record RLinkVc RLr;
record RLinkVc RL2r;
Boolean foundf;
string 255 tstr;
Boolean res;
res = false;
tstr = BuildRecordIdStr(Notepadr,CurrentCompany);
RecordCopy(Notepad2r,Notepadr);
Notepadr.SerNr = lastno;
if (RecordUpdate(Notepad2r,Notepadr,false)==0) then begin
LUpdateAllNotepadLinks:;
foundf = true;
ResetLoop(RLr);
RLr.ToRecidStr = tstr;
while (LoopKey("ToRecKey",RLr,1,foundf)) begin
if (RLr.ToRecidStr!=tstr) then begin
foundf = false;
end;
if (foundf) then begin
RecordCopy(RL2r,RLr);
RLr.ToRecidStr = BuildRecordIdStr(Notepadr,CurrentCompany);
if (RecordUpdate(RL2r,RLr,false)==0) then begin
goto LUpdateAllNotepadLinks;
end;
end;
end;
res = true;
end;
DBFlush;
DBHold;
UpdateAllNotepadLinks = res;
return;
end;
««