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
Knet15Knet15 

How to update a custom field page on sales force?

Hello, 

I wondered about if is possible to update a field of an specific page. For example I created an app called product (wich generate an object) and then I added one field where I want to put the text using javascript ajax.
Is it possible to take this text and then using javascript ajax update it with the value using ajax-javascript? 
This is the code that I added on the "Custom Button or Link Edit"

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}

var result = sforce.apex.execute(
"webServiceInvoke", // class
"getResponse", // my method return an string
{});

alert(result);

var myObject = new sforce.SObject("Service");

myObject.Id = 'a5eo00000008Oa6';

myObject.Response = result;

sforce.connection.update([myObject]);
window.location.href=window.location.href;
Please any help I will apreciate it, 
Thank you very much,
Greetings.
Best Answer chosen by Knet15
Knet15Knet15
Finally I found the answer, just in case of another friend require to do exactly the same or something similar.
I was looking on the internet and I recomend to check the following link: 

http://www.cloudsocius.com/salesforce-opportunity-custom-button/#comment-1360