Home » Developer & Programmer » Forms » Query Records in forms 6i
Query Records in forms 6i [message #326378] Wed, 11 June 2008 05:04 Go to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
Hi All,

I have a problem in querying the records.I placed a button for query and execute query.when query button is pressed the cursor will automatically go in to the header table code.i'll select the code thru LOV.when i press execute button the system is not giving the output.I don't know what to do.if anyone understand my problem please give the response.

Thanks in advance.
Re: Query Records in forms 6i [message #326484 is a reply to message #326378] Wed, 11 June 2008 12:42 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What is the code that is written behind every of these buttons?
Re: Query Records in forms 6i [message #326537 is a reply to message #326484] Wed, 11 June 2008 23:13 Go to previous messageGo to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
Hi

For Query button i was written the code like this..

clear_form(No_validate);
go_block('ec_hdr');

:lab:= 'Enter Query Mode';
set_item_property('create',ENABLED,PROPERTY_FALSE);
set_item_property('equery',ENABLED,PROPERTY_TRUE);
set_item_property('query',ENABLED,PROPERTY_FALSE);
set_item_property('SAVE',ENABLED,PROPERTY_FALSE);

set_item_property('fst',ENABLED,PROPERTY_FALSE);
set_item_property('LAST',ENABLED,PROPERTY_FALSE);
set_item_property('NEXT',ENABLED,PROPERTY_FALSE);
set_item_property('PRV',ENABLED,PROPERTY_FALSE);

--Enter_query;

For Execute query button:

begin
if :lab= 'EnterQueryMode' then
go_block('ec_hdr');
execute_query;
end if;
IF (:system.mode = 'ENTER-QUERY') THEN
-- exit_form;
-- message('hello');


null;
else

set_item_property('fst',ENABLED,PROPERTY_TRUE);
set_item_property('LAST',ENABLED,PROPERTY_TRUE);
set_item_property('NEXT',ENABLED,PROPERTY_TRUE);
set_item_property('PRV',ENABLED,PROPERTY_TRUE);

set_item_property('create',ENABLED,PROPERTY_TRUE);
set_item_property('query',ENABLED,PROPERTY_TRUE);
set_item_property('equery',ENABLED,PROPERTY_FALSE);
set_item_property('DELREC',ENABLED,PROPERTY_TRUE);
set_item_property('SAVE',ENABLED,PROPERTY_TRUE);

end if;


exception
when others then
null;
end;

This is the code which i written in both the buttons. One thing is,it is a master-detail form.
Please give the suggession how to do it.
Re: Query Records in forms 6i [message #326557 is a reply to message #326537] Wed, 11 June 2008 23:56 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Remove the when others then null. It makes any error invisible.
Re: Query Records in forms 6i [message #326567 is a reply to message #326557] Thu, 12 June 2008 00:30 Go to previous messageGo to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
Hi

Still i am unable to query the records. Please tell me if another solution.
Re: Query Records in forms 6i [message #326584 is a reply to message #326567] Thu, 12 June 2008 01:07 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
You should really learn how to debug your code. Find a way to check which branches are taken in if-statements etc.

Take a good look at the value you assign to lab as compared to the value you check it against. (By the way, this is the reason people use constants!)

Why not use the form's internal variable to check if you are in enter-query mode?!

[Updated on: Thu, 12 June 2008 01:09]

Report message to a moderator

Re: Query Records in forms 6i [message #326954 is a reply to message #326378] Fri, 13 June 2008 03:15 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
the system is not giving the output

How would it?
Query button:            :lab:= 'Enter Query Mode';
Execute query button: if :lab = 'EnterQueryMode' then

Pressing the "Query button" never enters query mode as it is commented:
--Enter_query;

Besides, why do you make things complicated? What's wrong with default Forms querying feature? Press Enter query, enter criteria, press Execute query. That's all.

What's the purpose of enabling/disabling these items?

First make it work, then make it fancy.
Re: Query Records in forms 6i [message #327012 is a reply to message #326954] Fri, 13 June 2008 06:59 Go to previous message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
Thank u littlefoot....

I'll agree with your statement but the client needs separate buttons for all these things.......
Any way thank you for giving reply to me..
Previous Topic: Form navigat to the blank records - Strange
Next Topic: set_item_property from another block
Goto Forum:
  


Current Time: Fri Sep 27 12:20:48 CDT 2024