You need to sign in to do that
Don't have an account?
Kiru535
Update multiselect picklist based on lookup field in VF page
Please help me ASAP to solve this scenario.
I have one VF page on that we have a look up field and Multiselect picklist. When ever user selects the lookup field from the custom object, automatically the corresponding picklist values should be updated. Here all are custom objects.
Please help me ASAP.
Regards,
kk
The corresponding picklist values should be updated with what ? Is there a save button on clicking which the selected values from multiselect picklist will be updated? Could you paste your code.
I have lookup field called IBX name ( Lookup field refering to IBX object) and Compitator (Custom multi select picklist field) on vf page.
Click on new - The VF page will open with new
User enter the details and after he enter the Lookup field, Immediately the picklist values should be displayed for the competator field. otherwise picklist values will be null.
<apex:page standardController="IBX_Lines__c">
<apex:sectionHeader title="IBX_Lines__c Edit" subtitle="{!IBX_Lines__c.name}"/>
<apex:form >
<apex:pageBlock title="IBX_Lines__c Edit" mode="edit">
<apex:pageBlockButtons location="top">
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Save & New" action="{!save}" />
<apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons> <apex:pageBlockButtons location="bottom">
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Save & New" action="{!save}" />
<apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Information" columns="2">
<apex:inputField value="{!IBX_Lines__c.Name}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.CurrencyIsoCode}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.Opportunity__c}" required="true"/>
<apex:inputField value="{!IBX_Lines__c.Primary_Campaign_Source__c}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.IBX_Name__c}" required="true"/>
<apex:inputField value="{!IBX_Lines__c.Lead_Source__c}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.Line_Type__c}" required="true"/>
<apex:inputField value="{!IBX_Lines__c.Cross_Region_Lead_Source__c}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.Adjustment_Type__c}" required="false"/>
</apex:pageBlockSection> <apex:pageBlockSection title="Status" columns="2">
<apex:inputField value="{!IBX_Lines__c.Forecast_Status__c}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.Closed_Won_Lost_Notes__c}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.Lost_Reason__c}" required="false"/>
</apex:pageBlockSection> <apex:pageBlockSection title="MRR/NRR" columns="2">
<apex:inputField value="{!IBX_Lines__c.Forecast_MRR__c}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.Forecast_NRR__c}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.Booked_Gross_MRR__c}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.Booked_Gross_NRR__c}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.Booked_Net_MRR__c}" required="false"/>
<apex:inputField value="{!IBX_Lines__c.Booked_Net_NRR__c}" required="false"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Competitors" columns="2">
<apex:inputField value="{!IBX_Lines__c.Competitors__c}" required="false"/>
</apex:pageBlockSection> <apex:pageBlockSection title="Comments" columns="2">
<apex:inputField value="{!IBX_Lines__c.Comments__c}" required="false"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
the code should work something like this :
When the look up field is null, the picklist will not be visible( done with the rendered attribute on the picklist field). When you choose some value in the look up field, the action support tag will rerender the pageblock and the piclist will be displayed.
Thanks for your reply.
My requirement was
If the llokup field value ="Bangalore" picklist value should be "MG road" , "Marthalli"
If the llokup field value ="Hydearbad" picklist value should be "Banjara Hills" , "Jublihills" in the picklist.
So based on the lookup value, Picklist value need to be change
Please help me how to do this?
You will have to create an extension class to this vf page so that u can do the manipulation in a method..
VF Page : Set the action attribute of the action support to a method say (setPick)set the correct values for the picklist.
Hi,
Above code not working. you have hardcoded the values. as part of my requirement I have more that 20 lookup values. For each lookup we have to display different set of values.
Can you provide me the exact solution.
Regards,
Kiran
Are able to implement this requirement , i am also having the same requirement, if u have done requirement please help me on this.
Regards,
Sukanth