disable record in data grid at oracle forms [message #263538] |
Thu, 30 August 2007 04:49 |
ashok_lila
Messages: 9 Registered: April 2006 Location: New Delhi
|
Junior Member |
|
|
Hi,
I have an data grid on oracle form and in the there is a field say Status.
I want to disable those line where status is 'Y' other they should be enabled.
Can any one tell me solution. I tried the set_record_property also but its not working.
thanks and regards
Ashok
|
|
|
|
|
|
|
Re: disable record in data grid at oracle forms [message #263582 is a reply to message #263554] |
Thu, 30 August 2007 08:01 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
ashok_lila wrote on Thu, 30 August 2007 12:59 | Did you used the old version less then 6I.
| 6i? Do people still use that? It's written in Forms [32 Bit] Version 10.1.2.0.2.
Basically I:- created a block via the block wizard. It's based on HR.EMPLOYEES.
- invoked the layout wizard and made the block a multirecord block
- added a checkbox (Y/N) just for the fun of having an extra item.
- Added an Exit button
- Wrote a couple of lines of code. See below.
Here's the content of the PL/SQL code:
WHEN-NEW-FORM-INSTANCE:
Begin
Execute_Query;
End; EMPLOYEES.POST-QUERY:
Begin
If :employees.department_id = 50 THEN
:employees.chk_test := 'N';
Disable_Item('employees.chk_test');
Disable_Item('employees.employee_id');
Disable_Item('employees.first_name');
Disable_Item('employees.last_name');
Disable_Item('employees.department_id');
End if;
End; Program unit DISABLE_ITEM
PROCEDURE Disable_Item(p_v_item IN VARCHAR2)
IS
BEGIN
Set_Item_Instance_Property(p_v_item, current_record, Update_Allowed, Property_False);
Set_Item_Instance_Property(p_v_item, current_record, Insert_Allowed, Property_False);
Set_Item_Instance_Property(p_v_item, current_record, Visual_Attribute, 'VA_DISABLED');
END; PB_EXIT.WHEN-BUTTON-PRESSED:
Begin
Exit_Form(No_Validate);
End; MHE
|
|
|
|
|