SET RECORD PROPERTY [message #564761] |
Tue, 28 August 2012 08:29 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/9552731341552c107be9eac27f03c949?s=64&d=mm&r=g) |
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 message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 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 #565239 is a reply to message #565236] |
Sat, 01 September 2012 03:05 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 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.
|
|
|
|