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
Megan BrooksMegan Brooks 

Javascript Custom Button - Unexpected or Invalid Token Error

Taking my first stab at creating a custom button using Javascript, and it errors out with: Unexpected or Invalid Token. Hoping someone can help me identify what I've done wrong.

We are creating the button to pass data from a multi-picklist field into another multi-picklist field (pre-populated). Here's what I've got:

var FromPickListField ="{!Marketing_Request__c.Partner_if_applicable__c}"; 
var ToPickListFieldID ="00N55000000sZGW"; 
var FromPickListField = FromPickListField.split(";"); 
var Fields = "" ; 
for (var i=0;i<FromPickListField.length;i++){ 
Fields = Fields + ToPickListFieldID+ "=" + FromPickListField[i] + "&"; 

var URL = 
&cpn1=2016 CORPMKTING - MDF - 
&00N00000006xWKO = {!Marketing_Request__c.Submitter_Name__c} 
&cpn4={!Marketing_Request__c.Description__c}%20-%20 {!Marketing_Request__c.Goal_Description__c}%20-%20 {!Marketing_Request__c.What_is_it_that_you_want_to_do__c} 
&00N37000005x2QB=1" + Fields;