disable text item based on value in previous text item [message #640451] |
Tue, 28 July 2015 13:47 |
rkhatiwala
Messages: 178 Registered: April 2007
|
Senior Member |
|
|
Hi,
In my form i have user_name, region, case_type.
User can have either region or case-type, so i want to disable case-type if region is populated, and if region is skipped and user goes on to populate case-type, it should make the previou item - region - disabled/grey.
I tried to put the following code in couple of triggers, but it is not disabling, and sometimes getting FRM-40105 error.
if :rav_regions.region is not null then
SET_ITEM_PROPERTY(':rav_regions.case_type',ENABLED,PROPERTY_FALSE);
SET_ITEM_PROPERTY(':rav_regions.case_type',VISUAL_ATTRIBUTE,'VA_NAME');
end if ;
This should be the case whenever a new record is created.
Thanks,
RK
|
|
|
|
Re: disable text item based on value in previous text item [message #640454 is a reply to message #640453] |
Tue, 28 July 2015 16:11 |
rkhatiwala
Messages: 178 Registered: April 2007
|
Senior Member |
|
|
I have this,
if :rav_regions.region is not null then
:rav_regions.case_type := NULL ;
-- set_item_instance_propery('case_type', current_record, INSERT_ALLOWED, property_false);
end if;
I want to use set_item_instance_property, but it is giving error saying " set_item_instance_propery has to be decalred".
|
|
|
|
Re: disable text item based on value in previous text item [message #640506 is a reply to message #640454] |
Wed, 29 July 2015 13:39 |
|
CraigB
Messages: 386 Registered: August 2014 Location: Utah, USA
|
Senior Member |
|
|
Quote:if :rav_regions.region is not null then
:rav_regions.case_type := NULL ;
-- set_item_instance_propery('case_type', current_record, INSERT_ALLOWED, property_false);
end if;
Is there more than one instance of the :RAV_REGIONS.CASE_TYPE item? I got the impression from your description that there is only 1 instance of the CASE_TYPE and REGION items and only one should be enabled if the other has a value. This being the case, you should be using the SET_ITEM_PROPERTY() built-in not the SET_ITEM_INSTANCE_PROPERTY() built-in. The "INSTANCE" version of the built-in is for use when you have an item in a Multi-Row Block.
Quote:I tried to put the following code in couple of triggers, but it is not disabling, and sometimes getting FRM-40105 error.
Which triggers?
Quote:This should be the case whenever a new record is created.
If you disable CASE_TYPE in the When-New-Record-Instance, then how can your user choose between which one to use? You should do this in the When-Validate-Item instead so the user can choose between the two options.
Craig...
|
|
|