You need to sign in to do that
Don't have an account?
Kushal Mishra
get field according to picklist values.
Hello guys,
Please help me, there is a picklist with three values(user,account,opportunity) and three field with same name. i want that when i select user picklist value then we would get user field and same thing should be happen for account and opprtunity picklist value and when picklist value none then there should be no any field is there. please help me.
Please help me, there is a picklist with three values(user,account,opportunity) and three field with same name. i want that when i select user picklist value then we would get user field and same thing should be happen for account and opprtunity picklist value and when picklist value none then there should be no any field is there. please help me.
If you want to implement it in VF Page,
Here is the sample code for your scenario, Create a VF page for below code and try to change Opportunity stage values to Prospecting, Closed Won and Closed Lost .
Best Regards,
Mithun.
Ok, Assume that below are the your custom object details.
1. Custom object API name is "TestObj__C".
2. Custom Picklist field API name is "TestPicklict__C" and picklist values are (Opt1, Opt2 and Opt3).
3. Custom Text field API name is "Textfield11__C".
4. Custom Text field API name is "Textfield22__C".
5. Custom Text field API name is "Textfield33__C".
Now, we have one custom object (TestObj__C) and four custom fields (TestPicklict__C, Textfield11__C, Textfield22__C and Textfield33__C).
Here is updated code for above custom object.
Best Regards,
Mithun.
thanks for this, but if i want to take controller apart from standardController then how can we do this.
please have a look this code.it is not working.
====================================vf page=============================
<apex:page Controller="Controller1 ">
<apex:form id="form1">
<apex:pageBlock id="block1">
<apex:outputPanel >
<apex:pageBlockSection id="section1">
<apex:inputField value="{!groupAlert.StageName}" id="populate" > <apex:actionSupport event="onchange" reRender="section2"/> </apex:inputField>
</apex:pageBlockSection>
<apex:pageblockSection id="section2" >
<apex:inputField value="{!groupAlert.NextStep}" rendered="{!IF(groupAlert.StageName == 'Closed Won',true,false)}" id="textpop" /> <apex:inputField value="{!groupAlert.Amount}" rendered="{!IF(groupAlert.StageName == 'Prospecting',true,false)}" id="textpop2" /> <apex:inputField value="{!groupAlert.Type}" rendered="{!IF(groupAlert.StageName == 'Closed Lost',true,false)}" id="textpop4" /> </apex:pageblockSection>
</apex:outputPanel>
</apex:pageBlock> </apex:form> </apex:page>
=======================================Controller class=====
public with sharing class Controller1 {
public TestObj__C groupAlert{get;set;}
}
==========================================================
please help ASAP.