{"id":3532,"date":"2019-01-23T02:48:48","date_gmt":"2019-01-23T02:48:48","guid":{"rendered":"http:\/\/himbap.com\/blog\/?p=3532"},"modified":"2019-01-23T02:48:48","modified_gmt":"2019-01-23T02:48:48","slug":"updating-associated-account-on-opportunity-won","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=3532","title":{"rendered":"Updating associated Account on Opportunity Won"},"content":{"rendered":"<p><strong>Introduction<\/strong><br \/>\nSometime we want to update the account associated to the opportunity, for example let&#8217;s say if opportunity status is changed to won, we want to update some of the attributes in the account record. This post is quick tip about doing these changes.<\/p>\n<p><strong>Requirement<\/strong><br \/>\nChange Relationship type of the account to Customer when opportunity status changes to WON.<\/p>\n<p><strong>Solution<\/strong><br \/>\nThis can be done using different options but the easiest option is to use Workflow. We can use following steps to update account.<br \/>\nLet&#8217;s say we one following account and currently relationship type is set to prospect.<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3533 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect1-296x300.png\" alt=\"prospect1\" width=\"296\" height=\"300\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect1-296x300.png 296w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect1.png 421w\" sizes=\"(max-width: 296px) 100vw, 296px\" \/><\/a><\/p>\n<p>And we have one opportunity for this account and now let&#8217;s create our workflow. Navigate to Settings-&gt;Processes-&gt;New and select details like following<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3534 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect2-300x192.png\" alt=\"prospect2\" width=\"300\" height=\"192\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect2-300x192.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect2-624x399.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect2.png 628w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nNow we want to run our workflow for everyone and on status changes only so configure scope and start when like following<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3535 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect3-300x193.png\" alt=\"prospect3\" width=\"300\" height=\"193\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect3-300x193.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect3.png 359w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nNext we want to check if status changed to Won only, because we only want to run our workflow for won opportunity. So click Add Step and add Check Condition, we need to configure it like following<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect4.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3536 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect4-300x48.png\" alt=\"prospect4\" width=\"300\" height=\"48\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect4-300x48.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect4.png 600w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nNow select the row under condition and click on Add Step again and add Update Record step. Next select Account under drop down and click on Set Properties button to update account field. We want to change Relationship Type so select relationship type and change it to Customer.<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3537 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect5-300x288.png\" alt=\"prospect5\" width=\"300\" height=\"288\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect5-300x288.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect5.png 329w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Finally activate workflow, that&#8217;s all we need to do. Now when opportunity status will change to Won, regarding account will be updated to Customer.<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect6.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3538 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect6-221x300.png\" alt=\"prospect6\" width=\"221\" height=\"300\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect6-221x300.png 221w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/01\/prospect6.png 346w\" sizes=\"(max-width: 221px) 100vw, 221px\" \/><\/a><br \/>\nWe can further put condition to check if relationship is different earlier and we want to make sure to only change if relationship type is set to specific.<\/p>\n<p>Hope it will help someone !!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Sometime we want to update the account associated to the opportunity, for example let&#8217;s say if opportunity status is changed to won, we want to update some of the attributes in the account record. This post is quick tip about doing these changes. Requirement Change Relationship type of the account to Customer when opportunity status changes to WON. Solution&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=3532\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[402,5,6,8,275],"tags":[695,694],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3532"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3532"}],"version-history":[{"count":2,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3532\/revisions"}],"predecessor-version":[{"id":3540,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3532\/revisions\/3540"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}