Home » Developer & Programmer » Forms » go_item doesen't works ! (Forms 9)
go_item doesen't works ! [message #541693] Wed, 01 February 2012 21:27 Go to next message
ollivier
Messages: 19
Registered: January 2012
Location: chihuahua
Junior Member
I hab a button:

flag:=show_lov('lov16');
if :block.cliente_no is not null then
go_block('clientes');
execute_query;
go_item('block.codigo');
end if;

it calls a LOV and return a value to :block.cliente_no,
then execute a query in block clientes, but cursor doesn`t
goes to block.codigo it remains in the button !

Why doesn`t works ?

Note: if I insert a message before line go_item('block.codigo');
cursor goes to 'block.codigo' (message('hallo');
Re: go_item doesen't works ! [message #541708 is a reply to message #541693] Wed, 01 February 2012 23:57 Go to previous messageGo to next message
Tomcrzy
Messages: 101
Registered: December 2011
Location: Chennai,India
Senior Member

Hi ollivier,

Better recheck your code with this

flag:=show_lov('lov16');
if :block.cliente_no is not null then
go_block('clientes');
execute_query;
go_item(':codigo');
end if;
Re: go_item doesen't works ! [message #541732 is a reply to message #541708] Thu, 02 February 2012 01:26 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Ollivier,

are these blocks related (i.e. master-detail blocks)? If so, you don't need GO_BLOCK('clientes') because executing a query in a master block (BLOCK) will automatically fetch related details records. Therefore, WHEN-BUTTON-PRESSED might look like this:
declare
  flag boolean;
begin  
  flag := show_lov('lov16');
  
  if :block.cliente_no is not null then
     execute_query;
     go_item('block.codigo');
  end if;
end;

First you need to enter query mode, then push that button, select a value and - that's it!

On the other hand, if these blocks are not related (but you created pseudo master-detail relationship), you can't enter query mode in BLOCK block because GO_BLOCK would be an invalid statement in query mode. Therefore, WHEN-BUTTON-PRESSED would look like this:
declare
  flag boolean;
begin  
  flag := show_lov('lov16');
  
  if :block.cliente_no is not null then
     go_block('clientes');
     execute_query;
     go_item('block.codigo');
  end if;
end;


In any case, navigation to BLOCK.CODIGO works just fine in an example I created on Scott's DEPT and EMP table (master-detail), working on Oracle Forms Developer 10g (9.0.4).

There's nothing obvious (from what you posted so far) that would prevent navigation to that item. Is there any other code (such as SET_ITEM_PROPERTY for the target BLOCK.CODIGO item) you didn't mention?

What Forms version do you use? Could you create a sample form (based on DEPT and EMP tables) and attach it to your next message, so that we could see what you did?

Maybe you could set button's "Keyboard navigable" and "Mouse navigate" properties to "No" (button will still be functional).



P.S. Tomcrzy's code is invalid. GO_ITEM doesn't accept "colon" reference to items.
GO_ITEM(':codigo') is invalid (raises FRM-40105: unable to resolve reference to item).
GO_ITEM('codigo') is valid.
Re: go_item doesen't works ! [message #541862 is a reply to message #541732] Thu, 02 February 2012 21:19 Go to previous message
ollivier
Messages: 19
Registered: January 2012
Location: chihuahua
Junior Member
I resolved yet !

go_item doesen't jump after a LOV !

So First I go to desired item (:block.codigo), create a trigger and then call LOV !

Thanks any one !
Previous Topic: Ora - 105100
Next Topic: if file doesn't exist !
Goto Forum:
  


Current Time: Fri Aug 23 16:44:22 CDT 2024