function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AnthonyAnthony 

S-Control or Custom Link Pre-Populate Multi-Select Picklist Team Edition Problem

I'm trying to copy some values from one multi-select picklist to another.  I'm using an S-Control, but am open to anything that might work that doesn't require the API.  I am trying to pass some multi-select picklist data from the Contact form to another custom related list form.
 
I'm using Team Edition, so do not have access to the API.  Crippleware.  At least S-Controls are available!
 
The API seems to allow for the passing of multiple values to a picklist field by having each value seperated by a semi-colon.  This method does not seem to work with a Custom Link solution, unless I'm missing something.  While the example below works, it does not work correctly as the semi-colons are displayed rather than acting as delimiters.  For example, if I have two values selected, say "Wholesaler" and "Broker", the final copied value displays in the target multi-select picklist as "Wholesaler;Broker" rather than being broken into two different lines & values.  Here is my S-Control code:
 
 
Code:
<html>
<head>
</head>
<body onLoad="document.myForm.submit()"> 
<form method="POST" action="/a04/e" name="myForm"> 
<input type=hidden name="retURL" id="CF00N50000001U9bd_lkid" value="/{!Contact.Id}">
<input type=hidden name="CF00N50000001U9bd_lkid" id="CF00N50000001U9bd_lkid" value="{!Contact.Id}"> 

<input type=hidden name="CF00N50000001U9bd" id="CF00N50000001U9bd" value="{!Contact.Name}"> 
<input type=hidden name="CF00N50000001U9bc" id="CF00N50000001U9bc" value="{!Account.Name}"> 
<input type=hidden name="00N50000001U9ba" id="00N50000001U9ba" value="{!Contact.Start_Date__c}"> 

<input type=hidden name="00N50000001UB3a" id="00N50000001UB3a" value="{!Contact.Position__c}"> 

<input type=hidden name="00N50000001U9bb" id="00N50000001U9bb" value="{!Contact.Position_Description__c}"> 

</body>
</html>

 
The multi-select picklist is from {!Contact.Position__c} and is being written to 00N50000001UB3a.
 
Suggestions to a workaround or fix are very welcome!
 
Thanks,
 
Anthony
AnthonyAnthony

<rant>

I am frustrated by the apparent lack of support for Team Edition developers. 

And the pricing hit you take to get API access feels rather insane for small businesses (10 Users).

I am new to the salesforce environment.  My JavaScript skills are "intermediate" at best, though

I am persistent and google is my buddy.

I emailed this issue to a contact at Salesforce, Colin Berta, and his reply was "Looks as though

we are out of luck on passing multiple picklist values within a link or s-control.  I've consulted our

experts here, and it simply can't be done currently."

I am not impressed.:smileymad:

</rant>

On a positive note, I'd like to contribute the following to the salesforce community:

I've figured out a way to  pass Multi-Select Picklist values from one form to another. 

This example is passing some Multi-Select Picklist values from some custom fields I created on the

Contacts form to a custom form I developed to track prior work history.

Hope this code is useful to some of you!!:smileyvery-happy:

Anthony

Code:
<html> 
<head> 
</head> 
<body onLoad="document.myForm.submit()"> 
<form method="POST" action="/a04/e" name="myForm"> 
<input type=hidden name="retURL" id="CF00N50000001U9bd_lkid" value="/{!Contact.Id}"> 
<input type=hidden name="CF00N50000001U9bd_lkid" id="CF00N50000001U9bd_lkid" value="{!Contact.Id}"> 

<input type=hidden name="CF00N50000001U9bd" id="CF00N50000001U9bd" value="{!Contact.Name}"> 
<input type=hidden name="CF00N50000001U9bc" id="CF00N50000001U9bc" value="{!Account.Name}"> 
<input type=hidden name="00N50000001U9ba" id="00N50000001U9ba" value="{!Contact.Start_Date__c}"> 
<input type=hidden name="00N50000001U9bb" id="00N50000001U9bb" value="{!Contact.Position_Description__c}"> 

<script type='text/javascript'> 
{ 
//These merge variables are filled in by the server prior to javascript
//execution.
var myPosition = '{!Contact.Position__c}'; 
var myTerritory = '{!Contact.Territory__c}'; 
var myProducts = '{!Contact.Products__c}'; 
var myChannels = '{!Contact.Distribution_Channels__c}'; 

//alert("Remember to fill in the To Date!"); 

// Position 
var myString = myPosition; 
var mySplitResult = myString.split(";"); 
for(i = 0; i < mySplitResult.length; i++){ 
document.write('<input type=hidden name="00N50000001UB3a" id="00N50000001UB3a" value="' + mySplitResult[i] + '">'); 
} 

// Territory 
myString = myTerritory; 
mySplitResult = myString.split(";"); 
for(i = 0; i < mySplitResult.length; i++){ 
document.write('<input type=hidden name="00N50000001VHGC" id="00N50000001VHGC" value="' + mySplitResult[i] + '">'); 
} 

// Products 
myString = myProducts; 
mySplitResult = myString.split(";"); 
for(i = 0; i < mySplitResult.length; i++){ 
document.write('<input type=hidden name="00N50000001UB51" id="00N50000001UB51" value="' + mySplitResult[i] + '">'); 
} 

// Channels 
myString = myChannels; 
mySplitResult = myString.split(";"); 
for(i = 0; i < mySplitResult.length; i++){ 
document.write('<input type=hidden name="00N50000001UMNQ" id="00N50000001UMNQ" value="' + mySplitResult[i] + '">'); 
} 


} 
</script> 

</body> 
</html>

 


 

Message Edited by DevAngel on 03-01-2007 09:38 AM