function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dave@FPDave@FP 

Text field dependency

So far from everything I've read (been searching around for quite awhile now) you can't make a field dependency for text fields. The controlling field would still be a picklist ("Products") but the dependent field would be a text field called "Other". My company has 6 standard products we sell, but once in awhile something will be ordered that is different but a rare occasion (so it doesn't make sense to add it to the perminent list) - typically it's supplemental to the product we sell, like say a box of cable ties or something. Basically if they choose "other" from the product picklist, it will enable the "Other" text field to be filled in - else it disables the field.

Can this still be done or am I just S.O.L.? I'm kind of surprised that all fields are not allowed to be selected for the dependent field, really.
Best Answer chosen by Admin (Salesforce Developers) 
RickyGRickyG
The problem is changing the appearance of a page while the user is on the page - a partial page refresh.  You can do this with Visualforce pages fairly easily, but you can't with the standard production platform at this time.  Visualforce is in Developer Preview at this time.

You could accomplish the same functional result by adding a validation on the text field - if the value of the picklist was other, a value is required in that field.  This would not hide the field if 'Other' were not selected, but it would force the user to enter a value in the field if 'Other' were selected.

Of course, you could create your own page with AJAX, accessing Force.com data through the API, but this is a fair amount of effort. 

Hope this helps.

All Answers

RickyGRickyG
The problem is changing the appearance of a page while the user is on the page - a partial page refresh.  You can do this with Visualforce pages fairly easily, but you can't with the standard production platform at this time.  Visualforce is in Developer Preview at this time.

You could accomplish the same functional result by adding a validation on the text field - if the value of the picklist was other, a value is required in that field.  This would not hide the field if 'Other' were not selected, but it would force the user to enter a value in the field if 'Other' were selected.

Of course, you could create your own page with AJAX, accessing Force.com data through the API, but this is a fair amount of effort. 

Hope this helps.
This was selected as the best answer
kmckay9kmckay9

I'm trying to accomplish this same thing here...

 

I have a picklist entitled "Picklist" and I have a text field entitled "Picklist - Other".

 

IF Picklist = Other, than "Picklist - Other" needs be required.


Can someone assist with the syntax?

 

Here's a start... IF(Picklis__c = "Other",  Picklist_Other__c is required, nothing)


Thanks.

AMartinAMartin

Hi,

 

Try this as a validation rule.  Basically, if the Picklist value equals "Other" and the Picklist_Other field is blank, you'll get an error.

 

 

AND(
ISPICKVAL( Picklist, "Other"), 
Picklist_Other ="" 
)

 

 

hth.

 

Aiden

kmckay9kmckay9

Thanks - it works!!