Home » Developer & Programmer » Forms » How to enable update of an item within disabled block (disabled for update) (Forms 6i)
How to enable update of an item within disabled block (disabled for update) [message #425144] Wed, 07 October 2009 14:42 Go to next message
sindikalac
Messages: 52
Registered: November 2008
Location: Europe
Member
Hi,

I have a data block, and I had to disable that block for updates if condition is satisfied.

So I included this code into When-New-Forme-Instance

IF :MYBLOCK.STATUS=1 THEN
	   Set_Block_Property('MYBLOCK',UPDATE_ALLOWED,PROPERTY_FALSE);


This works fine. But, now I need to allow just one item to be updateable within that block. Other items shouldn't be updateable. So I tried this:


IF :MYBLOCK.STATUS=1 THEN
	   Set_Block_Property('MYBLOCK',UPDATE_ALLOWED,PROPERTY_FALSE);
Set_Item_Property('MYBLOCK.ITEM1',UPDATE_ALLOWED,PROPERTY_FALSE);


That didn't work, so I changed that into:

IF :MYBLOCK.STATUS=1 THEN
	   Set_Block_Property('MYBLOCK',UPDATE_ALLOWED,PROPERTY_FALSE);
Set_Item_Property('MYBLOCK.ITEM1',UPDATEABLE,PROPERTY_FALSE);


I tried different variations with enabled, updateable, update_allowed properties, but nothing worked.

Any idea?
Re: How to enable update of an item within disabled block (disabled for update) [message #425207 is a reply to message #425144] Thu, 08 October 2009 01:08 Go to previous messageGo to next message
omaribais
Messages: 34
Registered: October 2009
Location: Bangladesh
Member

hi sindikalac,

If you use the code Set_Block_Property('MYBLOCK',UPDATE_ALLOWED,PROPERTY_FALSE);
you can't make update_allowed any item in "MYBLOCK" unless you use
Set_Block_Property('MYBLOCK',UPDATE_ALLOWED,PROPERTY_TRUE);. But through this command all item would be update_allowed.

Under your condition you can repeat
Set_Item_Property('MYBLOCK.ITEM...',UPDATE_ALLOWED,PROPERTY_FALSE);

above line for all displayed item of your block. And for item1 you have to use
Set_Item_Property('MYBLOCK.ITEM1',UPDATE_ALLOWED,PROPERTY_TRUE);

So the code should be,
IF :MYBLOCK.STATUS=1 THEN
Set_item_Property('MYBLOCK.item2',UPDATE_ALLOWED,PROPERTY_FALSE);
Set_Item_Property('MYBLOCK.item3',UPDATE_ALLOWED,PROPERTY_FALSE);
.
.
.
Set_Item_Property('MYBLOCK.ITEM1',UPDATE_ALLOWED,PROPERTY_TRUE);

- Omar
icon7.gif  Re: How to enable update of an item within disabled block (disabled for update) [message #425211 is a reply to message #425207] Thu, 08 October 2009 01:23 Go to previous messageGo to next message
sindikalac
Messages: 52
Registered: November 2008
Location: Europe
Member
Thank you Omar. I assumed it would be a solution, but I was hoping there is a simpler way, because I have a lot of items.
Re: How to enable update of an item within disabled block (disabled for update) [message #427056 is a reply to message #425211] Tue, 20 October 2009 19:08 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
If you only have one item that needs to be made updateable, then define all the items with 'Update Allowed' as 'No' and then just 'turn on' the ones you need.

You can also 'loop' through the items in a block using 'Next Navigation Item', etcetera.

David
Previous Topic: problem Webutil WEBUTIL_FILE.FILE_SELECTION_DIALOG_INT will not work
Next Topic: Lost connection to database from application
Goto Forum:
  


Current Time: Sat Dec 10 20:37:13 CST 2016

Total time taken to generate the page: 0.08161 seconds