You need to sign in to do that
Don't have an account?
BillPowell__c
Javascript Button Not Updating Record
I have a lookup field on my Opportunity object that looks up to a custom object "Projects" (so we can see all of the opportunities associated with a project from different contractors). The # of opportunities are won/lost dynamically (not always 1 won, etc).
Therefore, I want to create a list button on the Opportunity related list on projects so my users can just check off which ones have "won" and click a "Won" button to set the stage. The button works without error, but doesnt change the stage. Here is the code I have, why is this not working? Because of the relationship?
Therefore, I want to create a list button on the Opportunity related list on projects so my users can just check off which ones have "won" and click a "Won" button to set the stage. The button works without error, but doesnt change the stage. Here is the code I have, why is this not working? Because of the relationship?
{!REQUIRESCRIPT("/soap/ajax/40.0/connection.js")} var o = new sforce.SObject("Opportunity"); o.id = "{!Opportunity.Id}"; o.StageName = "McGrory Won"; result = sforce.connection.update([o]); window.location.reload();
Please check below post for same issue
1) https://success.salesforce.com/answers?id=90630000000hiHJAAY
2) http://focusonforce.com/configuration/salesforce-list-buttons-javascript-example/
Try code somthing like this
Let us know if this will help you
Can you please share the screen shot of your error and let me know where you added above button with screen shot