Assign Picklist value to another Picklist

Assign Picklist value to another Picklist

Post by RGFuaWVsIF » Fri, 10 Jun 2005 04:46:20


I have 2 picklist (territorycode and Listado) and i want to add the value
selected of territorycode picklist into listado picklist
Could be something like this in the Onchange Event...

crmForm.territorycode.value=crmForm.CFPListado.value;

but didn`t work. Any suggestions?
Thanks in advance.

Daniel Rodriguez
SMS - Argentina
 
 
 

Assign Picklist value to another Picklist

Post by RGF2aWQgSm » Fri, 10 Jun 2005 18:19:12

Try using the returnValue property, e.g.:

crmForm.territorycode.returnValue=crmForm.CFPListado.returnValue;

 
 
 

Assign Picklist value to another Picklist

Post by RGFuaWVsIF » Fri, 10 Jun 2005 22:49:02

Hell David. I tried that you say me, but not luck. Could be because the
second Picklist was in the CRM (i dont create the second, just take and punt
in the form)?. Thanks in advance.

Daniel Rodriguez
SMS - Argentina
 
 
 

Assign Picklist value to another Picklist

Post by Q2Fycm9sbC » Fri, 10 Jun 2005 23:18:02


If you are using scripting in the Onchange event, MSCRM does not allow you
to ADD values from one picklist to another. Meaning, that if one of your
picklists do NOT have any values assign to it, you cannot add values through
scripting.
You can SET the value of one picklist according to the selected value of
another picklist. In order for this to work, both picklist must already have
values assigned.


Your first line "crmForm.territorycode.value=crmForm.CFPListado.value"
assigns the Text value of the picklist.
The Second line
"crmForm.territorycode.returnValue=crmForm.CFPListado.returnValue" assigns
the integer value of the picklist. To properly set the value of a picklist,
both lines are necessary in your script followed by an explicit "click()"
like this...

crmForm.territorycode.value=crmForm.CFPListado.value;
crmForm.territorycode.returnValue=crmForm.CFPListado.returnValue;
crmForm.territorycode.click();
--
Carroll Little
Vis.align, LLC
www.visalign.com