{"id":1949,"date":"2010-01-14T18:38:18","date_gmt":"2010-01-14T13:38:18","guid":{"rendered":"http:\/\/www.chiragmehta.info\/chirag\/?p=1949"},"modified":"2010-01-14T18:39:03","modified_gmt":"2010-01-14T13:39:03","slug":"salesforce-url-hack-to-close-an-opportunity","status":"publish","type":"post","link":"https:\/\/www.chiragmehta.info\/chirag\/2010\/01\/14\/salesforce-url-hack-to-close-an-opportunity\/","title":{"rendered":"Salesforce &#8211; URL hack to close an opportunity"},"content":{"rendered":"<p><strong>Requirement<\/strong><\/p>\n<p>I&#8217;d like to create a button on Opportunities that does several things:<br \/>\n1.)  Closes the Opportunity (Stage = Closed Lost)<br \/>\n2.) Makes a custom field have a  specific value (Opportunity Lost Reason = &#8220;Wrong\/Bad Number&#8221;<\/p>\n<p><strong>Solution:<\/strong><br \/>\nHere&#8217;s the  URL\u00a0behind the button:<\/p>\n<blockquote><p>\/{!Opportunity.Id}\/e?retURL={!Opportunity.Id}&amp;opp11=&#8221;Closed Lost&#8221;&amp;00N80000002eg5T=&#8221;Wrong\/Bad Number&#8221;&amp;save=x<\/p><\/blockquote>\n<p>Where  <\/p>\n<blockquote><p>00N80000002eg5T is the ID of the &#8220;Opportuntiey Lost Reason&#8221; custom field!<br \/>\nopp11 is the SF field name for Stage standard field in the layout.<br \/>\nsave=x will automatically save the record after the changes are  made.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Requirement I&#8217;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 = &#8220;Wrong\/Bad Number&#8221; Solution: Here&#8217;s the URL\u00a0behind the button: \/{!Opportunity.Id}\/e?retURL={!Opportunity.Id}&amp;opp11=&#8221;Closed Lost&#8221;&amp;00N80000002eg5T=&#8221;Wrong\/Bad Number&#8221;&amp;save=x Where 00N80000002eg5T is the ID of the &#8220;Opportuntiey Lost Reason&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[169],"class_list":["post-1949","post","type-post","status-publish","format-standard","hentry","category-salesforce","tag-salesforce","post-preview"],"_links":{"self":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/1949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/comments?post=1949"}],"version-history":[{"count":3,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/1949\/revisions"}],"predecessor-version":[{"id":2630,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/1949\/revisions\/2630"}],"wp:attachment":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/media?parent=1949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/categories?post=1949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/tags?post=1949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}