Home » Developer & Programmer » Forms » Examples Please
Examples Please [message #86272] Thu, 16 September 2004 05:17 Go to next message
Steve
Messages: 190
Registered: September 1999
Senior Member
Hello everyone -

Could somebody be so kind as to show me exactly how to use the set_item_instance_property and get_item_instance_property?

I have a checkbox named union_cb and a textitem named union_codes.  Checkbox value is 1 for checked and 0 for not checked.  How can I use these values to enable and disable the textitem?  Thanks!

Steve
Re: Examples Please [message #86280 is a reply to message #86272] Thu, 16 September 2004 21:44 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
You may do this in your when-new-record-instance, when-new-block-instance or pos-query triggers.
For e.g. you want that if Emapname is smith then Disable check-box then do as follows in say post-query /when-new-record-instance trigger:
Declare
Begin
if :empno='SMITH' then
set_item_instance_property('blockname.chekbox',Current_record,INSERT_ALLOWED,Property_False);
('blockname.chekbox',Current_record,UPDATE_ALLOWED,Property_False);
set_item_instance_property('blockname.chekbox',Current_record,NAVIGABLE,Property_False);

else

set_item_instance_property('blockname.chekbox',Current_record,INSERT_ALLOWED,Property_True);
set_item_instance_property('blockname.chekbox',Current_record,UPDATE_ALLOWED,Property_True);
set_item_instance_property('blockname.chekbox',Current_record,NAVIGABLE,Property_True);

End If;
end;

Remeber, this will work only if you have Insert & Update allowed property set as True at Block & Item level.

HTH
Regards
Himanshu
Re: Examples Please [message #86281 is a reply to message #86272] Thu, 16 September 2004 22:58 Go to previous messageGo to next message
Ani
Messages: 56
Registered: November 2000
Member
Hi Steve,
1st of all set_item_property is used to change the property of an item say text item in a block at 1 shot. But if 2 change the property of text_item individually in a block on navigation then use set_item_instance_property.
Similary get_item_instance_property that is used to retrieve data 1 by 1 if the item in a multirecord block.

use if union_cb=1 then
set_item_instance_property('union_codes,enabaled,property_off);

i hope this will solve your problem.

all the best.

write back.

regards
Ani
Re: Examples Please [message #86321 is a reply to message #86280] Tue, 21 September 2004 05:34 Go to previous message
Steve
Messages: 190
Registered: September 1999
Senior Member
Ani and Himanshu -

Thank you for your responses! It is appreciated!
Previous Topic: HELP! PLEASE! I NEED ATTENTION!
Next Topic: how to get time from server?
Goto Forum:
  


Current Time: Mon Sep 09 17:16:27 CDT 2024