Home » Developer & Programmer » Forms » clear_list/delete_list_item
clear_list/delete_list_item [message #680686] Mon, 01 June 2020 05:44
jury68000
Messages: 15
Registered: October 2019
Junior Member
Forms 10g, Win7

We have some list_item populated statically during design time. Now I need to change that list_item values to be populated dynamically when form is entered.
So in when-new-form-instance I put the code:

declare
	rg_spr_status	recordgroup;
	l_spr_status	item:= find_item('block.column1');
	n_dummy	number;
begin
	clear_list(l_spr_status);
	if (sth) then
		rg_spr_status:= create_group_from_query('SPR_STATUS', 'select something');
	else
		rg_spr_status:= create_group_from_query('SPR_STATUS','select something else');
	end if;
	n_dummy:= populate_group(rg_spr_status);
	populate_list('block.column1', rg_spr_status);
end;
This code crashes with a message: "FRM-41331: Could not delete element from column1"

According to Oracle this means:

"FRM-41331: Could not delete element from %s.
Cause: Caused by one of the following:
You tried to delete the other values element when the block contained either queried or changed records.

You tried to delete an element from a list that does not contain an other values element when the block contained either queried or changed records.

Action: For more information, refer to help for restrictions on <a href="../builta_c/clearlis.html">CLEAR_LIST</a> and <a href="../builtd_f/dellsele.html">DELETE_LIST_ELEMENT</a>.
"

I'm not sure I understand above correctly, but from my understanding, at when-new-form-instance I do not have any "queried or changed records" yet (or am I wrong?)
I moved this code to pre-form for test, but it was even worse.
Also tried to delete that populated list item by item with
delete_list_element('block.column1', value);
but the error message was exactly the same from the first item being deleted.
Why can't I clear the list?

[Updated on: Mon, 01 June 2020 06:58]

Report message to a moderator

Previous Topic: Debugging not Working Forms 12c
Next Topic: Password Reset
Goto Forum:
  


Current Time: Mon Sep 28 10:42:14 CDT 2020