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
chornbeckchornbeck 

Javascript won't trigger field update...

Here's the script I'm using (I put this together from the toolkit docs and what I've seen in this forum) - It obviously doesn't work, or I wouldn't be asking for help :)

<html>
  <head>
  <script src="/soap/ajax/9.0/connection.js"
          type="text/javascript"></script>
<script type="text/javascript">

 function initPage() {

var mylead = new sforce.SObject("Lead");

mylead.Id = "00N50000001SCnZ";

mylead.Times_Called__c == {!Lead.Times_Called__c} + 1;

sforce.connection.update([mylead]);

}

</script>


</head>

<body onLoad="initPage();">

</body>
</html>


If it's not obvious what I'm trying to do...  I have a custom field, "Times_Called" that I need to increment by 1 each time this s-control is invoked (the s-control will be a SkypeOut call, and I would like to count the number of calls made to each lead...)

Any help is GREATLY appreciated...

Chris
chornbeckchornbeck
Never mind, had the wrong Id...