• Sean Napier
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi all,

I'm a bit new to this so I apologize if this is not even possible.

I created a Button on a custom Object I have with the intention of having a checkbox on the related Opportunity updated when the button is clicked. This is what I have:

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

// identify the record

var o = new sforce.SObject("Opportunity");

o.id = "{!Medical_Consult__c.Patient__c}"; // Medical_Consult__c is my custom Object name Patient__c is the Opportunity lookup

// make the field change

o.Consult_Document_Fully_Completed__c = true; //This is the field on the Opportunity

// save the change

sforce.connection.update([o]);

//refresh the page

window.location.reload();

I'm not getting any errors when I click this button but the field is not updated on the Opportunity.

Any help would be greatly appreciated.
Hi all,

I'm a bit new to this so I apologize if this is not even possible.

I created a Button on a custom Object I have with the intention of having a checkbox on the related Opportunity updated when the button is clicked. This is what I have:

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

// identify the record

var o = new sforce.SObject("Opportunity");

o.id = "{!Medical_Consult__c.Patient__c}"; // Medical_Consult__c is my custom Object name Patient__c is the Opportunity lookup

// make the field change

o.Consult_Document_Fully_Completed__c = true; //This is the field on the Opportunity

// save the change

sforce.connection.update([o]);

//refresh the page

window.location.reload();

I'm not getting any errors when I click this button but the field is not updated on the Opportunity.

Any help would be greatly appreciated.