how to keep text in item [message #179673] |
Wed, 28 June 2006 06:46 |
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 #179677 is a reply to message #179676] |
Wed, 28 June 2006 07:12 |
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 #179739 is a reply to message #179696] |
Wed, 28 June 2006 09:37 |
|
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 |
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
|
|
|
|