Home » Developer & Programmer » Forms » Issue while query record in form based on master detail relationship.
Issue while query record in form based on master detail relationship. [message #609611] Mon, 10 March 2014 05:57 Go to next message
nkumar0130
Messages: 55
Registered: August 2013
Location: Bangalore
Member
Hi,

I am developing a form which is based on master detail relationship.
In a form there is a two block let say block A and bock B, block A is master and block B is child. both the block are based on two different table.I have few below requirement from user:-
1) If user use F11 in block A to enter into search screen then both the block A and block B will enter into search screen, and if he did the same thing i.e. F11 in block B then both the block A and block B will enter into search screen.

2)And if user did F11 in the block B the cursor by default will go to the first column of block A.

3)If block A is empty then user are not suppose to get any record on using ctrl+F11 in block B.

Please let me know any solution for the above requirement.

Thanks

Re: Issue while query record in form based on master detail relationship. [message #609615 is a reply to message #609611] Mon, 10 March 2014 06:31 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try to create a form-level KEY-ENTQRY trigger (which means that you'd have to remove (comment, rename, whatever) KEY-ENTQRY triggers you currently have on lower (block, probably) levels). Put
go_block('A');
enter_query;
into that trigger.

It will first navigate to block A and enter query mode.

Partially, your requirement is invalid - you can't put both blocks into query mode. Once you are in a block which is in query mode, it prevents you from navigating out of this block until you execute query or cancel it.

Detail block will automatically return result if there is a master record. If query returns nothing for block A, block B will remain empty anyway.
Re: Issue while query record in form based on master detail relationship. [message #609617 is a reply to message #609615] Mon, 10 March 2014 07:09 Go to previous messageGo to next message
nkumar0130
Messages: 55
Registered: August 2013
Location: Bangalore
Member
Thanks Littlefoot for your prompt response.
But for my third point, in my form when user is doing ctrl+F11 in block B then it is returning record, irrespective of block A is having record or not.
But user doesn't want the same. The user requirement is that if block A is not having any record and user is using ctrl+F11 in block B then it should get a pop up message that 'no record found because master has no record' and block B will not return any value.
Re: Issue while query record in form based on master detail relationship. [message #609627 is a reply to message #609617] Mon, 10 March 2014 07:58 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try with KEY-EXEQRY on block B which would say something like
if :block_A.id is null then
   message('No record found ...');
   raise form_trigger_failure;
else
   execute_query;
end if;
Re: Issue while query record in form based on master detail relationship. [message #609633 is a reply to message #609627] Mon, 10 March 2014 09:19 Go to previous message
nkumar0130
Messages: 55
Registered: August 2013
Location: Bangalore
Member
Thank you Littlefoot,
It worked for me.
Previous Topic: set a schedule date time in DBMS_JOB.SUBMIT
Next Topic: Dynamic search in Text using LOV
Goto Forum:
  


Current Time: Fri Mar 29 07:41:37 CDT 2024