Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms 4.5 Illegal procedure Go_record and Go_item in W-V-I

Status
Not open for further replies.

dps

Programmer
Feb 2, 2001
157
GB
Hello,

I have a W-V-I trigger on a field which when the user eneters a value and tabs out a procdure is called which fetches records from a table and via OUT parameters feeds 'em back to fields in the form. Based upon the number of fethes, i.e. if greater then One rows then show an LOV else fill in the form feilds. If rows returned greater then 1 the call is made to a package. procedure as below

PROCEDURE p_show(pc_item_name IN VARCHAR2) IS
lc_group_name VARCHAR2(100);
ln_row_count NUMBER;
lc_block_name VARCHAR2(40) := UPPER(SUBSTR(pc_item_name,1,Instr(pc_item_name, '.') - 1));
ll_lov_id LOV := Find_Lov(Get_Item_Property(pc_item_name, LOV_NAME));
BEGIN
IF Name_In('SYSTEM.CURSOR_BLOCK') != lc_block_name THEN
Go_Block(lc_block_name);
END IF;

IF Name_In('SYSTEM.CURSOR_RECORD') != Name_In('SYSTEM.MOUSE_RECORD') THEN
Go_Record(To_Number(Name_In('SYSTEM.MOUSE_RECORD')) + 1 -
To_Number(Get_Block_Property(lc_block_name,TOP_RECORD)));
END IF;

IF NOT Id_Null(ll_lov_id) THEN

p_set_position(pc_item_name);

lc_group_name := Get_Lov_Property(ll_lov_id, GROUP_NAME);
ln_row_count := Populate_Group(lc_group_name);

Go_Item(pc_item_name);

Do_Key('List_Values');
END IF;

Problem using this method as oppossed to show_lov ('lov name'); is that the above error arises.

How can I work round this please????
 
Forms will not permit cursor navigation in When-Validate triggers, thus it restricts built-ins such as Go_Item, Go_Record, and Go_Block. You could use them in the KEY-NEXT-ITEM trigger, but this wouldn't help unless you are running in block mode.

I am not clear on why you cannot use the LOV for this. Did you know that you can select multiple values in your record group but only display some of them? The rest can be hidden from the user (LOV WIDTH=0) but still can return a value.

Hope this helps a bit.
 
To get around the navgation problem I use a timer. For example, instead of the Go_Item I would use

tm := Create_Timer('GOITEM',1,NO_REPEAT);

Then create a WHEN-TIMER-EXPIRED trigger and add

IF Get_Application_Property(TIMER_NAME) = 'GOITEM'
THEN
Go_Item('block.item');
END IF;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top