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
laxmilaxmi 

s-control

Hi all,,,
        i want to pass three values to the class testSalesforce1 which is an webservice classs, if i click on submit button
nothing is happenening, so is this correct code,
actually as soon as i click on submit button those 3 values should come to this class ,can u help ...   
<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/10.0/connection.js"></script>
<script src="/soap/ajax/10.0/apex.js"></script>
<script>
function X(a,b,c) {
try{
var result = sforce.apex.execute("testSalesforce1" ,"test1", {a,b,c});

document.getElementById('userNameArea').innerHTML = 'Congratulations!'
+ + result;
}
catch (ex)
{
alert ("Failed : " + ex);
}
}
</script>
</head>
<body onclick=X(a,b,c)>
Product ID:<input type="text" name="a" id="name">
<br></br>
Customer ID:<input type="text" name="b" id="id">
<br></br>
Quantity:<input type="text" name="c" id="id">
<br></br>
<input type="submit" value="submit">
<hr></hr>
<div id=userNameArea
>
</div>
</body>
</html>
Ron HessRon Hess
the third param to execute must be a hash/map

here is an example
Code:
function findNearBy() {
 var cId = "{!Contact.Id}";
 var nearbyContacts = sforce.apex.execute(
  "NearbyUtil", 
  "findNearBy", 
  {currentContactId: cId },
  mapNearByContacts);
}

 
in your case you would have something like this, depending on the names of the vars that your webservice exposes, don't know because i didn't see your src code for that:

{ nameofAinmywebservice : a, nameofmyBinwebserv: b, nameofmyCwebserv: c}