Monday, March 30, 2015

Dexterity template - Save() record

function returns boolean Saved;
inout table RecordTable;

local integer Status;

default window to RecordWindow;

if not required(window RecordWindow) then
call Warning_Dialog,2351,"","","";
Saved = false;
abort script;
end if;

release table RecordTable;
RecordID of table RecordTable = RecordID;
change table RecordTable by number 1;

copy from window RecordWindow to table RecordTable;

save table RecordTable;

Status = err();

if Status = OKAY then
Saved = true;
abort script;
end if;

Saved = false;

case Status
 in [RECORDCHANGED]
  call Warning_Dialog,5202,"","","";
clear changes window RecordWindow;
run script RecordID;
focus 'Save Button';
 in [DUPLICATE]
  call Warning_Dialog,5283,"","","";
unlock RecordID;
focus RecordID;
end case;

No comments:

Post a Comment

There was an error in this gadget