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
raj345raj345 

Display inputField values based on the value of the first input Field

Hi,

I have a database seup like "c is a lookup to b" and "b is a lookup to a"

Example data
a1 has b1, b2, b3
a2 has b4, b5, b6

My Code
<apex:page standardController="c" >
          <apex:inputField value="{!c.b.a__c} />
          <apex:inputField value="{!c.b__c} />
</apex:page>

My question is, If I select a1 in the first inputField, I want to show only b1, b2, b3 in the second input field, not all the values in the b.

Any help will be appreciated.

Thanks,
Raj.

vishal@forcevishal@force

Input field allows a user to enter values, it's a user-input thing.

 

You might look into Dependent picklists, where one of your picklists(controlling) controls the values to be displayed in the other picklist (dependent).

 

Some more details here