You need to sign in to do that
Don't have an account?

How to show URL field only stage(picklist) field 2 and 3 picklist options are selected on opportunity object
Hi All,
I have created picklist field with options(1,2,3,4) and url field in opportunity object..........
my requirment is when i choose 2 and 3 values in picklist the url field should be shown and when i choose 1 or 4 values the url field must be disabled or not shown...........
How can i achieve these can anyone help me...................................
Thanks Inadvance..................
If your opportunity is standard detail page then you can create two record type and pagelayout and in one-page layout show the url and another page don't show the url field.
Create a workflow rule to update the record types based on picklist value.
https://success.salesforce.com/answers?id=90630000000hBX9AAM
If you have a visualforce page the the try render the url filed like this..
Let me know if you have any question.
--
Thanks,
Prashant
All Answers
If your opportunity is standard detail page then you can create two record type and pagelayout and in one-page layout show the url and another page don't show the url field.
Create a workflow rule to update the record types based on picklist value.
https://success.salesforce.com/answers?id=90630000000hBX9AAM
If you have a visualforce page the the try render the url filed like this..
Let me know if you have any question.
--
Thanks,
Prashant
Use something like this:
let me know if it helps.
Thanks!
Please try the below code. Hope this will helps you.
<apex:page>
<apex:form id="Form1">
<apex:pageBlock id="theBlock">
<apex:pageBlockSection id="thePageSection">
<apex:selectList multiselect="false" size="1" id="theSelectList" onchange="showField();">
<apex:selectOption itemValue="0" itemLabel="None"/>
<apex:selectOption itemValue="1" itemLabel="One"/>
<apex:selectOption itemValue="2" itemLabel="Two"/>
<apex:selectOption itemValue="3" itemLabel="Three"/>
<apex:selectOption itemValue="4" itemLabel="Four"/>
</apex:selectList>
</apex:pageBlockSection>
<apex:inputText id="thetext1" style="visibility:hidden;"/>
<apex:inputText id="thetext2" style="visibility:hidden;"/>
</apex:pageBlock>
</apex:form>
<Script>
function showField()
{
var selectedvalue = document.getElementById('{!$Component.Form1:theBlock:thePageSection:theSelectList}').value;
if(selectedvalue == '2' || selectedvalue == '3')
{
document.getElementById('{!$Component.Form1:theBlock:thetext1}').style.visibility='visible';
document.getElementById('{!$Component.Form1:theBlock:thetext2}').style.visibility='visible';
}
if(selectedvalue == '1' || selectedvalue == '4')
{
document.getElementById('{!$Component.Form1:theBlock:thetext1}').style.visibility='hidden';
document.getElementById('{!$Component.Form1:theBlock:thetext2}').style.visibility='hidden';
}
}
</Script>
</apex:page>
Please mark it as best answer if you find it helpfull.
Thank You
Ajay Dubedi