Thursday, April 23, 2015

Dexterity - browse button template

Call the Browse procedure from each browse button, passing in a different operator constant depending on which button it is.

Example of the call: call Browse of form MyForm, table MyTable, GET_NEXT;

Note: This template only searches on key 1. You'd have to modify this to work with any specified key (like the Sort By field).

Form procedure - Browse

inout table MyTable;
in integer Op;
default window to MyWindow;

if (changed(window MyWindow)) and not empty(ID) then
run script 'Handle Changes';
if not 'Handle Changes' then
   ID of table MyTable = ID;
abort script;
end if;
clear changes form MyWindow;
end if;

case Op
get next table MyTable by number 1;
get prev table MyTable by number 1;
get last table MyTable by number 1;
get first table MyTable by number 1;
end case;
if err() <> OKAY then
abort script;
end if;

'(L) TempID' = ID of table MyTable;

run script '(L) TempID';

No comments:

Post a Comment

There was an error in this gadget