You need to sign in to do that
Don't have an account?
MarkMCC
Displaying a Button
We have a button that we need to display only if a picklist value is selected. I have been trying for a few days now to get this to work and I cant seem to figure it out. Below is our source for our button.
{!REQUIRESCRIPT("/soap/ajax/12.0/connection.js")}
var thisQuote__c = new sforce.SObject("Quote__c");
thisQuote__c.Id = '{!Quote__c.Id}';
thisQuote__c.OwnerId = '00G70000001IzYb';
var saveResults = sforce.connection.update([thisQuote__c]);
if(saveResults[0].success == 'false'){
alert('an error occured: ' + saveResults[0]);
}
window.location.href = '/{!Quote__c.Id}';, value_if_false)}
Any help is welcome!
{!REQUIRESCRIPT("/soap/ajax/12.0/connection.js")}
var thisQuote__c = new sforce.SObject("Quote__c");
thisQuote__c.Id = '{!Quote__c.Id}';
thisQuote__c.OwnerId = '00G70000001IzYb';
var saveResults = sforce.connection.update([thisQuote__c]);
if(saveResults[0].success == 'false'){
alert('an error occured: ' + saveResults[0]);
}
window.location.href = '/{!Quote__c.Id}';, value_if_false)}
Any help is welcome!
1. what is the ", value_if_false)}" on the window.location.href line? Looks like a mistake.
2. Use some try / catch blocks to catch unknown errors.
3. It is a bad idea to hard code ID numbers into an application. Could you not run a quick query against the Users table to get the ID for the person you want as the owner?
4. Do you have a namespace enabled for your Salesforce account? I doubt that's the case, but if so, you need to use it to prefix your fields.
Best, Steve.