Home » Developer & Programmer » Forms » How to Disable a single record in Multi Non-database block (oracle forms 6i)
How to Disable a single record in Multi Non-database block [message #501275] Mon, 28 March 2011 05:31 Go to next message
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 #501284 is a reply to message #501275] Mon, 28 March 2011 06:53 Go to previous messageGo to next message
Paules
Messages: 128
Registered: March 2011
Location: United Arab Emirates
Senior Member
Hai,

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.
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 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Paules wrote on Mon, 28 March 2011 07:53
Hai,

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?
Re: How to Disable a single record in Multi Non-database block [message #501396 is a reply to message #501302] Mon, 28 March 2011 15:02 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
@Aheli: I don't think that you can do that (i.e. disable one record in a multi-record block).

What you might do is to modify properties of all ITEMS that belong to that record. In order to do that, you'd use SET_ITEM_INSTANCE_PROPERTY built-in.

Also, for your next messages: please, format them properly and enclose into [code] tags to preserve formatting. Doing so, code will be easier to read and understand. If you are not sure how to do that, check this short example.
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 Go to previous messageGo to next message
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 Go to previous message
Littlefoot
Messages: 21818
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

Previous Topic: How can I create a "browse for file to upload"-window?
Next Topic: Form Builder
Goto Forum:
  


Current Time: Tue Sep 17 05:05:08 CDT 2024