How to Disable a single record in Multi Non-database block [message #501275] |
Mon, 28 March 2011 05:31 |
aheli
Messages: 10 Registered: August 2008 Location: India
|
Junior Member |
|
|
The main qn is in the subject line.
I have used the following code
GO_BLOCK('CHILD_BLK');
FIRST_RECORD;
LOOP
IF NVL(:CHILD_BLK.SELECT_FLAG,'N')='Y' THEN
V_REC_NO := GET_BLOCK_PROPERTY('CHILD_BLK',CURRENT_RECORD);
SET_ITEM_INSTANCE_PROPERTY('CHILD_BLK.ASSET_DESC',
V_REC_NO,
UPDATE_ALLOWED,
PROPERTY_FALSE
);
end if;
IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
EXIT;
END IF;
NEXT_RECORD;
END LOOP;
but of no use...
please help
[EDITED by LF: formatted code and applied [code] tags]
[Updated on: Mon, 28 March 2011 14:59] by Moderator Report message to a moderator
|
|
|
|
Re: How to Disable a single record in Multi Non-database block [message #501302 is a reply to message #501284] |
Mon, 28 March 2011 08:14 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
Paules wrote on Mon, 28 March 2011 07:53Hai,
U have mentioned as Non Database Block in the Subject Line. In that case , from where u are reading the records?
Also where u placed this code? in the Check box's WHEN_CHECKBOX_CHANGED event ?
Regards,
Paules.
Would you please stop using IM speak and spell out words properly?
|
|
|
|
How to Disable a single record in Multi Non-database block [message #501410 is a reply to message #501275] |
Mon, 28 March 2011 22:37 |
aheli
Messages: 10 Registered: August 2008 Location: India
|
Junior Member |
|
|
I have a non database multi record block.
I want to make particular records disable on statisfying some conditions. I have used SET_ITEM_INSTANCE_PROPERTY...but it is not working at all... control is going through the code but it just not working and not showing any error...
Here is my sample code,
GO_BLOCK('CHILD_BLK');
FIRST_RECORD;
LOOP
IF NVL(:CHILD_BLK.SELECT_FLAG,'N')='Y' THEN
:CHILD_BLK.SELECT_FLAG:='N';
V_REC_NO := GET_BLOCK_PROPERTY('CHILD_BLK',CURRENT_RECORD);
--V_REC_NO := :system.CURSOR_RECORD;
SET_ITEM_INSTANCE_PROPERTY('CHILD_BLK.ASSET_NO',V_REC_NO,UPDATE_ALLOWED,PROPERTY_FALSE);
SET_ITEM_INSTANCE_PROPERTY('CHILD_BLK.ASSET_DESC',V_REC_NO,UPDATE_ALLOWED,PROPERTY_FALSE);
end if;
IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
EXIT;
END IF;
NEXT_RECORD;
END LOOP;
|
|
|
Re: How to Disable a single record in Multi Non-database block [message #501416 is a reply to message #501410] |
Tue, 29 March 2011 00:39 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
You shouldn't do that in a loop. Perhaps you should try PRE-RECORD trigger. Something like this:
if nvl(:child_blk.select_flag, 'N') = 'Y' then
set_item_instance_property('child_blk.asset_no', :system.trigger_record, update_allowed, property_false);
end if;
[EDIT] Forgot to mention: you don't have to open a new topic, simply reply in existing one.
Also, you - obviously - didn't pay attention to my previous message, where I asked you to format code and enclose it into the [code] tags. Is it really too much to ask?
[Updated on: Tue, 29 March 2011 00:41] Report message to a moderator
|
|
|