Home » Developer & Programmer » Forms » how to keep text in item
how to keep text in item [message #179673] Wed, 28 June 2006 06:46 Go to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Hi

I have developed a form is there any possbility that when i enter record all the text will be store in text item and when i press any key, form show all record which i have entered in this field.


best regards
Re: how to keep text in item [message #179676 is a reply to message #179673] Wed, 28 June 2006 07:00 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
You mean that you want to search on a field? If so, there's nothing you need to do: go in enter-query mode, enter the value you are looking for and execute the query.

MHE
Re: how to keep text in item [message #179677 is a reply to message #179676] Wed, 28 June 2006 07:12 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
No I dont want to search the record I mean when we enter record in form record save in database, but is there any function when we enter record in form text items keep these words in history and when we go for new reocrd text items show that you have enter these text already (show as list).

I hope you may undersatnd me.
Re: how to keep text in item [message #179688 is a reply to message #179677] Wed, 28 June 2006 07:40 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Yes; this can be done using List of Values feature.
Re: how to keep text in item [message #179696 is a reply to message #179688] Wed, 28 June 2006 08:07 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Please let me know. How it is possible?
Re: how to keep text in item [message #179703 is a reply to message #179696] Wed, 28 June 2006 08:19 Go to previous messageGo to next message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

You'll have to use record groups for this purpose.
Re: how to keep text in item [message #179739 is a reply to message #179696] Wed, 28 June 2006 09:37 Go to previous messageGo to next message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

hi,
here is the solution.
Create a form for dept table in scott's schema.
make thes echanges:

LOC --> change this column from Text Item to List Item
List Style --> COmbo Box
Open Elements in List Property and put 0 in List item value. (This value is for the default list element).

Now create these two procedures in your form.

PROCEDURE Populate_the_List (	list_id ITEM,
					sql_stat VARCHAR2) IS
 group_id	RecordGroup;
 outcome	NUMBER;
BEGIN
--Create temporary record group. 
 group_id := CREATE_GROUP_FROM_QUERY('List_Elements', sql_stat);
 IF ID_NULL(group_id) THEN
  MESSAGE('Record Group could not be created in Populate_the_List.');
  RAISE FORM_TRIGGER_FAILURE;
 END IF;

--Populate record group. 
 outcome := POPULATE_GROUP(group_id);
 IF outcome <> 0 THEN 
  MESSAGE('Record Group could not be populated in Populate_the_List.');
  RAISE FORM_TRIGGER_FAILURE;
 END IF;

--Populate list item
 POPULATE_LIST(list_id, group_id);

--Destroy the temporary record group to release resources
 DELETE_GROUP(group_id);

EXCEPTION
 WHEN OTHERS THEN 
  MESSAGE('Internal error occurred in Populate_the_List.'); 
  RAISE FORM_TRIGGER_FAILURE;
END Populate_the_List;

2nd procedure:


PROCEDURE Get_Lists_Values (list_name VARCHAR2) IS
 list_id	 ITEM;
 col_name	 VARCHAR2(80) := SUBSTR(list_name, INSTR(list_name,'.')+1);
 sql_stat	 VARCHAR2(2000);

BEGIN
--Find ID for list item. 
 list_id := FIND_ITEM(list_name); 
 IF ID_NULL(list_id) THEN
  MESSAGE('List Item '||list_name||' does not exist.');
  RAISE FORM_TRIGGER_FAILURE;
 END IF;

--Build the SQL statement. 
 sql_stat := 'SELECT DISTINCT '||list_name||', '||list_name||
	   ' FROM DEPT ORDER BY 1';

 Populate_the_List(list_id, sql_stat);

EXCEPTION
 WHEN OTHERS THEN 
 MESSAGE('Internal error occurred in Get_Lists_Values.'); 
  RAISE FORM_TRIGGER_FAILURE;
END Get_Lists_Values;

Create a When-New-Record-Instance trigger on dept block and wtite this line.
Get_Lists_Values('DEPT.loc');


Run the form and your requirement is fulfilled.

Note: In the Get_Lists_Values procedure give the appropriate data block name.
In this line:
 sql_stat := 'SELECT DISTINCT '||list_name||', '||list_name||
	   ' FROM DEPT ORDER BY 1';

I mentioned DEPT. you mention your data block here
Form is attached.

regars,
hope it is clear.
Saadat Ahmad

[Updated on: Wed, 28 June 2006 09:42]

Report message to a moderator

Re: how to keep text in item [message #179975 is a reply to message #179739] Thu, 29 June 2006 09:35 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Hi Saadat

It is working but when I go for query shows error msg and also shows error at the time of save.

Query error = FRM-40505 Enable to perform query
Save error = FRM-40508 enable to insert recrod

Please help

Re: how to keep text in item [message #179981 is a reply to message #179975] Thu, 29 June 2006 09:57 Go to previous message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

At runtime, Click on Help--->Display Error
From here you'll come to know the error message and do what is necessary to resolve th eerror. Code doesn't have any problem because I checked it.

A quick search on google gave me these inks:
http://www.google.com/search?hl=en&q=FRM-40505+&btnG=Google+Search

regards,
Saadat Ahmad
Previous Topic: how to remove developer 10g completely ?
Next Topic: On button Click in Oracle Forms 4.5 open a browser window
Goto Forum:
  


Current Time: Fri Sep 20 10:25:54 CDT 2024