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
ACXadminACXadmin 

Multi-select list button to submit leads to 3rd party endpoint

I wrote this code for a button used in a single record and it works. however I need this same procedure to work for a multi select list button. I tried all options, but cannot get my head around it. 

 

CODE

 

params = {
"FirstName" :'{!Lead.FirstName}',
"Product": "WXXXX",
"LastName": '{!Lead.LastName}',
"Email": '{!Lead.Email}',
"Telephone": '{!Lead.Phone}',
"Company": '{!Lead.Company}',
"ReceiveNewsletter": true,
"ReceiveOtherNews": true,
"IsReseller": false,
"DoNotDistribute": false,
"DoNotContact": false,
"IP": "1.1.1.255",
"REDIRECT": "https://eu2.salesforce.com/00Q/o"
};
var form = document.createElement('form');
form.setAttribute('method', 'post');
form.setAttribute('action', 'https://MY.END.POINT.URL.com');
form.setAttribute('target', '_self');

for(var key in params) {
if(params.hasOwnProperty(key)) {
var hiddenField = document.createElement('input');
hiddenField.setAttribute('type', 'hidden');
hiddenField.setAttribute('name', key);
hiddenField.setAttribute('value', params[key]);
form.appendChild(hiddenField);
}
}

document.body.appendChild(form);
form.submit();

ACXadminACXadmin

Any help on this please