Home » Developer & Programmer » Forms » Add_List_Element (Oracle IDS 10g,Windows XP)
Add_List_Element [message #381802] Mon, 19 January 2009 23:26 Go to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi All!

I have an list item called EMPLOYEEID in my form .. I didnt give any default values to it through property palette..

The coding i used is,
Trigger:PRE-BLOCK  BLOCK NAME:HODAL

BEGIN 
if :GLOBAL.EMPLOYEEID='1111' then 
message('xx');
Add_List_Element('HODAL.EMPLOYEEID',1,'2','2'); 
Add_List_Element('HODAL.EMPLOYEEID',2,'3','3');  
elsif :GLOBAL.EMPLOYEEID='2222' then
message('yy');
Add_List_Element('HODAL.EMPLOYEEID',1,'234','234'); 
end if; 
end if;
END;


The message in both clause is not getting displayed ..

Now the if clause is working well but not the else clause..

pls help to overcome this issue ..

Thanks and Regards,
varosh
Re: Add_List_Element [message #381803 is a reply to message #381802] Mon, 19 January 2009 23:28 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Just use a static 'record_group' and then an LOV to use it.

David
Re: Add_List_Element [message #381812 is a reply to message #381802] Tue, 20 January 2009 00:24 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
I also agree with Mr. David that you should use a static 'record_group' and then an LOV to use it.

But just to trouble shoot the situation I would suggest that you should check the value of your global variable.

Reggards,
Azam Khan
Re: Add_List_Element [message #381815 is a reply to message #381803] Tue, 20 January 2009 00:34 Go to previous messageGo to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi Sir !

Iam new to this populate_list concept ..

I created an LOV as u suggested(Created button near my field employeeid on clicking it default values are getting displayed).. while creating i gave the default values as 2 and 3..

After which i created another static record group with a value '234'

Now i used the coding :

Trigger: PRE-BLOCK 

declare
	list_id item;
	rg_id recordgroup;
 
BEGIN
if :global.employeeid='2222' then
	list_id:=find_item('EMPLOYEEID');
	rg_id:=find_group('RECORD_GROUP44');	 
	CLEAR_LIST(list_id);
	POPULATE_LIST(list_id, 'rg_id'); 
end if;
end;


Now the default values are not getting removed and the value i specified for new record group is not getting populated..

Have i made any mistake in the code or procedure to create this lov and record group?

please help!

Thanks and Regards,
varosh

Re: Add_List_Element [message #381822 is a reply to message #381815] Tue, 20 January 2009 00:49 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Check your code. Verify that is your record group is populating successfully or not.

And try to give variables, list and record groups meaning full names. This helps alot while you are coding.

Regards,
Azam Khan
Re: Add_List_Element [message #381830 is a reply to message #381822] Tue, 20 January 2009 01:08 Go to previous messageGo to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi !

Even if i didnt specify the condition, the record group is not populating the list ..

pls help

Thanks and Regards,
varosh
Re: Add_List_Element [message #381897 is a reply to message #381830] Tue, 20 January 2009 04:18 Go to previous messageGo to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi !

I tried to check condition in LOV..

I mean if one condition get satisfied i want one LOV1 to be displayed otherwise other LOV2 to get displayed..

So i tried with the coding
trigger:when button pressed (placed a button near a txt item employeeid)

Declare
Return_LOV Boolean;
Begin
If :global.employeeid='1111' then
Return_LOV :=show_LOV('LOV1');
elsif :global.employeeid='2222'then
Return_LOV :=show_LOV('LOV2');	
end if;
End;  

But the else clause not working.. The LOV1 alone is getting displayed..

Pls help..

Thanks and Regards,
varosh
Re: Add_List_Element [message #381942 is a reply to message #381897] Tue, 20 January 2009 06:53 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you check value of the GLOBAL.EMPLOYEEID global variable? What was it? If you didn't, do so (use MESSAGE built-in). Because, the code you posted *looks* as if everything is OK.
Re: Add_List_Element [message #382086 is a reply to message #381942] Tue, 20 January 2009 22:50 Go to previous messageGo to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi sir!
Thanks for your reply!
For global variable, tried with the coding,
Trigger: when button pressed
Block:B form:form1 
:GLOBAL.EMPLOYEEID:=:emplogin.EMPLOYEEID; /* Here emplogin is one of the  block of a form, form1 */
CALL_FORM('D:\DevSuiteHome_1\forms\FAIR\FAIR 1\hod-al');

In the hod-al form i havent given any default values for the list item EMPLOYEEID..
I have placed a button near listitem EMPLOYEEID.. And the coding given for the button is,
Trigger:when button pressed
 
Declare
Return_LOV Boolean;
Begin
if :global.employeeid='1111' then
message('xx');
Return_LOV :=show_LOV('emp_LOV');
elsif :global.employeeid='2222' then
message('yy');
Return_LOV :=show_LOV('LOV45');
else 
message('no lov');
end if;
End; 



Now in the above coding the messages in if,elsif,else clauses are not getting displayed..

But the values of emp_LOV in if clause is getting generated unlike the elsif clause..

Pls help to overcome this issue!

Thanks and Regards,
varosh
Re: Add_List_Element [message #382096 is a reply to message #382086] Tue, 20 January 2009 23:33 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Global variables are characters. I guess that "employee_id" is a number. What happens if you'd use
if TO_NUMBER(:global.employeeid) = 1111 then
instead of
if :global.employeeid='1111' then

Because, as MESSAGE is never executed, none of the IF conditions is ever met.
Re: Add_List_Element [message #382156 is a reply to message #381942] Wed, 21 January 2009 03:35 Go to previous message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi sir!

All of a sudden my coding started working(before making the changes u said)..

So as of now my prob is solved ..

Thanks for your support..

Thanks and Regards,
varosh
Previous Topic: Capture Delete_record
Next Topic: how to insert duplicate values into another table.
Goto Forum:
  


Current Time: Mon Feb 10 11:55:35 CST 2025