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
Gopi NaiduGopi Naidu 

Making a look up field based on the values of the picklist values of the other field

Hi Everyone,

 

                    I have a requirement and getting some confusion to slove this.

 

I have a custom object  'A', having two fileds 1 and 2 .

 1--> picklist type

My rquirement is to make a field 2 as look up field on case object field 'priority'

Based on the pick list value of the filed 1, i have to look up on case object's different fields.


Note: the objects A and Case dont have any relationship

 

 

Thanks

PremanathPremanath

Hi Gopi,

You can achive follow my code in Mozilla Browser...

 

<apex:page standardController="Application__c">
<apex:form >
<apex:pageBlock >

<apex:pageBlockSection title="Student Info">
<apex:inputField value="{!Application__c.Name}"/>

<apex:outputPanel >
<apex:pageBlockSection >
<apex:inputField value="{!Application__c.Qualification__c}"/>
</apex:pageBlockSection>
<apex:actionSupport event="onchange" reRender="Sal" status="Ap"/>
</apex:outputPanel>
</apex:pageBlockSection>

<apex:outputPanel id="Sal">
<apex:pageBlockSection title="Education Details" rendered="{!Application__c.Qualification__c=='BE/B-Tech'}"  >

<apex:inputField value="{!Application__c.contact__c}"/><br/>

 

 

</

</

 

TechTrackerTechTracker

1) It looks like the second field retrieves values of a field from Case object. So 2 field would be a picklist instead of look-up as there is no relation between both.

2) Use output panels and AJAX to refresh the second picklist and populate based on the selected values in the first picklist.