Home » Developer & Programmer » Forms » HOW TO ENABLE ONE FIRST RECORD ITEM UNDER ONE BLOCK WITH MULTIPLE RECORDS? (merged) (ORACLE FORMS 10G)
HOW TO ENABLE ONE FIRST RECORD ITEM UNDER ONE BLOCK WITH MULTIPLE RECORDS? (merged) [message #485498] Wed, 08 December 2010 10:56 Go to next message
martjosh
Messages: 13
Registered: December 2009
Location: Riyadh
Junior Member
Hi Brothers,
I'm using Oracle forms 10g. In the form i have this multiple records under one block. After performing the query, all records are cannot be updated. And i have this buttons at the right side that will enable the certain item that can only be updated. My problem is i cannot enable the item in the first record,instead of first record all records in that item was enable.

Hope someone can help me to this. Attached are just example of how my forms look like.

Thank you.


  • Attachment: untitled.JPG
    (Size: 34.23KB, Downloaded 881 times)
Re: HOW TO ENABLE ONE FIRST RECORD ITEM UNDER ONE BLOCK WITH MULTIPLE RECORDS? (merged) [message #485505 is a reply to message #485498] Wed, 08 December 2010 11:13 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
use set_item_instance_property
Re: HOW TO ENABLE ONE FIRST RECORD ITEM UNDER ONE BLOCK WITH MULTIPLE RECORDS? (merged) [message #485507 is a reply to message #485505] Wed, 08 December 2010 11:15 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
And stop re-posting your question. We got it the first time.
Re: HOW TO ENABLE ONE FIRST RECORD ITEM UNDER ONE BLOCK WITH MULTIPLE RECORDS? (merged) [message #485611 is a reply to message #485507] Thu, 09 December 2010 01:06 Go to previous messageGo to next message
martjosh
Messages: 13
Registered: December 2009
Location: Riyadh
Junior Member
Sorry bro. for reposting it. It was not my intension to repost it. During posting my browser is hang. Thank you.
Re: HOW TO ENABLE ONE FIRST RECORD ITEM UNDER ONE BLOCK WITH MULTIPLE RECORDS? (merged) [message #485919 is a reply to message #485611] Sat, 11 December 2010 10:01 Go to previous messageGo to next message
martjosh
Messages: 13
Registered: December 2009
Location: Riyadh
Junior Member
Under block1 in the when-new-record-instance trigger i put this validation to disable the item for update allowed

if :block1.item1 = 'C'
then
set_item_property('block1.item2',update_allowed,property_false);
else
set_item_property('block1.item2',update_allowed,property_true);
end if;


// ---- ///

in the when-button-pressed i put this validation to enable the the first item in the first record but still it doesn't work. What should be the proper placement of this validation? Please help. Thank you

if :block1.item1 = 'C'
then
go_block('block1');
set_item_instance_property('block1.item2',current_record,update_allowed,property_true);
go_item('block1.item3');
else
go_block('block1');
set_item_instance_property('block1.item2',current_record,update_allowed,property_false);
end if;

[Updated on: Sat, 11 December 2010 10:02]

Report message to a moderator

Re: HOW TO ENABLE ONE FIRST RECORD ITEM UNDER ONE BLOCK WITH MULTIPLE RECORDS? (merged) [message #485923 is a reply to message #485919] Sat, 11 December 2010 14:58 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Define doesn't work - can you update the item or not? Do you get any errors?

I can't see anything obviously wrong with the code, so you need to debug it.
Put messages in the triggers and check they're running the code you think they're running, on the correct record.
Also use get_item_property and get_item_instance_property to double check the properties are set correctly.
Re: HOW TO ENABLE ONE FIRST RECORD ITEM UNDER ONE BLOCK WITH MULTIPLE RECORDS? (merged) [message #485969 is a reply to message #485923] Sun, 12 December 2010 05:28 Go to previous messageGo to next message
martjosh
Messages: 13
Registered: December 2009
Location: Riyadh
Junior Member
I didn't get any errors but it doesn't allow me to update. I put also validation in any possible ways and somehow it returns true for get_item_instance_property. I put also validation to return message whether it's in the right current_record and it shows correctly. When i tried using VISUAL_ATTRIBUTE in set_item_instance_property it working fine, only the update allowed doesn't work.
Re: HOW TO ENABLE ONE FIRST RECORD ITEM UNDER ONE BLOCK WITH MULTIPLE RECORDS? (merged) [message #485972 is a reply to message #485969] Sun, 12 December 2010 06:09 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
From form builder help topic on set_item_instance_property:
Quote:

setting UPDATE_ALLOWED to true has no effect at the item instance level unless it is set consistently at the block, item, and item instance levels.


Change your when-new-record-instance trigger to use set_item_instance_property instead of set_item_property.

It's always a good idea to read the help topic on the built-in you want to use. It gives a complete usage list, along with exceptions and examples.
Re: HOW TO ENABLE ONE FIRST RECORD ITEM UNDER ONE BLOCK WITH MULTIPLE RECORDS? (merged) [message #485974 is a reply to message #485972] Sun, 12 December 2010 06:22 Go to previous message
martjosh
Messages: 13
Registered: December 2009
Location: Riyadh
Junior Member
Now its working sir. Thank you. Smile
Previous Topic: Range of Values
Next Topic: How to set MS Word document's header and footer using Forms 6i?
Goto Forum:
  


Current Time: Thu Sep 19 14:00:47 CDT 2024