You need to sign in to do that
Don't have an account?
Tillu
Java script is not working properly ? any help ?
On Opportunity record ..i want to create a butoon when we click that button the opportunity field ''stage" value should need to be change to ''6 – Closed Lost'. After it should open another pop up and need to display a Text in a Text field. i was strucked on stage field it self ? any help please.....
{!requireScript("/soap/ajax/26.0/connection.js")}
var Opportunity = new sforce.SObject("Opportunity");
Opportunity.StageName = '6 – Closed Lost';
sforce.connection.update([Opportunity]);
window.location.reload();
{!requireScript("/soap/ajax/26.0/connection.js")}
var Opportunity = new sforce.SObject("Opportunity");
Opportunity.StageName = '6 – Closed Lost';
sforce.connection.update([Opportunity]);
window.location.reload();
Dear Tillu,
The below code will work,you have forgot the Where condition
{!requireScript("/soap/ajax/26.0/connection.js")}
var Opportunity = new sforce.SObject("Opportunity");
Opportunity.StageName = 'Closed Lost';
Opportunity.Id='{!Opportunity.Id}';
result = sforce.connection.update([Opportunity]);
if (result[0].getBoolean("success")) {
alert(result[0].id);
}
alert(result);
window.location.reload();
You know Debug is our old friend