You need to sign in to do that
Don't have an account?
Juan Romero
Displaying Picklist based on another field's value
Hey guys,
I was wondering if there is a way to make some selections available to users depending on the value they select for another field....
For instance, let's say I am creating a new lead, and I select value "x" in my "Lead Source" picklist field. I would like to be able to change the contents of the "Lead Source Detail" picklist, to display options relevant to value "x".
Can this be done in Salesforce? Is there a way of customizing it to do that?
Thank you in advance.
It's not an ideal solution but, you can do it using an scontrol. You load the salesforce page into an iframe and then setup the relationships and events to make the picklists dependent with some javascript.
I just set up some dependent picklists with the help of Matt Kruse's dynamic option list script.
http://www.mattkruse.com/javascript/dynamicoptionlist/
I'm new to this so excuse me if my questions are a bit basic. Are you saying that you have a web tab that has an scontrol in it, where the scontrol is made up off at least two iframes. One iframe has your javascript that has dependant dropdowns and the other iframe has a salesforce tab it it?
Do the two iframes interact? Via merge fields?
Regards,
Anthony.
Hi Anthony,
Yes, you can have a web tab and can set the tab type to sControl. As an example using cases, the scontrol can have the following html body:
<_body>
<_IFRAME id=testiframe name=testiframe marginWidth=0 marginHeight=0 src="/500/e" frameBorder=0 width="100%" scrolling=no onload="this.height = this.Document.body.scrollHeight;this.width= this.Document.body.scrollWidth;setup();" height="100%"/>
<_SCRIPT>
function setup() {
frames['testiframe'].document.forms['editPage']['PICKLISTFIELDNAMExxx'].value='test';
}
As you can see, you can reference the form values using javascript. Using this technique you can make dependent picklists or calculated controls.
-Steve
I don't suppose there's a way to target just the "content" part of the salesforce screen? I suspect the answer is no and you're always going to be stuck with two layers headers.
Regards,
Anthony.