Table of Content
HAL Forum
function string RecordUpdate (
Record OldRecord,Record NewRecord,Boolean UseRActions)
Description:
Performs database record update by replacing OldRecord with NewRecord. Triggers RActions: RecordUpdate, RecordUpdateAfter.
Parameters:
OldRecord The original record before any changes.
NewRecord The record with changes.
UseRActions Determines if the Updating process will use RecordActions that have been defined for this register. FALSE will bypass all of them.
// Return value:
// 0	Update successful
// -1	Update failed

global
updating function Boolean RecordAction_SPLOK(Var Record SalaryPaymentVc SPr,Boolean readf,Var Integer flushcnt)
begin
  Boolean res;
  Record SalaryPaymentVc oldSPr;

  if (IsRecordLocked(SPr) == false) then begin
    if (readf) then begin
      if (readFirstMain(SPr,0,true)) then begin end;
    end;
    recordCopy(oldSPr,SPr);
    if (SPr.OKFlag == 0) then begin
      SPr.OrderedFlag = 1;
      SPr.OKFlag = 1;
      if (RecordUpdate(oldSPr,SPr,true) == 0) then begin
        res = true;
      end;
    end;
  end;

  RecordAction_SPLOK = res;

  return;
end;

Related topics:
««