Home » Developer & Programmer » Forms » Form query
Form query [message #193719] Tue, 19 September 2006 02:28 Go to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi,
My form has a block which returns multi-records.
1) I click on each record and click a button which submits these values into some other table and also clears the values that are submitted. After submitting all the values, and when there are no values to be displayed, I want a message to be shown as "No records" . How can I achieve this task?

2) When I open my form and if there are no records I am getting a message FRM-40350. So in On-message I wrote a trigger to display a message that there are no records and the user can exit from the form. For this I used an alert. If the user wants to quit, he clicks on OK button. Before quitting the form, I am getting a message FRM-40401No changes to save . I don;'t want this message to appear. What can I do?
Re: Form query [message #193724 is a reply to message #193719] Tue, 19 September 2006 02:36 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

Quote:

1) I click on each record and click a button which submits these values into some other table and also clears the values that are submitted. After submitting all the values, and when there are no values to be displayed, I want a message to be shown as "No records" . How can I achieve this task?


Is there any message is appearing when records are finished?

Quote:

2) When I open my form and if there are no records I am getting a message FRM-40350. So in On-message I wrote a trigger to display a message that there are no records and the user can exit from the form. For this I used an alert. If the user wants to quit, he clicks on OK button. Before quitting the form, I am getting a message FRM-40401No changes to save . I don;'t want this message to appear. What can I do?


there might be any "commit" use forms_ddl('Commit') in place of direct Commit. please check that.
you can use exit_form(no_validate);

Sandy

[Updated on: Tue, 19 September 2006 02:37]

Report message to a moderator

Re: Form query [message #193727 is a reply to message #193724] Tue, 19 September 2006 02:49 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
For the first case, I am not getting any message. I want to display a message if all the records are submitted.

For the second case I am not using commit anywhere. I tried using exit_form(no_validate) but I am getting the message
FRM-40401No changes to save
How can I supress this message?
Re: Form query [message #193745 is a reply to message #193727] Tue, 19 September 2006 04:22 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

For second case

increase the system.message_level to 20. Store the old value in a variable. After your process reassign that old value to :system.message_level;

e.g.

DECLARE
mess_level NUMBER := :SYSTEM.MESAGE_LEVEL;
BEGIN
:SYSTEM.MESSAGE_LEVEL := 20;
/* your process code */
:SYSTEM.MESSAGE_LEVEL := mess_level ;
END;

sandy
Re: Form query [message #193748 is a reply to message #193745] Tue, 19 September 2006 04:45 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi Sandy,
I tried out as you said..No luck! The FRM 40401 is still coming up.
Can I do something like this? When I open the form, if there are no records, I get a message FRM 40350..I used an alert here which says that there are no tasks...When the user clicks on the option OK, the block in the form should be inactive. That is..the user cannot enter any values.
Any ideas?
Re: Form query [message #193751 is a reply to message #193748] Tue, 19 September 2006 05:17 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

Yes, to disable any user operation like Insert, Update or delete set block property.

set_block_property('BLOCK_NAME',INSERT_ALLOWED,PROPERTY_FALSE);
set_block_property('BLOCK_NAME',UPDATE_ALLOWED,PROPERTY_FALSE);
set_block_property('BLOCK_NAME',DELETE_ALLOWED,PROPERTY_FALSE);

Or try with message_level=25

Sandy
Re: Form query [message #193755 is a reply to message #193751] Tue, 19 September 2006 05:30 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi Sandy,
I tried out your suggestion by using set_block_property. It works ...but the problem is that the cursor is still in the item of the block. It is not allowing me to enter any value but can we prevent the cursor from entering the block?
Thank you for guiding me.
Re: Form query [message #193762 is a reply to message #193755] Tue, 19 September 2006 05:45 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

ok..

try this
go_block('any_other_block');
set_block_property('BLOCK_NAME',INSERT_ALLOWED,PROPERTY_FALSE);
set_block_property('BLOCK_NAME',UPDATE_ALLOWED,PROPERTY_FALSE);
set_block_property('BLOCK_NAME',DELETE_ALLOWED,PROPERTY_FALSE);
:global.lock_detail:=1;


on Pre_Block of Detail

if :global.lock_detail=1 then
message('Can''t Enter any value in this block');
go_block('any_other_block');
end if;

Pre-form
:global.lock_detail:=null;

when-new-form-instance
:global.lock_detail:=0;

It's very lenghty process, but i think setting system.message_level:=25 should supress the message of no changes to save.

Sandy



Re: Form query [message #193770 is a reply to message #193762] Tue, 19 September 2006 06:12 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi Sandy,
Thank you for your help. I would try out the procedure mentioned by you.
Re: Form query [message #193773 is a reply to message #193770] Tue, 19 September 2006 06:24 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

for 1st of your problem i.e. displaying the message of NO RECORDS.

Try this....

Write on when-button-pressed of submit button.

/*

all of your codes

*/

declare
cnt number;
begin
go_block('detail');

/* for first time if no records then it will display the message you defined before on pre-block;*/

last_record;
cnt:=get_block_property('detail',current_record);

/* check for any primary or not null value in details like*/

If cnt <= 1 and :detail.text_item1 is null then
message('No Records To Display');
go_block('any_other_block');
set_block_property('detail',INSERT_ALLOWED,PROPERTY_FALSE);
set_block_property('detail',UPDATE_ALLOWED,PROPERTY_FALSE);
set_block_property('detail',DELETE_ALLOWED,PROPERTY_FALSE);
:global.lock_detail:=1;
End if;
End;


Sandy
Re: Form query [message #193779 is a reply to message #193773] Tue, 19 September 2006 06:50 Go to previous message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi Sandy,
I am trying out the second part of the code that you said. I would put in this new part for the first one...Thanks a lot!!
Previous Topic: fetching records
Next Topic: in which trigger I should use this:
Goto Forum:
  


Current Time: Fri Sep 20 12:22:58 CDT 2024