{"id":12953,"date":"2018-09-21T16:40:17","date_gmt":"2018-09-21T11:10:17","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=12953"},"modified":"2018-09-21T16:40:17","modified_gmt":"2018-09-21T11:10:17","slug":"working-with-workflow-and-workflow-assembly-output-parameters","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2018\/09\/working-with-workflow-and-workflow-assembly-output-parameters\/","title":{"rendered":"Working with Workflow and Workflow Assembly Output Parameters"},"content":{"rendered":"<h2><strong>Introduction:<\/strong><\/h2>\n<p style=\"text-align: justify;\">Using the OOB Workflow, you can use values that are only accessible under the Workflow context to perform operations.\u00a0If you want to use values that are not\u00a0under\u00a0the context of the Workflow or not related\u00a0to the entity record for which the Workflow is going be executed, then you will need to write a custom assembly that will retrieve the output parameter.<\/p>\n<p style=\"text-align: justify;\">As shown in the below code snippet, you can write a custom assembly to retrieve values through the output parameters as required;<\/p>\n<pre class=\"lang:default decode:true\">\/\/Refference of account record\nEntityReference refContact = new EntityReference ( \"contact\" , new Guid ( \"2C97F902-555F-E811-A97F-000D3A370EF7\" ));\nsetContact.Set(context, refContact);\n \n\/\/Refference of contact record\nEntityReference refAccount = new EntityReference ( \"account\" , new Guid ( \"9297F902-555F-E811-A97F-000D3A370EF7\" ));\nsetParentAccount.Set(context, refAccount);\n \n\/\/Optionset value\nsetPurchaseProcess.Set(context, new OptionSetValue (2));\n \n\/\/Money field value\nsetBudgetAmount.Set(context, 25000);<\/pre>\n<p>While setting the values using custom assembly, you can see\u00a0that there are\u00a0multiple local values of one custom assembly.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter  wp-image-12955\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/09\/1Working-with-Workflow-and-Workflow-Assembly-Output-Parameters.png\" alt=\"Working with Workflow and Workflow Assembly Output Parameters\" width=\"976\" height=\"535\" \/><\/p>\n<p>For example,<\/p>\n<p><strong>1<\/strong>. &#8220;Custom_Parameters&#8221; attribute contains retrieved output parameters other than entity reference type parameters.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-12956 \" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/09\/2Working-with-Workflow-and-Workflow-Assembly-Output-Parameters.png\" alt=\"Working with Workflow and Workflow Assembly Output Parameters\" width=\"973\" height=\"285\" \/><\/p>\n<p><strong>2<\/strong>. &#8220;Custom_Parameters:setParentAccount (Account)\u00a0contains all the attributes of the referred Account record.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter  wp-image-12957\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/09\/3Working-with-Workflow-and-Workflow-Assembly-Output-Parameters.png\" alt=\"Working with Workflow and Workflow Assembly Output Parameters\" width=\"965\" height=\"556\" \/><\/p>\n<p><strong>3<\/strong>. Custom_Parameters:setContact (Contact)&#8221; contains all the attributes of the referred Contact record.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter  wp-image-12958\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/09\/4Working-with-Workflow-and-Workflow-Assembly-Output-Parameters.png\" alt=\"Working with Workflow and Workflow Assembly Output Parameters\" width=\"975\" height=\"568\" \/><\/p>\n<blockquote><p><strong><em>Note:\u00a0setParentAccount and setContactis are the variables that are defined in the Workflow Assembly, and Account &amp; Contact are the respective targets<\/em><\/strong><\/p><\/blockquote>\n<p>This way, you can use any attribute value of the referred account or contact or any other entity to perform operations.<\/p>\n<h2><strong>Conclusion:\u00a0<\/strong><\/h2>\n<p style=\"text-align: justify;\">Instead of using multiple output parameters to retrieve values from one record, use entity reference of that record as an output parameter, and get access to all its attributes to perform operations.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-pack\/click-2-export-microsoft-dynamics-crm-reports\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter  wp-image-10864\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2017\/12\/Click2Export-banner.png\" alt=\"Export Dynamics CRM Reports\" width=\"973\" height=\"243\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Using the OOB Workflow, you can use values that are only accessible under the Workflow context to perform operations.\u00a0If you want to use values that are not\u00a0under\u00a0the context of the Workflow or not related\u00a0to the entity record for which the Workflow is going be executed, then you will need to write a custom assembly\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2018\/09\/working-with-workflow-and-workflow-assembly-output-parameters\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":12960,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[67],"tags":[1842,1843,1844,1845,1846],"class_list":["post-12953","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-workflows","tag-workflow-assembly-output-parameters","tag-workflow-assembly-output-parameters-dynamics-365","tag-workflow-assembly-output-parameters-dynamics-crm","tag-workflow-dynamics-365","tag-workflow-dynamics-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/12953","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=12953"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/12953\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/12960"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=12953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=12953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=12953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}