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
MrithulaMrithula 

Text field dependency

Hi,

 

iam new to salesforce and have been learning for past 1 month. i wonder how to create dependency field for textbox.

 

 

for example:  i have a picklist with 2 values 

                          1.Nurse

                          2.Doctor

 

If i choose doctor 

 

following textfields should be active.

 

1.operation details

2.patient to operate on

3.type of operation etc,..

 

can anyone explain me clearly, to understand it easily

 

venkateshyadav1243venkateshyadav1243

Hi You can create like the depedency fields

 

 

First create one field(Data type' Pick list')[here let say fields name 'Hospital' values are 1.nurse,2.values]

create anther field(data type multi pick list) [here field name 'position' values

1.operation details

2.patient to operate on

3.type of operation etc,..

4.something

]

 

after creating these values in the custom filed and relation ship you can see "Filed dependency "

 

clcik on that  select new after you can see two fields controlling filed dependent field

 

here in the place of controlling select hospital field and in the place of dependent field select position

 

after it will open all the values select  which values you want show for doctor and nurse ,and click include values and save.

 

 

 

venkatesh

www.360degreecloud.com

 

 

MrithulaMrithula

hi  venkatesh ,

 

Thanks...

 

Actually i know to do field depenencies in picklist.

 

but my requirement is to create field dependency for text field.

 

As i mentioned already , if choose DOCTOR in Picklist...

 

Some textfields should be Active

 

i.e  i want field dependency between textfield and Picklist

venkateshyadav1243venkateshyadav1243

Hi

You need write formul field  Or You have to show in visualforce page these pick list values

 

 

Venkatesh

www.360degreecloud.com

MrithulaMrithula

hi,

 

i want to show in visualforce page .

venkateshyadav1243venkateshyadav1243

hi

 

first create filed dependency

 

after do this

 

<apex:page standardController="Account">
    <apex:form >
        <apex:pageBlock mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Dependent Picklists" columns="2">
            <apex:inputField value="{!account.Hosiptal__c}"/>  // Here your controlling filed
            <apex:inputField value="{!account.opeartin_details__c}"/> // here your dependent field
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

Venkatesh

www.360degreecloud.com

MrithulaMrithula

hi venkatesh,

 

 i think you didn't get my point.

 

from the begining iam asking " How to create Field Dependency between TEXTFIELD and PICKLIST"

Jeff MayJeff May

You can't create a dependency in the sense of 'enabling' or 'disabling' the text field.  You can create a validation Rule that makes sure there is a value in a text field when a picklist choice has been made.

MrithulaMrithula

hi Jeff,

 

Thanks for your timely help...

 
Janet GuoJanet Guo

Mrithula, since you say you're new, I just wanted to make sure you understand what venkateshyadav is getting at.

 

The native/out-of-the-box functionality for dependent picklists in Salesforce is limited to either a picklist or a checkbox as the controller and only a picklist can be the dependent. You cannot, using Salesforce's default functionality, build something like what you are suggesting. I'm not sure I understand exactly what you would like to do, but if you want to do something such as activating certain fields, you'll need to build a custom visualforce page. 

Sumit@TCSSumit@TCS

Hi All,

 

 

You can render any field based on picklist value in VF Page....but you cant do this using standard functionality.

 

                            <apex:pageBlockSectionItem rendered="{!method.picklist_field=='Hospital'}">
                                 <apex:outputLabel value="Label/>   
                                  <apex:inputField id="InputField" value="{!method.Textfield}"/>
                            </apex:pageBlockSectionItem>

 

 

Thanks

Sumit

ShahTheTrainerShahTheTrainer

can you elaborately explain the requirement??

Somya TiwariSomya Tiwari
As far as i have understood your requirement. You have only way is to use VisualForce pages. With VF Pages you can hide and show fields based on the value of one or more picklist.

Regards,
Somya Tiwari