Home » Developer & Programmer » Forms » SET RECORD PROPERTY (oracle 10g)
SET RECORD PROPERTY [message #564761] Tue, 28 August 2012 08:29 Go to next message
abdulaziznh
Messages: 8
Registered: August 2012
Location: KSA
Junior Member
hi

this from has multirecords and multiblocks for every date it shows employees' attendance record, there is a button that should disable selected records for that specific date

**part from the code**

        LOOP
            if :ATTENDANCE.SIGGNED = 'Y' AND GET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'ATTENDANCE',STATUS) = 'CHANGED' THEN
            :ATTENDANCE.LAST_UPDATED_BY:=fnd_global.user_id;
            :ATTENDANCE.LAST_UPDATE_DATE:=sysdate;
            SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'ATTENDANCE',ENABLED,PROPERTY_FALSE); 
            SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'ATTENDANCE',UPDATE_ALLOWED,PROPERTY_FALSE);
            SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'ATTENDANCE',insert_allowed,PROPERTY_FALSE);
            end if;
            EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE' ;
            NEXT_RECORD;
        END LOOP;


what happen that it is confirming that selected records are disabled AND it is NOT!!

**i can still change the records if i want **

but if I changed the date and go back "the date which i disabled its records" (reload that data) then it will be disabled

i need you guys to help me finding a way so it will be disabled immediately so i don't need to change dates to be disabled


**maybe if the is a code that will refresh records ?! i don't know !! just an idea which i search and didn't find information about it


thank you
Re: SET RECORD PROPERTY [message #564808 is a reply to message #564761] Tue, 28 August 2012 17:40 Go to previous messageGo to next message
cookiemonster
Messages: 10846
Registered: September 2008
Location: Rainy Manchester
Senior Member
I think you've got an on-error trigger that is hiding all errors. You should remove it.
I say that because the following are completely invalid:
SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'ATTENDANCE',ENABLED,PROPERTY_FALSE); 
SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'ATTENDANCE',UPDATE_ALLOWED,PROPERTY_FALSE);
SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'ATTENDANCE',insert_allowed,PROPERTY_FALSE);


Set_record_property does not recognize any of those properties. Each one must cause an error. So you must have something that hides the errors.
When using a forms built-in it pays to look up what it does in form builder help. Look up set_record_property in it and see what it really does.
Then look up the update_allowed property and see which built-ins allow you to set it. Then you should be able to write some code that actually works.
Re: SET RECORD PROPERTY [message #565236 is a reply to message #564808] Sat, 01 September 2012 01:29 Go to previous messageGo to next message
abdulaziznh
Messages: 8
Registered: August 2012
Location: KSA
Junior Member
i used

SET_ITEM_INSTANCE_PROPERTY('block.item',CURRENT_RECORD,ENABLED,PROPERTY_FALSE);

and i got the same problem it wont be disable until i change record the come back
Re: SET RECORD PROPERTY [message #565239 is a reply to message #565236] Sat, 01 September 2012 03:05 Go to previous messageGo to next message
Littlefoot
Messages: 19314
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
ENABLED is not a valid property for SET_ITEM_INSTANCE_PROPERTY built-in (so you can't expect it to "work").

As you can't disable a record, you'll have to disable all its items, one by one. I don't have Forms here so I can't test it, but here's an idea: create a PRE-RECORD trigger which would disable items:
if some_condition then
   set_item_property('block.item', enabled, property_false);
else
   set_item_property('block.item1', enabled, property_true);
   -- propagated properties
   set_item_property('block.item1', navigable, property_true);
   set_item_property('block.item1', updateable, property_true);
   ...

   set_item_property('block.item2', enabled, property_true);
   -- propagated properties
   set_item_property('block.item2', navigable, property_true);
   set_item_property('block.item2', updateable, property_true);
   ...

end if;

Note that setting the ENABLED property to FALSE causes some other properties to "disabled" status (such as NAVIGABLE and UPDATEABLE), so you'll need to enable them back. See "Propagation of Property Changes" section in Forms Help for more information.
Re: SET RECORD PROPERTY [message #565241 is a reply to message #565239] Sat, 01 September 2012 03:38 Go to previous message
abdulaziznh
Messages: 8
Registered: August 2012
Location: KSA
Junior Member
i solve the problem but the checkbox is not disabled unless i disable all the records


solution:

go_block()
execute_query
Previous Topic: email send from oracle 6i
Next Topic: CLIENT_OLE2.CREATE_OBJ('Excel.Application') not working
Goto Forum:
  


Current Time: Fri Jul 25 16:13:41 CDT 2014

Total time taken to generate the page: 0.15123 seconds