Home » Developer & Programmer » Forms » LOV again change value on same row in oracle form
LOV again change value on same row in oracle form [message #673877] Fri, 14 December 2018 00:04 Go to next message
agm
Messages: 2
Registered: December 2018
Junior Member
i m using oracle form 6i...I restrict the values of my LOV, that the end user cannot select twice the same...for this i write a code on when validate trigger.now i selected value from LOV for first row but when i selected value from LOV for 2nd row it change the value of first row...cursor not move to second row automatically....
Re: LOV again change value on same row in oracle form [message #673883 is a reply to message #673877] Fri, 14 December 2018 03:34 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
You did something wrong.
But without seeing the code it's hard to guess what.
So post the code of the when-validate-item trigger.
Re: LOV again change value on same row in oracle form [message #674339 is a reply to message #673883] Tue, 22 January 2019 03:40 Go to previous messageGo to next message
agm
Messages: 2
Registered: December 2018
Junior Member
Assume the record group select order is the following:

select empno, ename from emp

The automatic refresh of the LOV must be set to NO

Assume the LOV is attached to the EMP.EMPNO item, add the following code to its When-Validate-Item trigger:

--
-- Remove the selected value from the record group
--
DECLARE
rg_id RecordGroup;
rec_count NUMBER;
BEGIN

-- Get the record group ID --
rg_id := Find_Group( 'EMP_GRP' );

-- Get the number of rows --
rec_Count := Get_Group_Row_Count( rg_id );

-- delete the selected row --
FOR j IN 1..rec_Count LOOP
If Get_Group_Number_Cell( 'EMP_GRP.EMPNO', j ) = :EMP.EMPNO Then
Delete_Group_Row( rg_id, j );
exit ;
End if ;
END LOOP;

END;
i m using this code
Re: LOV again change value on same row in oracle form [message #674342 is a reply to message #674339] Tue, 22 January 2019 05:32 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Hard to say but I suspect you've got validate_from_list on (which you should do) and the fact that you are removing items from the group is messing it up.

I never do it that way.

I write an LOV query that excludes values inserted into the table the block is based on.
I then post each record to the DB as it is entered.
Previous Topic: Validation of Value in Sales Order Form
Next Topic: Dynamic Control Of rows in a excel to oracle forms importing form
Goto Forum:
  


Current Time: Thu Mar 28 08:23:07 CDT 2024