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
Pascal TPascal T 

Custom button to update field working in development but not in production

Hello,

 

I have an issue with a very simple java code on a button.

It is just updating a value on a picklist field. For some reason, it is not working with any profiles (administrator included). And no error message. It is just reloading the page and no change.

 

I seriously don't know where the problem could be coming from. It is working perfectly in the sandbox.

 

Here's the code.

 

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}

var sr = new sforce.SObject("Quote");
sr.Id = "{!Quote.Id}";
sr.Status = 'Accepted';
result = sforce.connection.update([sr]);

location.reload(true);

 

 

Pascal TPascal T

Also, updating the status manually is working. (edit and save)