{"id":13945,"date":"2019-01-07T12:43:11","date_gmt":"2019-01-07T12:43:11","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=13945"},"modified":"2022-02-15T16:58:26","modified_gmt":"2022-02-15T11:28:26","slug":"execute-action-using-xrm-webapi-online-execute-in-dynamics-365-crm-v9-0","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/01\/execute-action-using-xrm-webapi-online-execute-in-dynamics-365-crm-v9-0\/","title":{"rendered":"Execute action using Xrm.WebApi.online.execute in Dynamics 365 CRM V9.0"},"content":{"rendered":"<p><strong>Introduction:<\/strong><\/p>\n<p style=\"text-align: justify;\">In this blog, we are going to explore the use of <strong>Xrm.WebApi.online.execute<\/strong> to execute an action in Dynamics CRM version 9.0 and then process its response which will be consistent across Web client, UCI, Mobile and Tablets. For sample purpose we would execute an Out-of-Box action named \u201cInstantiateTemplate\u201d.<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p style=\"text-align: justify;\">First of all, we would define a request and populate the input parameters as shown in the following sample code \u2013<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13946\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/D.jpg\" alt=\"Xrm.WebApi.online.execute in Dynamics 365 CRM V9.0\" width=\"711\" height=\"436\" \/><\/p>\n<p style=\"text-align: justify;\">Once our request object is ready with all input parameters in place, now we would execute it via Xrm.WebApi as follows \u2013<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13947\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/D1.jpg\" alt=\"Xrm.WebApi.online.execute in Dynamics 365 CRM V9.0\" width=\"722\" height=\"143\" \/><\/p>\n<p style=\"text-align: justify;\">If the result of executed action is fine(i.e. result.ok == true) then you can read your response via result.json() as it will parse your response consistently across all clients(web, UCI, tablet &amp; mobile).<\/p>\n<blockquote><p>Note<strong>:<\/strong> While passing ids to action make sure you use key as \u201cguid\u201d as shown in the above sample. Also the typename in metadata may differ depending on your parameter\u2019s data type.<\/p><\/blockquote>\n<p>Hope it helps.<\/p>\n<h2 style=\"text-align: left;\"><div class=\"su-heading su-heading-style-default su-heading-align-center\" id=\"\" style=\"font-size:15px;margin-bottom:5px\"><div class=\"su-heading-inner\"><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/mailchimp-dynamics-365-crm-integration-marketing-4-dynamics\" target=\"_blank\" rel=\"noopener\">Marketing4Dynamics<\/a> \u2013 Mailchimp and Dynamics 365 CRM integration to plan effective sales strategies, increase sales and improve ROI<\/div><\/div><\/h2>\n<ul>\n<li>Sync Audiences, Members and Tags from Mailchimp to CRM<\/li>\n<li>Sync CRM Marketing List (Contacts\/Leads) to Mailchimp<\/li>\n<li>Sync Campaigns and Member activities from Mailchimp to CRM<\/li>\n<li>Monitor and analyze Mailchimp campaign statistics through Dashboards in CRM<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: In this blog, we are going to explore the use of Xrm.WebApi.online.execute to execute an action in Dynamics CRM version 9.0 and then process its response which will be consistent across Web client, UCI, Mobile and Tablets. For sample purpose we would execute an Out-of-Box action named \u201cInstantiateTemplate\u201d. Solution: First of all, we would\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/01\/execute-action-using-xrm-webapi-online-execute-in-dynamics-365-crm-v9-0\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":13950,"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":[16,17,18,65],"tags":[550,943,944,945,1815],"class_list":["post-13945","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-dynamics-365-mobiles-tablets","category-dynamics-365-v9-2","category-webapi","tag-dynamics-365-crm-v9-0","tag-instantiate-email-template","tag-instantiate-template","tag-instantiatetemplate","tag-web-api-dynamics-365"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/13945","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=13945"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/13945\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/13950"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=13945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=13945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=13945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}