Requirement
I’d like to create a button on Opportunities that does several things:
1.) Closes the Opportunity (Stage = Closed Lost)
2.) Makes a custom field have a specific value (Opportunity Lost Reason = “Wrong/Bad Number”
Solution:
Here’s the URL behind the button:
/{!Opportunity.Id}/e?retURL={!Opportunity.Id}&opp11=”Closed Lost”&00N80000002eg5T=”Wrong/Bad Number”&save=x
Where
00N80000002eg5T is the ID of the “Opportuntiey Lost Reason” custom field!
opp11 is the SF field name for Stage standard field in the layout.
save=x will automatically save the record after the changes are made.
Thank you! Very helpful. How did you know that StageName= opp11?
Using Chrome browser, move cursor/mouse to field whose name/id you want to determine, right click on that field and click “Inspect Element”, then you will see html behind that field in bottom pane and there you can see id attribute. Id attribute is the one that defines whats hidden name for every field, opp11 in case of Stage field.
Found it, thanks again!