tag:blogger.com,1999:blog-45354476069864228732024-03-17T23:03:42.499-07:00MSCRM ShopThis blog is about MSCRM. We talk about everything CRM.Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.comBlogger128125tag:blogger.com,1999:blog-4535447606986422873.post-74655848007043226342018-04-08T18:09:00.000-07:002018-04-08T18:09:07.310-07:00D365 Web API Batch Request, Transaction Integrity, and Logic Apps – Part 2In my last blog, we looked at achieving transaction integrity using changesets with the batch request. The only problem with the batch request is that you can’t use the record created in initial requests in the subsequent requests. E.g., to create an order, we create an order record first then create all the line items related to the order. In a batch request, you can create the order record but can’t link that record to the order line items.<br />
<br />
There are a few options to overcome this issue. This blog is discussing two of those options.For this blog, I am using the logic app created in the last blog (<a href="http://mscrmshop.blogspot.com.au/2018/03/d365-web-api-batch-request-transaction.html)">http://mscrmshop.blogspot.com.au/2018/03/d365-web-api-batch-request-transaction.html)</a>. This blog creates a contact record with two address records.<br />
<h1>
Option 1(Create the Contact record GUID Manually)</h1>
The one option is to generate a GUID before invoking the batch request and use this GUID to create the contact record and related address records.<br />
<br />
The following screenshots depict the changes in the logic app.<br />
<ul>
<li>The first screenshot displays all the steps for the logic app.</li>
<li>The second screenshot displays the step to generate a new GUID for the contact. This step is using Initialize Variable action.</li>
<li>The third screenshot shows the part of the batch request. The screenshot also highlights where the GUID is used to create a new contact and related address records.</li>
</ul>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm6rXJaSSYrqgCBs-kGmW3ISF191p2XL0Q80uGe1d46h5OMf2NVxu5hgKl_ZhcUm95KmX8bdqHsPA4nUpciArp40u-cLzyzXWRKZ6d_JHWKH8_CMMUIxZpSjsRwBb_WDOG9-QC4eJra6g/s1600-h/2018-04-05_15-42-38%255B5%255D"><img alt="2018-04-05_15-42-38" border="0" height="553" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiTB9GkayrKTFWOBLr2awH-lS0GIGH1G-CefMkVL13B6xk3UqvJ5qsct4o0vf5oEczwlV9lXLV31zgrip2XwxoxyuiKrquMgyEUXV0eIXVum_xIe90WET-mqnv1ZNT6xAYE9th5FHhn8E/?imgmax=800" style="background-image: none; display: inline;" title="2018-04-05_15-42-38" width="532" /></a><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8xvuX0YWJqLN3mbCNo8isLtvyzDXTUmW-xSFRrlI6AhPOZ9FD0kuYOV6CCoLU8g8v-5_uZSDytgEAdys1MAY6XhEDTo6D8O5A0FopyfEhK5eft8JeAhxFo0a8tqDQoDzW2BYEpj6TnPQ/s1600-h/2018-04-05_15-47-32%255B4%255D"><img alt="2018-04-05_15-47-32" border="0" height="138" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHDl3kLqB6KLX2P-hIkS-yDTv_clQtl7f8prQiskOo71jrcubHPoFqh-moYZN3PoVFfwIUIEFD4St1_zoNbTFOaNsMUR34o2Dh90dQt8Wmn-qP9FLD73YGK_434fp5SrAUxSLCG1U-Fws/?imgmax=800" style="background-image: none; display: inline;" title="2018-04-05_15-47-32" width="528" /></a><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDaVlzUmIB8otzXe_lok6t_NNzdjN6Sca6fL94oTpaciIaKhBd91Qoz8-dK1mSdejGWBYrGETxFvzLchiRZP0CpUJluLmJGNB0QTs48gw4Z9seXusQa5MwoILcrsowuZcPUWTsjo3xMqA/s1600-h/2018-04-05_15-48-32%255B7%255D"><img alt="2018-04-05_15-48-32" border="0" height="846" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHcj50GnIFMblAA59jxjqdcvA530QF1fV8LoX8vQMkIABYtWgLBMooUHlQmolbikmZ7P2IxhyphenhyphenWZ0E_x5poR2nWnAgaTKPtrq2WFa6D4wNcuRvKi4Rb74VgUomQwixHbSZKNeQtlCXvCw/?imgmax=800" style="background-image: none; display: inline;" title="2018-04-05_15-48-32" width="529" /></a><br />
<h3>
<span style="color: red;">Note: </span></h3>
The creation of a manual GUID is not recommended for performance reasons. If the number of users and transaction volume can handle the performance hit, only then use this option. Otherwise, consider the second option.<br />
<h1>
Option 2 (Deep Insert)</h1>
The second option is not to use the batch request. The transaction integrity can be achieved using the deep insert.<br />
<br />
This option allows us to create a new record and its related records in one operation. If the creation of any of the records fails, the system fails the whole operation.<br />
<br />
The following screenshot displays the deep insert web API call.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-FkwtBTEOMk0vIJtKlGxdjkGl7pWVrU8eb1jaQ5bOVxKzSoDD0ZKVAaCZCStmzxJflvpCdof4BHLHELpYs6Dtg2BerpxTcSY4lywS3BZefbSmqvmaAuB5G-WvF1mZha80pCloFCRKzW0/s1600-h/2018-04-05_16-09-22%255B5%255D"><img alt="2018-04-05_16-09-22" border="0" height="841" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlIPg6ks1m3woDUeLoI4eazzQM0qmpwIVhVHiepHh7YPHCXiCsGFgI0wKrUFd-ORnEBsqnFQPDp0CfxTvF_ihDvdYegUalqyUAPk_T7iFcIIcx8Hy51qMrt9ggcIRrcnRqM7u87_uX2N0/?imgmax=800" style="background-image: none; display: inline;" title="2018-04-05_16-09-22" width="540" /></a><br />
<h1>
Update Considerations</h1>
The above two options are useful for creating new records. If you want to update multiple child records based on a parent record, then consider making two API calls:<br />
<ul>
<li>The first call to retrieve the GUID of the parent record based on available attribute/attributes (e.g., first name, last name, email, and address)</li>
<li>The second call (batch request) to update the child records based on the GUID retrieved in the first call.</li>
</ul>
<h1>
Download Links</h1>
<div>
You can download the logic apps created for this blog from the following links:<br />
<br />
<ul>
<li><a href="https://gist.github.com/amreeksingh/ab6f0acd8acc161aaa3315d2c0e058bf#file-batchwithguid-json" target="_blank">Batch Request with GUID</a></li>
<li><a href="https://gist.github.com/amreeksingh/e776609de333b14a5a2f4ed225148181#file-deepinsert-json" target="_blank">Deep Insert</a></li>
</ul>
<br />
That is it. If you have a better solution, please share it.</div>
Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com38tag:blogger.com,1999:blog-4535447606986422873.post-15730376177881083032018-03-01T20:38:00.000-08:002018-03-01T20:38:21.071-08:00D365 Web API Batch Request, Transaction Integrity, and Logic Apps – Part 1In my last 2 blogs, I have written about calling D365 Web APIs from Logic Apps. This blog is the real reason why I was exploring the options of calling D365 Web APIs directly from Logic Apps, instead of using the Dynamics connector provided by Logic Apps.<br />
<br />
In real life, the integration is not always about creating individual records. In my experience, a lot of integration scenarios are related to <strong><em>transaction integrity. </em></strong>This means that a group of related Create, Update and Delete requests are executed as one logical transaction. Transactions are useful in scenarios where you have to commit a group of operations/requests in entirety, and ensure that the system will roll back all changes if any of the requests fail.<br />
<br />
In general, most of the synchronous plugins, synchronous workflows and actions support transactions, but it is not recommended (best practices) to use them for integration. D365 also provides the <strong><em>ExecuteTransactionRequest </em></strong>method to support transactions. It is a part of the <a href="https://msdn.microsoft.com/en-au/library/mt608128.aspx" target="_blank"><strong><em>Organization Service (“SOAP Endpoints”)</em></strong></a>. Using this means that you have to add Microsoft.Crm.Sdk.Proxy.dll and Microsoft.Xrm.Sdk.dll assemblies to your projects.<br />
<br />
So what would you do if you are using Logic Apps as an integration layer? One solution is to use the Web APIs<strong><em> Batch</em></strong> operation. Please check the details of this command on <a href="https://msdn.microsoft.com/en-us/library/mt607719.aspx" title="https://msdn.microsoft.com/en-us/library/mt607719.aspx">https://msdn.microsoft.com/en-us/library/mt607719.aspx</a>. The primary purpose of the Batch operation is to bundle multiple requests/operations into one HTTP call. The Batch operation provides <strong><em>changesets</em></strong> to support transactions.<br />
<br />
For this blog post, I have used CRM Web API’s Batch operation to support transaction integrity.<br />
<h1>
Scenario</h1>
I am keeping the scenario very simple. An external system is calling the Logic Apps with contactid, billing address, and shipping address.<br />
The Logic App should create both the addresses linked to the contact with the contactid. If any of the requests fail, CRM should roll back all the requests. The following screenshot displays the body of the request.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaXLSuDTGrv5QvqiamSkaVZ2WFxbe1SRzq2lETYgfNoacCAz7n9ulkwigTyIgJamZqdcyZmLu4G5S2hY-0Lfv5rLjIPwC5fcoSU-EpfA1q-juemUlLBdjNsTs8pRHH39ff-XOO3J7pFw8/s1600-h/2018-03-01_22-50-05%255B4%255D"><img alt="2018-03-01_22-50-05" border="0" height="172" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaIZ1153pzKIxmOkhUy0EacZJ3y6Gt9lwLpOJNZKwugM55m8rCNn1t1i38_m_dtmhgLjycl-Lb4-ZoCI81fohq69wmYKVgyJqk64XmlSQ1A1hy_FQhQTpL6xVBuOkkiarwvSMlctAIOPU/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-01_22-50-05" width="524" /></a><br />
In real life, the <strong><em>change set</em></strong> can contain requests to create/update/delete different kinds of records.<br />
<h1>
Solution</h1>
We have used CRM Web APIs <strong><em>Batch</em></strong> operation to achieve transaction integrity for this scenario. For this blog, I have used the Logic App created in my previous <a href="http://mscrmshop.blogspot.com.au/2018/02/calling-d365-apis-from-logic-apps.html" target="_blank">blogs</a>.<br />
<br />
The <strong><em>Logic App </em></strong>receives the request, get the authentication token and make the batch request. If the call is successful, the Logic App terminates with the status of <b style="font-style: italic;">Succeeded</b>,<b style="font-style: italic;"> </b>otherwise it creates an integration log<strong><em> </em></strong>record in CRM and terminates with the status<strong><em> of Failed.</em></strong><br />
<strong><em><br /></em></strong>
The updated Logic App has the following steps. Steps 4 and 5 are exactly the same as my previous blog.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOml2KDdi9m0Yc8Sc7YQYzKV-CymCtraGCgNOv1djAogpjhz_ryzjsJ-8vSm-G_UZUJ01MjuyRDGEJa79IF7p9QgUCU4CjEuf3rSfOsncd5RqylFXPxK_qp11HvKlrKwdmSqkZ5vMDFkc/s1600-h/2018-03-01_22-57-42%255B19%255D"><img alt="2018-03-01_22-57-42" border="0" height="610" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1x2w_k4sUzhqNSdNnYCwW34K1gN0nPydSyuNTeUvomsli8XL4HZcNomB4K2e3395ru7S6lQEZI5-6SBjBKr2n7O4ELFWmoUDy7wMkMLoeDelMMKJV1O6T23slW2zLYlf6P5QMlVrG6Zs/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-01_22-57-42" width="665" /></a><br />
<br />
<h2>
Step 1</h2>
It is an HTTP trigger. It is receiving the request. The payload schema has been updated based on the body of the request.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV6wuLU8JZvUnT8_6f2WX72rlragSaKKS2kh7ZsQeuvJ7HGHnsvT95N_JO26zdGJNxZ24fGGIYoy_2XVIuUP84ECo_2E2oIw6nLYSl3_zmqwEQmHwiP4ra5oZXEL0ungk-cNUoymXqbMM/s1600-h/2018-03-01_23-13-20%255B5%255D"><img alt="2018-03-01_23-13-20" border="0" height="384" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitYWhmLpwIDLcDxDECpY8t3nLAzC7X-sGeRdWtHs2P8YhpEMbrcYzqYjS-VKuak45bu8Lb3WYaBwBQ31c6pdx9QXbKuEX-BuAQTPf3LWUASzl1Oj_uBpINylER3iKspyta0Nnv92Ce4YU/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-01_23-13-20" width="662" /></a><br />
<h2>
Step 2</h2>
The Web API <strong><em>Batch </em></strong>operation requires a unique batch number and changeset number. This step initialises the batch number for the request. I have used <strong><em>Batch_guid</em></strong> as the format of the batch number.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT2uL8MMChjJRUzTljg7JrqDoXNTsVqhgS3TFpVBj-oFw8mlBKES8KzMofvmK04Zt1PrvKwVXg6gnM4BnAm95hbyu-PLj3RQBERZ4LaTf6yZjiO6FQJTL4s4dDuDW4O9uu9q8wHe-DKkk/s1600-h/2018-03-01_23-19-04%255B4%255D"><img alt="2018-03-01_23-19-04" border="0" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB_sowheXV2Qg3I4rdHBjC37WPKpVbIkJaMmJTqNBcYMcRliiSMB3vpxjBZF01AUezc4ixaCafFzEcAdcR5bO6_SAJ0hUt6Lgtk444CTUVPN_uPlAMe3ePFfGSbUP8PxEviXelkvhp6lg/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-01_23-19-04" width="665" /></a><br />
<h2>
Step 3</h2>
This step initialises the changeset number for the request. I have used <strong><em>changeset_random number</em></strong> (100-999) as the format for the changeset number.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYSznCO9JCmWYC-ZzEDbSWwMfJ11nYi2j8VZ65PBHh85tVPwtEWAhB0S764L2Uo_qKXIUi7INSG60HC_s286_VCjNMLXFGyGNBXPt85mtQJ9-WdhfPp6ccA-9O7nchivG1Vw-mLpa0lAM/s1600-h/2018-03-01_23-23-57%255B4%255D"><img alt="2018-03-01_23-23-57" border="0" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDeUKuHUFViLFqqkhquSNcoSX6VtNXNYNZklQlCrpBCKSSyjBbI7LI7u_i6OrNB5eUawUnLLOjhmGhDrR6yWPFjUBgh2kAb2n6E9DQLebQNBIEK1fJL5QFTO-UiQBaDccAOX8-91lzpN8/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-01_23-23-57" width="662" /></a><br />
<h2>
Step 4 and Step 5</h2>
These steps are exactly the same as my previous blog <a href="http://mscrmshop.blogspot.com.au/2018/02/calling-d365-apis-from-logic-apps.html" target="_blank">Calling D365 APIs from Logic Apps</a>. These steps get the authentication token and parse the token so it can be used to make the Web API call.<br />
<h2>
Step 6</h2>
This is the most important step. It is using a <strong><em>HTTP action</em></strong>.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgssfaD2Xthwhz2UIASXQztFotm30lt8aLlFfk9xSCrzbzjylzYAWARlW_pF4kKeX3SdBcZ9-nmMnkh4m68ZfZd3SJVsG0utORqI5yke5VcGwrK2rHxUrNAT6PYH74WrB1wpiEqt4UYOzo/s1600-h/2018-03-01_23-32-01%255B14%255D"><img alt="2018-03-01_23-32-01" border="0" height="838" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi92WLVWpdWo384ECtAXCEE9uVrwb-78sciEdi7e_sUEWajjIUxJaecKq1gI6XIT-dJBKU8xSm1-MaNcB5goKZ_aDgdosKY5-hV9t6fEbUGChyphenhyphendzzKdh9qgtmvndnDCaU3Lpu9jfKWMQ1M/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-01_23-32-01" width="654" /></a><br />
<br />
The request body is quite big for a batch request. The screen is just displaying the start of the body and the first request to create the customer address. To make the batch request, the following information is required.<br />
<ul><!--StartFragment-->
<li>Use <strong><em>Post </em></strong>as<strong><em> Method.</em></strong></li>
<li>Provide the D365 Web API <strong><em>Uri. </em></strong>The last part of the Uri is the name $<strong><em>batch</em></strong> .</li>
<li>Headers are the same for all the Web API calls except content-type. The content-type for the request is <strong><em>multipart/mixed boundary =BatchNo</em></strong></li>
<li>The body of the request contains all the individual calls. There are specifics on how to use batch no. and change set no. in the request. Be mindful of that. I have provided the whole app definition at the end of this blog.</li>
</ul>
<h2>
Step 7</h2>
<ul><!--EndFragment--></ul>
This step will create an integration log record in CRM in case of an error in Step 6. I have used the <strong><em>Dynamics 365- Create a new record</em></strong> action for this step.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHGqZaUluNsiqSZDaSknQC3_KJ-efqTA-u65R5qfBwT1rv9lI9uEPnyaVJoE5TSWdkjiJCnNB8uSowlR2dkV20TiH4n2R6B0xSb2KOBFxusAL0KAZONI-a7KZBQXNWKn5pGFtothF7fKc/s1600-h/2018-03-02_11-50-39%255B4%255D"><img alt="2018-03-02_11-50-39" border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge6a9eKkgRn9JkJQ9YF7FbdlyTo4YbOr2HMVNdZJBPsviYTLl-v_RTUwaAoV6FhhFGqpGtWN1z4T_WJn1xdK9XnLu2R3tYU04c6ndFQv_Bt6R2GsdGWuW2Heky8kdmWoXXNdO5hGRu17U/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-02_11-50-39" width="669" /></a><br />
<br />
One of the reasons to create an error log is that the output of the batch request is the base64 format. The error messages are not in human-readable form. When we log them, the Logic App automatically decodes the base64 strings.<br />
Note: I am logging the whole output body in this step. In real life, you can use the substring function to log just the error description part of it.<br />
<h2>
Step 8</h2>
The purpose of this step is to terminate the Logic App with the status <strong><em>Failed</em>. </strong>Steps 7 and 8 will be executed only if Step 6 fails.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwbDVDYUx2-VIpwgdh96hUy_I-N1F5Q4v0d8Ts1ixxozzPnMBKwOHyhI2qSr2ETRr7R094oKTm2QYniOrWXm8nGSzOXXBkdQfUVQA6HTaf2sAQIUqCLibelvMsk0DTYq1vCkdb2lcsSss/s1600-h/2018-03-02_11-59-42%255B4%255D"><img alt="2018-03-02_11-59-42" border="0" height="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRSysM6DO8nVDYnydP2YGtCTp7hLFKQgqC40R_ChksnAlGhcoYTu6VJSjlmhWGuzXtNK-hqv9veCbS8e1BiNDwV1yR7LtJA1962-XjyVSJ56hB3vwi6GyjA5Tzg5iX4gc5xwf-iK6SEAA/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-02_11-59-42" width="674" /></a><br />
<h1>
Results</h1>
I have used Postman to trigger the Logic App.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3f1OshM6EEvSOpUo4SK-J-x4tcirnwkAwGF7nAMvCnL83dkh2B6TspFpqZEbZxEOHEotjNskbZZD_lKpa8Efq9SAJ1BIVBvcV7Vky53NkyFzc7wEXaD8oCS9ijmxYnxEHvXFtwuQLKPU/s1600-h/2018-03-02_12-03-52%255B3%255D"><img alt="2018-03-02_12-03-52" border="0" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirsK1NZ_Y4jzwzi5j81f6wwqjSunOyof9F2YGBnEgfh0RpMOIUozXJac-bQulNmJmHi2PY9w9aR55GEalx0FjG-dUrlR5cD4phWktSdHVOOT-ztlsOZjJhuoviull9BmfF2UhlQjAQOjM/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-02_12-03-52" width="665" /></a><br />
<h2>
Successful Execution</h2>
If the call is successful, you will be able to see 2 addresses related to the contactid provided in the request body.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6xLDscWLFsr28Gp0FCdEit3BoOyBIiiuehlykVlRFybfDvCgpfuEctONqWw2qrsQZrzxbE_AJJ0nYiMUZ8g-zMFMIKXi8OgXeNe2YmLgrQ_2wgulXnf4AL_QYgDNHzDsAXAKtqqP8MTU/s1600-h/2018-03-02_12-08-06%255B4%255D"><img alt="2018-03-02_12-08-06" border="0" height="221" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrYHAc3XCIKRBj2JztLT7zokjWZET_7vr9kj3tttzG1wSjozYmHHutCC60cqu7BSVBnaDhmcR069NcSLPokosSH3nuDxAw7A8F1kSeCM7eRZTP5g7wPbrwKOOMWQz7mUerqrT6LwOrFX8/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-02_12-08-06" width="668" /></a><br />
<h2>
Failed Execution</h2>
To test the failure scenario and transaction integrity, I manually updated the addresstypecode to 8 for the second request in the changeset. This addresstypecode does not exist in the CRM. The Logic App logged the following error in CRM, and there were no address records in the system. The error was in the second request, but the system has rolled back the creation of the first record too. That is how you implement transaction integrity.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW1yVAmGjHDkOgIh-pwEtYvQgxzexWKRM3JD3bpchzDWwh-jxbO49WB4MuwMhc-zqrsIyTwl5UkLT1P0zkw4ZwHlzN-DexNWTfmNywNttZEauOhGKm9vVRH9Rddd4HpgqqHFJVruEESz4/s1600-h/2018-03-02_12-33-27%255B5%255D"><img alt="2018-03-02_12-33-27" border="0" height="594" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMTmxfmXWG2a8M2eH4y4f6vr7-p4LqHOnW0TQL7k49NpEbrOxQpReh3C5m7oZg5SPwCm6NbO0RiCYb_ubh4CR6sR9LBB4oDmmmnwIlKHp5dQNCNjY76rZjSw2-av5UeqSa9rRWZYLHkq0/?imgmax=800" style="background-image: none; display: inline;" title="2018-03-02_12-33-27" width="813" /></a><br />
<h1>
Where From Here</h1>
This was a simple example, but what if we had to create a Contact record first and then create Addresses linked to the Contact record created as a part of the transaction?<br />
Please share your solution in the comment section. I have a few things in my head, which we will talk about it in the next post.<br />
<h1>
Logic App Definition</h1>
<br />
<script src="https://gist.github.com/amreeksingh/1e68d1ac8102fcf2167d376e44877218.js"></script>
<strong><em><br /></em></strong>
<br />
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com6tag:blogger.com,1999:blog-4535447606986422873.post-2379940109621756402018-02-19T23:17:00.000-08:002018-02-19T23:17:41.977-08:00Calling Dynamics 365 actions from Logic AppsContinuing on from my last post, <a href="http://mscrmshop.blogspot.com.au/2018/02/calling-d365-apis-from-logic-apps.html" target="_blank"><strong><em>“Calling D365 Web APIs from Logic Apps”</em></strong></a>, this post will walk you through how to call D365 actions from Logic Apps.<br />
I have created a global <strong><em>action. </em></strong>This action is not doing anything meaningful yet, it simply takes an input parameter and appends <strong><em>“Your Input was”</em></strong> to the front of it, and returns it as an output parameter. Here are the screenshots of the action.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5i9yZIMjEFiouhn7dlnafAQKwbDO-Ecc5oE1LlHe93TiiR5TvvC0sY78qFQmaRDfaJYOIKtBPIC3Q_kP41uQbtTsiVr2NBWJ4OtRSIghcK_dHzraj6ZdUehPGwbhe7xpxtdc954Y9AdI/s1600-h/2018-02-20_12-13-434"><img alt="2018-02-20_12-13-43" border="0" height="416" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih9TlPkL7jTJ9APsSgbfpfcFXHe3UeTfnMO1uCJCJDcn8PuweRVqb2VtjKw0LVdxZGQgcnqrq50ZdG_sTxHaHswN3laQRXz-MKgBVQMZx5x6-F2Mw1ELufAwCzKNHiBrUXRFHYQ25c5RQ/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-20_12-13-43" width="701" /></a><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHZbw9bcoXf03kYWAijosT4vkwsvFUzx4VzADLpjcwQ8Ng1JRvF8L9Fm8L4zTRqvYUiQsCRex8TIrwT3l5HwGXZF_INDQtaKjAZjgsae65KvR3Nm9dqwwsHucxQtdQ6Xf39ftz6CJMb2M/s1600-h/2018-02-20_12-14-14"><img alt="2018-02-20_12-14-14" border="0" height="208" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDOQYGGkRDVAZEKuazoxiYDT-j9L6nNvkQo2-8RyWxNwGpeN8jscuuCO6jyoysfZ_groMl8Z3xyTiqVJZsb7orUpP3pvV10jGSDUo2dNqcZPE86wJ17R-9_4QKdgZH02rRmq5My94WL-Y/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-20_12-14-14" width="599" /></a><br />
The above screenshot displays the <b>Assign</b> step of the action.<br />
<h1>
Calling the action from Logic Apps</h1>
I have used the Logic App I created in my last <a href="http://mscrmshop.blogspot.com/2018/02/calling-d365-apis-from-logic-apps.html" target="_blank">blog</a> and modified it slightly. I have only made changes to Step 4 of the app.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWBEg5zGoBPnTKokyX1U-8GjKeqZY5tv4_UiUUOcTpDlhARr-H4qQnAccYFoXAU54jDJjoPOHm9TXtVBRWQCLKc5J1NzKm9pagrTAliP0S6i337j-mDBQpc-nWP1MYPoOE6ppPOiUdGuM/s1600-h/2018-02-20_12-21-33%255B1%255D"><img alt="2018-02-20_12-21-33" border="0" height="567" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHAH3NGmbTbqigfMLieFN5DBIY2AvC51wLTV-v-pHexZX3Cd5wQwDhZbYUqyusDxOAVMSH7LAEV3vATzTcyWz22fbD7R7Kv8VlNASVFklyAupGRxg7-2R_eG5_NwtK3Nu4JV4_SQfqYQY/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-20_12-21-33" width="497" /></a><br />
For calling an action:<br />
<ul>
<li>Use <strong><em>Post </em></strong>as<strong><em> Method.</em></strong></li>
<li>Provide the D365 Web API <strong><em>Uri. </em></strong>The last part of the Uri is the name of the action I am calling. In this case it is <strong><em>new_ActionLogicApp</em></strong>.</li>
<li>Provide the input parameter of the action in the <strong><em>Body</em></strong>. <br />{<br /> “Input”: “MyString”<br />}</li>
</ul>
Save the Logic App and test it.<br />
<h1>
Result</h1>
I have attached a screenshot of Step 4 after execution.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDLCw6QthHCfgK28qCO2GI7Rx6EbX9W9SxDREMw9Ul8WEHJGW2XhzXrWg2YYrqzX7d1tb89qO2Bh7U-bUvxcKOlqPnVGkn6qvKfbjlHCCQfe0_-255gOU_x-k4uHYw69wTNVD8G1Pyxrg/s1600-h/2018-02-20_12-35-58%255B1%255D"><img alt="2018-02-20_12-35-58" border="0" height="812" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnpI7-bCNcuKLl1oJNhEBf2ZiLrObtcvPRQmv_JNLi8YM9molTmMd1XQzKs_DXbEWuF5aMPvvXwlFgQbuM7BMF7BADwcWyDYOECj5aIkh4tEKaC59JqGVUHMQswGQ0WPp0oO_zEA8OKNI/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-20_12-35-58" width="522" /></a><br />
<br />
So there we go, we have successfully called a CRM action from the Logic App.Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com5tag:blogger.com,1999:blog-4535447606986422873.post-58902225182382984222018-02-18T21:25:00.005-08:002018-02-18T21:25:55.504-08:00Calling D365 APIs from Logic AppsLogic Apps are my favourite topic from last few months. The blog is about calling CRM Web APIs from Logic Apps. Now the question is, why do I want to call the CRM Web APIs directly when Logic Apps provides a Dynamics 365 connector out of the box?<br />
<h1>
Why call the CRM Web APIs directly?</h1>
The main reason is that the Dynamics 365 connector provides only the following actions:<br />
<ul>
<li>Create a new record</li>
<li>Update record</li>
<li>Delete a record</li>
<li> Get record</li>
<li> List records</li>
</ul>
But CRM Web APIs provide much more functionality than listed above. What if you want to call an action, a function, bulk Create/update, transaction integrity, and much, much more? In these scenarios, you want to call the Web APIs directly, instead of using the Dynamics 365 connector.<br />
<h1>
Authentication Approach</h1>
For this blog, we will be using the single tenant server-to-server (S2S) authentication. The best part of using this approach is silent authentication, instead of redirecting the application to the Microsoft login page. Secondly, we can use the “application user” (integration user) to connect to CRM, which does not need a user license, instead of a real user. We can assign the minimum privilege security role to this account as a best practice.<br />
<h1>
Registering your app to access D365 and creating an application user</h1>
Please follow the linked article to register your Logic App in Azure AD and create an application user in D365.<br /><a href="https://msdn.microsoft.com/en-us/library/mt790170.aspx" title="https://msdn.microsoft.com/en-us/library/mt790170.aspx">https://msdn.microsoft.com/en-us/library/mt790170.aspx</a><br />
The article’s heading is <em><b>Use Multi-Tenant Server to Server authentication</b>,</em> but the steps are exactly the same for single tenant.<br />
<h1>
Creating a Logic App</h1>
We will be using the <b>clientid</b> (<b>applicationid </b>in Azure AD) and <b>secret-key</b> to get the authentication token from Azure AD, and use that token to make a Web API call.<br />
The Logic App we are creating for this blog is very simple and has 4 steps.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbG0_erIHePhbttOPv9bQgIGQYc98jJOMGdUWCdHYY-__V89LWiCFo488jH8pGM-co6roJACr_0vFwQP6ShJl7Pk3ol0uwr584wB-YRY1Rne_RA1eCYI8lSB18Qf05tTFhLC1wMBg7nW0/s1600-h/2018-02-19_13-23-18"><img alt="2018-02-19_13-23-18" border="0" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYauhhvgEgmirwW49-Kcb4QmQma_kGnA2zr9NlJB1wlblkJu_gXL6RCsZDug_J_SvBZ6jycDYglf0-I0z7x3Joh3OH0b6i_AEJdVtMZwHrOdcePFlgfXEMf9NpYYhKM83ehYFPlCqK0Uc/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-19_13-23-18" width="682" /></a><br />
<h2>
<br /></h2>
<h2>
Step1</h2>
This is an HTTP trigger that can be called from the external application to trigger the Logic App. This is empty for this exercise, but will be used to pass the information to the Logic App from external data sources in future blogs.<br />
<h2>
<br /></h2>
<h2>
Step 2 </h2>
This is the main step. I used an HTTP action to call Azure AD for the authentication token.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlpdP37ihAU8FLq44ToNn9QH-wVWhyoxDz5Tqd2pIKaZxbDkglajOobA1ZqioLaQlG7xIG5UHd6U1Bdj2dWTWbkV4CMgQpiUauQOwmu3HEnN5dURveS_j4dmhSdmGl3KktifZ4UI3P1Q8/s1600-h/2018-02-19_13-43-35%255B1%255D"><img alt="2018-02-19_13-43-35" border="0" height="508" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYU4GhQb6nBQQ7NB88kPJ3TKE0yu_YFwyqaGPYDPx2bi8VffFzk06uaFWJCQLw0g3OeYkNT8KuUygT9QLBWUqGuX8t_We68vzgtCy6C1hg_rHCSl0ZH8wMjdG0I6LyJxtvBgV4kBUF3Ig/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-19_13-43-35" width="778" /></a><br />
<ul>
<li>URI- It is an Azure AD authentication URL to get the authorisation token. The guid in the URL is the tenant ID that you can get from the Azure AD’s properties.</li>
<li>Headers- I used Fiddler to capture the request and retrieve the headers.</li>
<li>Body – In the body I am providing the grant_type, clientid, client_secret and resources values. I got some help from <a href="https://alexanderdevelopment.net/" title="https://alexanderdevelopment.net">https://alexanderdevelopment.net</a> for this. He was using the grant_type of password and providing the CRM user and password in the body.</li>
<li>Authentication – it is set to none. I tried to use Oauth 2.0 for authentication and provide the required values, but it never really worked.</li>
</ul>
<h2>
<br /></h2>
<h2>
Step 3</h2>
This step is simply using a JSON parser action to parse the output of Step 2 to use in Step 4.<br />
<h2>
<br /></h2>
<h2>
Step 4</h2>
This is the final step that uses an HTTP action to make a CRM Web API call.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEght6CBEymSOQ994j1Jom0WPLubiHP2mU-Ct4wos-TURE2CVfxJtoCr7WmsJsuiiS7osaYc3_iC5rlQRtVRYGtnobKu-L43z-bBi-DLs3Iy9KZ5UDTVZa7jNZfDbsUdHgG_eE2HGZd4iJs/s1600-h/2018-02-19_14-21-36%255B1%255D"><img alt="2018-02-19_14-21-36" border="0" height="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV9VXHhtGUVPhRuDwKWVffgfeyXgypq82nUzDFycZIFXvVboZy9cDBpUkhiy6LAn_zvz96seQBXYGKszOjemg62UjO2_refSkQXOpbh3q5eMHED9sObtEPTnt-VYZ9-X77KRySQQ9ris4/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-19_14-21-36" width="766" /></a><br /><br />Method- I am using a GET method.<br />
URI – The CRM Web API URL. I am using the GET method to retrieve the top 2 Accounts.<br />
Headers – Most of the headers are taken from sample requests from <a href="https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/web-api-basic-operations-sample" target="_blank">Microsoft websites</a>. The most important of them is <strong><em>Authorization. </em></strong>It is set to the <strong><em>Bearer access_token </em></strong>retrieved in Step 2.<br />
<h2>
Run the app</h2>
Run the app manually. If you get all green ticks then it means everything is working as expected. Double click on the steps to check the input and output of the step.<br />
The following screen shots display the input and output of the HTTP-GetToken and HTTP-Call CRM API steps.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwdaS0iVW72V9d0E1PuwAKpBXQHShyphenhyphenqShyphenhyphenlz3jKU2XqvQDT2Gu7C7zQpTh725DFOsXwPUAOLoviO-wtZe1ln9DIu3NKXdcBX95TE_98e0CP5ECxHs04p1yFdKH4ikscYS9ALpTLVxZfrg/s1600-h/2018-02-19_15-04-02%255B6%255D"><img alt="2018-02-19_15-04-02" border="0" height="881" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdnXMNxj_b65ZGGYy0nuQo_BSZvOsqs2Wre9f6j7HXgKoAGTksHNFcbZPN7roKsnDYaV6R2GRHXLzLvQMmve4QXxmpuM2BB2_QhO1rw6cf_cp9qWaZHsuHGqYRmV8YUqskwRwNva0GUdo/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-19_15-04-02" width="544" /></a><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfL-77BKZqeuxDUSCpiE3t6F3XW3FwM2fbYouw2K7KJAhCpCoUXSCxUi-sxzfAv5-i-PPMAgO24fULBUr_JXZc3P8zm6QLK2Xd4E7h7WDBN8hF6L1oQKqdUKJO802Ar1QSBB8kBl4-JFE/s1600-h/2018-02-19_15-06-35%255B5%255D"><img alt="2018-02-19_15-06-35" border="0" height="838" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNPaCK_zotw8A4unySdJSqDIpfhiA0KdepQBVC40fFGgd5WOAiFfimT0LeCU6_n0UtsX6d-jXBhCMj_1s1uxtimCNYChssJ31YwwLsgvzrdSppahE2P64wc9rczl47PLfYigRZLiCpnjg/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-19_15-06-35" width="548" /></a><br />
<h1>
Logic App definition</h1>
<div class="gistLoad" data-id="8488564" id="gist-8488564">
<script src="https://gist.github.com/amreeksingh/a364422c58e566e52f6bace76ffdbe90.js"></script></div>
Replace the <b>clientid </b>and <b>secret-key </b>and test the app.<br />
<br />
<br />
<br />
<h3>
<br /></h3>
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com9tag:blogger.com,1999:blog-4535447606986422873.post-6527974334997548862018-02-01T18:51:00.000-08:002018-02-01T18:51:57.921-08:00OCR Dynamics CRM email attachmentsI am very excited about this blog. I was watching a Logic App demo in one of the Microsoft Ignite videos where an order record was created in an ERP system from an order image using Optical Character Recognition (OCR). I am trying to do the something similar using CRM email attachments.<br />
<h2>
Scenario</h2>
The scenario is when a new CRM email with the image attachments is received/created, the image attachment will be processed by OCR, and the response will be used to create a new Lead record in CRM.<br />
<h2>
Solution Overview</h2>
The most exciting part of this solution is the number of Azure services used in this solution. The Logic App is used as integration layer for the solution. The following diagram depicts the solution architecture and process workflow of the solution.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHkJwdI36Gu56qOpcPSSzbeCSMpwBkLOeq6enO9HccQEljxJ_tPb_1B7XnARxRLssbXQpNBbC1GuJKJH3381zgBRSWcKDp6AZT2KiG5jrwyx5e_ZntnN_YUGKC2YNkvyCI32xC_F3tHEA/s1600-h/2018-02-01_21-17-17%255B4%255D"><img alt="2018-02-01_21-17-17" border="0" height="490" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh84uNd3nHx9s_QMGjJEdNwTFygNloyJ0Fi5PDDrB0fIF2DE84cRf7i_PXCnpRlrIwpltyVsahXuevL8Le9BcWUrI83GtwE-987Kluk7TWxtMZCa-p3v4BiI1kPEVH59KTOfHSuVORtiW0/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-01_21-17-17" width="768" /></a><br />
<br />
This is just a learning exercise. In the above diagram, we could have merged steps 2 to 6 in the Azure Function (webhook receiver) and pass the end result of step 6 to the Logic App.<br />
<h3>
Process Flow Steps</h3>
<!--StartFragment-->
<br />
<ul>
<li>When a new attachment record is created/received in CRM, it passes the RemoteExecutionContext to Azure Function (webhook receiver).</li>
<li>The webhook receiver reads the attachment body from the entity attributes and calls the Logic App with the attachment body.</li>
<li>The Logic App calls the cognitive services Vision API and passes the body of the attachment.</li>
<li>The Vision API runs OCR on the image and passes the response back to Logic App.</li>
<li>The response received by the Logic App has some unwanted data, so that response is passed to a second Azure Function (OCR Parser).</li>
<li>The OCR parser transforms the response, assigns it to a lead object (class) and sends it back as JSON string.</li>
<li>The Logic App parses the JSON string.</li>
<li><span style="font-size: xx-small;">The Logic App uses the 'Dynamics 365-Create a new record' action to create a new Lead record in D365.</span></li>
</ul>
<h2>
Components</h2>
<h3>
Azure Function as webhook receiver</h3>
<span style="font-weight: normal;">The first step is to create an Azure function which will receive the RemoteExecutionContext from CRM when a new email attachment is created.</span><span style="font-weight: normal;">This Azure function receives the CRM context, extracts the attachment body and sends it to a Logic App in "binary" format with a content-type of “application/octet-stream”. This is important as Azure Vision API does not receive the image contents in “application/json” content-types.</span><script src="https://gist.github.com/amreeksingh/6c8b6554bcf4ddfe5077425046b1a100.js"></script><br />
<h3>
Webhook registration in CRM</h3>
Register a webhook and add a step on the Create event (Post) of the Attachment entity using the Plugin Registration Tool.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4Q_DQWBg92uRno1YB2cz_-j3zi94dxB8jOu_eA14IKd_Md7jzfFd4bLseJqdwF6Rby_n7_fdIVDpsxm4C4K5jIeZ9qAA548jd4PTx6fiDnyafA-DmhxKaf3RlTnRcnrcXk7yZkIjzS5A/s1600-h/2018-01-31_22-23-36%255B7%255D"><img alt="2018-01-31_22-23-36" border="0" height="316" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJNv-e8IVwllqMqrXNu3sxvQWbcCNTVapmtAuvPx0uqD4ulBbB_jFNaEpF5Ymiw_yf5DLBKI9Beuw1pwjsZ8BhJRPtOMD6K3kJhDP9jBqaK81sOyXOtDGiijjS8vj4pKdEe2EcVZcLZxs/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-31_22-23-36" width="302" /></a> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKB3E-ROAldOq6ULiXJ3v73z_6CGeyg3mCvJ9aLL0yoFBNEOe9qnKlNBRbfyVkmlI5KiRnyQWhAyh9X9Gr7E0Txy25JZz_oMsVpVAqKBgTQhwbpGRLO6PnV66qCekuujtp_C4PkxR8ayM/s1600-h/2018-01-31_22-30-34%255B6%255D"><img alt="2018-01-31_22-30-34" border="0" height="315" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDG9OnTIYPyMoDDCU9jKeVijXdhE4-M-fphqkyE5-xC3fSWV3C0XM3W8ZUjd8-9LGXgpkKo2xW2v6IdeuUmi5jL1pJn8KHQux7lRBSqNGX52CFMP9Q-0bfGW0eFwevT5aAyY41FU_2t-k/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-31_22-30-34" width="323" /></a><br />
<br />
<h3>
Azure Function for OCR parsing</h3>
The OCR data has a lot of extra information like regions, lines and boundaries. The parser reads the required data from the response and assigns it to a Lead class. This class is then serialized into a JSON string and sent back to the Logic App.<br />
<script src="https://gist.github.com/amreeksingh/83ae003f17f148bcdc6afdc0bf273292.js"></script>I got OCR processing classes from another blog. I can't find a name of it now.<br />
<h3>
Logic App</h3>
<ol>
<li>Create a new Logic App and add an HTTP trigger. The URL of the request is used by the Azure function (webhook receiver).<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCvkpr4PrAE-_UJ9-i8hFd4gkGjlT-9gI6XI87jsBr0d26TboY70bZ8rbTN0pZgTwmi99nVixc7C9iOquFFY4NXvEE7IeaBrJdIwoO3DtA6tlCFUyPBFZAaRwrCZxyeWosNA0IdoR29UY/s1600-h/2018-01-31_22-44-41%255B4%255D"><img alt="2018-01-31_22-44-41" border="0" height="246" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1FfBeuxz6isZUQvLPft_v3b1V-YwNa-wuyJ9pTHi6n-YdIV9KNmLrJtSoZFJYzASS0iV_v00M1D6DBqx2R2AAdWEmX_6yY_JTmdbBkpeuApac-qPHUDN-dO6UhUZtpxVKuGF7l6X70u4/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-31_22-44-41" width="435" /></a></li>
<li>Add an <strong><em>Optical Character Recognition (OCR) to JSON</em></strong> action. For this step register <a href="https://azure.microsoft.com/en-us/try/cognitive-services/?api=computer-vision" target="_blank">here</a> to get the URL and key for “Computer Vision API”. Enter the connection information and after the connection is established, set <i>Image Source</i> to Image Content, and <i>Image Content</i> to the Body of the HTTP trigger.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnbTq1r__LY1DPKq_inZDJXSesGAW9enHDo-0KV-gmM_tINIbIkIu5_jBDBXEHeIM2aTtlm64LN9cJPntTHGuVn-FdGNiDvjW4i_jaVKkM2dnOTMPq1BttQ018tFlqqPbbh8LxA3L8Sys/s1600-h/2018-01-31_22-57-28%255B4%255D"><img alt="2018-01-31_22-57-28" border="0" height="116" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaja_BvB7Bjf-0h6oFmTx7sjuZhfss7rsXzUfdmc4JsOXgt0NUQ-MxOtNMmt2qLMTHUZyuLQ-k5lscTZDyErpTYaRV8PbwObzSs0ORVDlbiCzYPJKrZpOILCbYQAGTgBs2CNwFKxd-HMc/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-31_22-57-28" width="438" /></a><br /><br />If successful, this step will return the OCR response.</li>
<li>Add an <strong><em>HTTP</em></strong> action and enter the required information as shown. The action will return the serialized JSON string of lead object.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijFQBMkuIogmv37ZMAS3uVIpFNlxN09SH31UxGmxSeZc8B7BZ2wtHmE_PYRbDG8IJmm2sa3j6OkqqBPj2mIyRS9nFYplz0Kc2CdqgcUMy-786WM5Z6_oKWcJonDEgO9P0QPjVTRWvvi4w/s1600-h/2018-02-01_21-52-48%255B4%255D"><img alt="2018-02-01_21-52-48" border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN1uDgN9RI25NivY6CPivcXOxOCENcrX48199a29zWa1yUvoao0V29wb1WkjhoBDs6OPgpQxbyX_6mjnAmV52tPQKPInuZXrp3Lurj6KJGKvdrQV1BgQOw_sG5OG1GMYi5ZwVFPfMz834/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-01_21-52-48" width="439" /></a></li>
<li>Add a <strong><em>JSON Parser</em></strong> action that will parse the JSON string received in the last step.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggm_YMU0xzzZlG0an138b_ILgRDfjY1vPweJQunO1-QsBsC06xDKgCFcKXnDZhC-lyT5Z_Q5oq3bG9pyTOP_ZOPjn5zXUvWgXO30fUz3Z64jpuZ5FRRv0xcdRXaIUPA4yX_3w4z3_XT90/s1600-h/2018-02-01_22-00-12%255B4%255D"><img alt="2018-02-01_22-00-12" border="0" height="234" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSFt7O1xM3IBvpt9o-0Y59_TbF6_IUWRU0CPA8cx594rjV7D0bZHO-f61-A4ArRSObayHRM1NwMAHUuXbtkbsG4VQKeHht0gbERb_23vNQ-yS2_sF17jVm1E8uKQvSA_ji34Y3-GDaSYs/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-01_22-00-12" width="443" /></a></li>
<li>Add a new <strong><em>Dynamics 365-Create a new record</em></strong> action. Assign the values based on the schema of the JSON parser.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6It_9KbGqmYWh_LzFhV9J-odftFuGtO7DSs2cHfeNrh_Ss3etCSoRzTnsoVqejLqOc-zFl__HpM7UT6pHYLXwRgfzllBsBCqnMdyb_M52bMKHKxG_X0uVO-1NwDWumPayStGc6GXvz_8/s1600-h/2018-02-01_22-04-49%255B5%255D"><img alt="2018-02-01_22-04-49" border="0" height="435" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuwkGIaHfjA80p38Pd33TCjvIkgh1x8CQ8qAmn1TWZ3l2OExP6w9GoHcNx77BOSL-FqrSEZv3tJx-89orqnuzsSZX1LKJAstTc9alyBYIrrH8DxbC1NJLnyt84WwZl_9fJy2Jg7rGmkzA/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-01_22-04-49" width="450" /></a></li>
<li>Save the Logic App and test the solution.</li>
</ol>
<h2>
Outcome</h2>
I tested the solution by sending an email with the following image attachment.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPFcBxqEsoyafKDqloX-Ft7MZlMKAmNCMAxMxzW-NAThPGJ9swKUcyPCp8KGFHoiKyh5zi_K2w4dcC2KHMY96S4DWkxJ9w_uLtnD5VglEsNPlUOrQ_-FgfP0jpCM-PUGb6VgUL6WsmqhY/s1600-h/2018-01-30_14-21-26%255B5%255D"><img alt="2018-01-30_14-21-26" border="0" height="234" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyKWptBBT4d6-SnxGzt63hZtK_Rp7y9zOQ_CPQo42ZPxOXXRoJpKP82SLk_3EpG9xtxWm4T1WGVo3UteKLJLOhLJ66uySftJN87vuRx-CzH29P8Qjh2ZweAwUHzRqkAvRXt43E9qgrc5E/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-30_14-21-26" width="599" /></a><br />
<br />
This is the result in D365.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwZqJPxCs2W-W8YmdMMV-jw-rUaMicqV5mfRzopiYTJ62iMH1L8qXfv5aZHSZAZFlCgJNM5lmrZ2eb8Qm-9IauXhILI8dpMuBHg09RV24AGXuwwYP5IIAC5AEL9pfbGHqmKYAi3a2JrUI/s1600-h/2018-02-01_22-13-53%255B5%255D"><img alt="2018-02-01_22-13-53" border="0" height="407" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggJHmUjNpLpGtc7bOCZ_-Ig09RmU7fcxzBEJCTHPkQPIS20zF_a67VX54NsoO5XeLJasWgmTOsQFylD2e1mtkLgjCkFhodHkOQWW09rJk4ppdumiSzdEgwDmfutIlybA3mNZATlxydr4o/?imgmax=800" style="background-image: none; display: inline;" title="2018-02-01_22-13-53" width="595" /></a><br />
<br />
<h2>
Issues I faced</h2>
<ol>
<li>Originally, I wanted to use a Logic App trigger (Dynamic 365 -When a record is created) to get the attachment body. For some reason, this trigger does not work for the attachment (activity mime attachment) entity.</li>
<li>Even if you can get the attachment using the Get Lists action by passing the Email entity guid, the result does not contain the body of the attachment. I don’t know if this is by design. In short you cannot get attachment body by using the Logic App D365 connector. This is why I had to use CRM webhooks and Azure functions.</li>
<li>Sometimes the OCR API does not recognize all the text on the image. For example, in the screen shot above letter “l” is missing in the email address (satnam@<b>live</b>.com versus satnam@<b>ive</b>.com).</li>
</ol>
<h2>
Conclusion</h2>
I believe this integration scenario has massive potential. It can be used to:<br />
<ol>
<li>Create records based on hand written notes.</li>
<li>Automatically link attachments to appropriate records based on some value on an image or in PDF documents.</li>
<li>Some federal department applications, banking loan applications and RMS (Road and Maritime Services) still use paper based applications. This can save them tons of data entry.<br />
</li>
</ol>
<br />
<blockquote>
<br /></blockquote>
<!--EndFragment-->Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com6tag:blogger.com,1999:blog-4535447606986422873.post-57802432093036205132018-01-15T18:17:00.000-08:002018-01-15T18:17:10.897-08:00CRM- SQL server integration using Logic appsIt has been a long time since my last blog. I am thinking of doing a few more blogs about Logic Apps this year. The best thing about Logic Apps are the number of connectors available out of the box to connect to different applications. With the enterprise integration account, Logic Apps can implement enterprise patterns and scenarios similar to BizTalk server.<br />
<br />
This is the first blog of the series. In this blog, I will integrate D365 online with SQL server on premise using Logic Apps.<br />
<h1>
Solution components</h1>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirikbbtaoKEmpnHOT0Cpl7XgLIDQxQ-lCHu3YG8szY1Xn_f6i3uool114zpKYvTGqC6TDVEdK0ymIxJPLf2v4GZx2oQLez4-VNPX3CXX5LSIjYRLttsGboHqIEAoq6AsxUv6Y5MyZdfRM/s1600-h/2018-01-16_11-29-22%255B8%255D"><img alt="2018-01-16_11-29-22" border="0" height="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHZ6XUv07TyHcJG37n6MC2ACGBlszz5htFzHYAbjDuhyphenhyphenkDgCyDVswcJzVenHMDN3xQjToa3PUjSGhvnxb8qkg4j1a_4UKw4w_FLBly4mtqTo7ZthSsMufkNcTZHeRr_Yqy94yn3hKMoPA/?imgmax=800" style="background-image: none; border: 0px currentcolor; display: inline;" title="2018-01-16_11-29-22" width="724" /></a><br />
<br />
<h1>
Steps</h1>
This is very simple integration scenario. This Logic App will poll Dynamics 365 for new contact records and insert a row in the on premise SQL Server table named <strong>Customer</strong>.<br />
<ol>
<li><div align="left">
Setup an on-premise Data Gateway. The following link provides the step by step instruction to setup a gateway.<br />
<a href="https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-gateway-connection" title="https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-gateway-connection">https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-gateway-connection</a><br />
Note: Consider latency while selecting the region for the gateway</div>
</li>
<li><div align="left">
Create a new Logic App. Check my old <a href="https://mscrmshop.blogspot.com.au/2017/01/using-logic-apps-to-create-records-in.html" target="_blank">blog</a> for screenshots of steps to get to the Logic App designer.</div>
</li>
<li><div align="left">
Select a <strong><em>Dynamics 365</em></strong> connector and select <strong><em>Dynamics 365 - When a new record is created</em></strong>.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf9Eozrs9nXJJvzUXJ3UH4W5UO6MDhGXGXvVzoCknRbFjC3SaYK9fFl4nqiHm_5m5i2mATEXS_70AErk7EdfpW359iog4XcSB3cGFXFcfJddcwuOWpzrlTKXPoHP0d4avdEdNRKLgTlhk/s1600-h/2018-01-15_22-34-33%255B5%255D"><img alt="2018-01-15_22-34-33" border="0" height="391" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNbGDTQWwgAAzE5HapNnkdq6TZrnXJzjVtZWigejlu_H9vsA_5VoFRARlAE_e3YMR5wt8sTfOSlGPgN4xXvXVzL3_GbOXMOcr1sIZhzsbLMVmwsRznlMPY4DU2GysEXvkNPafvvQTnlqU/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-15_22-34-33" width="589" /></a><br />
<br /></div>
</li>
<li><div align="left">
Enter the username and password to connect to your D365 organisation.</div>
</li>
<li><div align="left">
Select the <strong><em>Organization Name</em></strong>, <strong><em>Entity Name</em></strong>, <strong><em>Interval</em></strong> and <strong><em>Frequency</em></strong> as shown below. The fields <strong><em>Interval</em></strong> and <strong><em>Frequency</em></strong> are very important. It will define how often the Logic App will poll D365 for new records.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheRGqxYWeM_darSutOaUxRGZdlYl5vZ58eY88YxdrbA8VoQRYpQGQpBB7vkFH6RX5EHEe1Ovvx4Doekd691u70T5olgCFRqrblyMc8dVZ_4cr4CCujKAjaujGb0NRPthtpFOJFcUC46gM/s1600-h/2018-01-15_22-52-42%255B5%255D"><img alt="2018-01-15_22-52-42" border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiryE6_V0ls02px8sUGTHA2RFIMnMWvx-1wicA96RyLv1xK5kX78UFMCxZVroGQHHkLPANcBu6_EtTZD3_C23lluV8BhyphenhyphenxRFuoL2mqDuwcZLTh1f9KRGuwGAZdQ2tNte8-7Th-gdrEHWkk/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-15_22-52-42" width="587" /></a><br />
<br /></div>
</li>
<li><div align="left">
Add a <strong>New step</strong> and choose <strong>Add an action.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjebnSJwT3iD5jLTDcUMEMs6tiQSaT-4LODl9mxRtuz8soWjqR5quvJmEsCTADttqpY07hyIUFtot5dstnM0VkdsmZYu27In9QKAvdVFYK6Xb130BMCUF_rL1cMth0rARCHXxbF9DpTnHk/s1600-h/2018-01-15_22-57-29%255B5%255D"><img alt="2018-01-15_22-57-29" border="0" height="141" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYFK_Y47MkFEbF9x6rBASrcFfRwqtea5XXyhKQLsug4jna8i5aCjWbZ4J_BO1dHvCg4DJqQ12_9c_a9uA-Qd26IbgdSlX_WoohdmAAEicHA1ilGlPzAkG2n-ZqG_4b4UHvFVcWPDa2wSc/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-15_22-57-29" width="368" /></a></strong></div>
</li>
<li><div align="left">
Choose <strong>SQL Server</strong> >> <strong>SQL Server - Insert row</strong>.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlMT_xUWD8-sBeqtXlGbiMWoJQZlOq_-DKpqZ2cmQDoscI0y3Z2LoHakMx76dbRW-RDhpb_qCMqXMDBj9DwDr4RiazjxGgz8j4qPTM7mk348jOmIjD41z9sEYmjmoJ-gJTLf9HnIPR9sg/s1600-h/2018-01-15_22-59-51%255B5%255D"><img alt="2018-01-15_22-59-51" border="0" height="395" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsWgkqvcYKdH9yPrdFymsZy0ii5J3Hqsicik5pAd3A-gI6X3hLEFfnv8CKyypSVnE3jzQnE782AOiVs6F7xQCcK2lZphNRmfQTxLcLp9wIVvHFVoRFcUc2xgaTT7vCZO-4cI3EAbuAmok/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-15_22-59-51" width="583" /></a><br />
<br /></div>
</li>
<li><div align="left">
Enter the connection information as shown in the screen shot below. Make sure <strong><em>On Premise data gateway </em></strong>is checked and select the gateway created in step 1 of the blog.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1M2XLP81kybryYzbrFSHZwoeu3vOe1J5GQE9EyQtKgxuKNi3fL1-OaUntKF00ZEmNT9xuDoHAq85CijR8B1Adb2e7JqewIEJ0IU3C6QXcJbk-QJP13kxJa-5kA_7jnymTOySlc_ONdwA/s1600-h/2018-01-15_23-13-17%255B5%255D"><img alt="2018-01-15_23-13-17" border="0" height="409" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV20yhKydqhpXs-wGnSBL4N2CQYVsLvKQLIm_2b9xganfg3O79vspro4UwotG682MzvjLEcsuPh86QjCQ1IftIR0Sz2ABPINu_2HnXC0Xl7aHiQkH3brOLGC6m697osz9edXySAr3SFd4/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-15_23-13-17" width="591" /></a><br />
<br /></div>
</li>
<li><div align="left">
If the connection is successful, select the name of the table and map the column names with the CRM field names.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjitMgRtV-npO2mdibHo4hr4dMF11Wqur6nnZ857IQoh0l3o-dl-FmGq54rnduLnoK22JJir8X_PeYqKwPkaAq8GiJR_GI4DJGyb3ptF2PuS14vlRpILq3cDcojI4xBwj9GZ2x3P0VOl50/s1600-h/2018-01-15_23-20-04%255B4%255D"><img alt="2018-01-15_23-20-04" border="0" height="344" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho_JWnq-ykcIFZfwVqQ0L3SuZpSbQ2VdO3oh-jwA6KReE0q6OgXUNhS-Ww90NaDeHJpvyDxZD4yiQrmKv_51QDIA6M3Z8AB9bYntKv_Uho7MczfgBwPHLudkZPH1fd_Dgsg39EfuMs2LY/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-15_23-20-04" width="602" /></a><br />
<br /></div>
</li>
<li><div align="left">
The output of this action can be used to perform further action. For this blog, I am not doing anything with the output. Save the Logic App and test it by creating a record in CRM.</div>
</li>
<li><div align="left">
I ran some tests and here is the <strong><em>Run history</em></strong> of the app. After the initial run, the average time to process a record is sub 3 seconds, which is quite good considering my machine is Australia and Logic App is hosted in the US West region.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3FK17KtQNp_MU6lnAGHM7UHugRbukR7Pm04SHiKgsdNj3wFNMqgUVF7jWEBnxmHXYBFoDcC6S7m9Cynhfr28yOeC_go2kCxkupBEoEinXDTYAyh7kfDjjzKcDjtPVEsdP6sYZm4Z7qbM/s1600-h/2018-01-16_11-47-05%255B4%255D"><img alt="2018-01-16_11-47-05" border="0" height="287" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2EzeCSkzedL2UddJOrwsE2WG1Jj_OASPiT3231X8kp9q1Y_hwtK3uXf4yMnAT8fZHAbWIIacfR1mHTwj9PdW9yDit5CuuGgpYpNKlWCwJzL4TmpY75yeRVOSywgqqhFBHZSbMeh_goU8/?imgmax=800" style="background-image: none; display: inline;" title="2018-01-16_11-47-05" width="597" /></a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
</li>
</ol>
Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com11tag:blogger.com,1999:blog-4535447606986422873.post-82111873673818096622017-10-15T21:34:00.000-07:002017-10-16T17:21:40.168-07:00PowerApps and CRM optionsetsIn this blog, I will walk you through the steps on how to work with the Dynamics CRM option sets in PowerApps. I will be extending the app I built in my last blog <a href="http://mscrmshop.blogspot.com.au/2017/10/crm-and-powerapps-revisited.html" target="_blank">CRM and PowerApps revisited</a>. <br />
<h1>
Problem Statement</h1>
The problem is that if you use out of the box <strong><em>Dynamics 365 Connector </em></strong>for PowerApps, it only retrieves the numeric value of the optionset. It does not return the text value of the optionsets. Below, I have added a <strong><em>Preferred Method of Contact</em></strong> field to the <strong><em>DetailScreen1.</em></strong><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoaFoprXT30xzWccyM2a31Bu0sA4HZgRzzKxyYhW3Z0zFQENk5CLaUwGdlIm4ciei8KmxPWQHvElprKV6IrvC6nkWVCLPRyXa-IREHL8ev5Qpf0aWvLwfAGe9HnQPj_yxHdYHcz8Md2Ps/s1600-h/2017-10-14_22-57-42%255B5%255D"><img alt="2017-10-14_22-57-42" border="0" height="524" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIy_gBIKvXNvbekOoQuZBUsxwRZo52u08rUtFjqg-Xlw-lTaPvnggbXYMVGY3bxH_I4RiHE0MS8FxhmlDV0RnHY7pb9dYrzDsKvcaqjkT_KW5QUX-OimfPMAxgCzOSEUg1ojkTI6g9qdA/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-14_22-57-42" width="781" /></a><br />
As shown in the screenshot above, <strong><em>Preferred Method of Contact </em></strong>of 1 means nothing to a business user. It should display email, phone, mail, etc.<br />
<h1>
Solution</h1>
The Dynamics CRM connector for PowerApps does not display the text values of the optionsets or the metadata of the entities. So, there is no straight forward solution for this problem, but we can use something similar to a data maps table that contains what these numeric values mean.<br />
<br />
Here are the steps:<br />
<h2>
Create a collection</h2>
We will create a collection (<a href="https://powerapps.microsoft.com/en-us/tutorials/create-update-collection/" title="https://powerapps.microsoft.com/en-us/tutorials/create-update-collection/">https://powerapps.microsoft.com/en-us/tutorials/create-update-collection/</a>) to store the optionset values and the corresponding text.<br />
1. Open the <strong><em>BrowseScreen1, </em></strong>choose <strong><em>On Start </em></strong>from the <strong><em>Actions </em></strong>Menu<strong><em> </em></strong>and add the following code.<br />
<span style="background-color: #cccccc;">Collect(Myc, {optionset:"PreferedContact", OptionValue:1,DisplayText:"Any"},{optionset:"PreferedContact", OptionValue:2,DisplayText:"Email"},{optionset:"PreferedContact", OptionValue:3,DisplayText:"Phone"},{optionset:"PreferedContact", OptionValue:3,DisplayText:"Fax"},{optionset:"PreferedContact", OptionValue:3,DisplayText:"Mail"})</span><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-wvul2AoMHd5ifabfKwPLo-qVXEC5oeSRZzO3eXsZwj93Y9FJubDE9iEZoh_Z0_qlrQO1-fKfRLEY8HCdq-57vB8tnpS-aHJNKTrHUmGvxbwYMgGC7FCxM0Kx2Awjpz14SrTt6r8nldQ/s1600-h/2017-10-14_23-23-02%255B5%255D"><strong><em><img alt="2017-10-14_23-23-02" border="0" height="370" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQ6oC7igYbRRgHmnX5zlQfNhk4-rxRuM6P3s1OGw2c5Qt6tWSclqiH3MeaeS_uZp4zwa_Rlfrl8t_1zb2B50a1kjuvesbK0yvM4W7muJYijeAV4RfAXPXp_3Xu1FI6R1k1xQZHWySR8U/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-14_23-23-02" width="804" /></em></strong></a><br />
The above code will create a collection <strong><em>Myc.</em></strong><br />
<ul>
<li><strong><em>DisplayText- </em></strong>displays the text of the optionset</li>
<li><strong><em>OptionValue- </em></strong>displays the numeric value of the optionset</li>
<li><strong><em>Optionset- </em></strong>displays the name of the optionset field. This field will be useful to the store the values for the multiple optionset fields in the same collection.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg19rBrUnp_SXqN0RgSdiSuRbipn708b6OJAXZ4tAPxWsTxumnX86U56NeB-N-ah42l4wna30Zg8vowRdDtX0887Sq0slmbElnj6_Ro1QmyrAATC1T3SoGEosl5Jb-XFQXI6WtEeCZsDA/s1600-h/2017-10-14_23-37-28%255B4%255D"><strong><em></em></strong></a><strong><em><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihCkpMS2FVkxjCyRchzGsO4dQ7509SsYj4cV3jNZzNUKxVEYc2EIP_8QO4WMqEkgTrIerO0_G7oSSM-ghIiUvTM2KexFtn7fFKQ1O-GoBwHn7ykZk7UHtf0Wj-dTgTLNIo_KS3JipfuF4/s1600-h/2017-10-14_23-37-28%255B5%255D"><img alt="2017-10-14_23-37-28" border="0" height="656" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiG8CJY_zgUn9shEA0uZGm1b9sYnRtmNNzayg5XUyde_h4uaQgflr2pGSZI5nj46oE5tms7jxhu0hEK4_Jb2O0MAjf2DHVb1er6Fkji-yk5dZoIbmsNM7hyphenhyphenJNZpP9HbpifeLUjnfOjP52w/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-14_23-37-28" width="588" /></a></em></strong></li>
</ul>
<ul></ul>
<h2>
Display the Optionset Text</h2>
We will be using the PowerApps Lookup function to display the text for the optionset.<br />
<ol>
<li>Open the <strong><em>DetailScreen1</em></strong> and select the optionset field, as shown on the screen in the screenshot below.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgse_EMqf30cHMYVtEcO8s_G-Dwdt8g0hqw8K5eF2C6Fc0q9pEtu_cul_CW88JLmFDNIJOX9DjI4og_aI5hdYaprKD4R_y7SNzaOFywsvZLxz3e5qYeHVgz19y6h2AHROydBWbniVj8RZs/s1600-h/2017-10-14_23-57-52%255B6%255D"><img alt="2017-10-14_23-57-52" border="0" height="409" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHYj8paxcXGRhjWnme9fC7kICOOXImxrvRK73_I2NM15vLsXA-6HMB6Nhoq0JQObPHiriv62P6joQWEgVJ6lZ0B3R9v4Q7w3h0n0dT8DynvoCwUfVcNcbTzNsQi4OrZ8ev7UShv2um4og/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-14_23-57-52" width="749" /></a></li>
<li>Click on the <strong><em>Unlock the change properties.</em></strong></li>
<li>Change the<strong><em> Data </em></strong>property to <span style="background-color: #cccccc;">LookUp(Myc,((OptionValue=preferredcontactmethodcode)&&(optionset="PreferedContact")),DisplayText).</span></li>
<li><span style="background-color: #cccccc;"><span style="background-color: white;">The </span><span style="background-color: white;"><strong><em><span style="background-color: white;">DetailScreen1</span> </em></strong>will display the text associated with the optionset numeric value.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSZZYUyP5017YKuo2gJQR_y5lJ2OfjN0Zns1upfdz0d7sIy8BfUIB_NOVP9E66NHONbbwrCEG2oC89SCajCuJGtOMCP09Bf_1L8qEjHx_EDrwfFZ4Wjr6Qr4i23mTCjDsUn680VbdIr0Q/s1600-h/2017-10-15_21-56-13%255B5%255D"><img alt="2017-10-15_21-56-13" border="0" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtH4x64LJRMJG03fS4zD8TYGliI0Lkg-tCFFPDLlli48me3kwXPyCSHfjwdDPibZx1PFjS0wu_-emux1OaoFySY3w2PGMm7fnWin9cfXDz_MzhJhD0VIXkNbaF3vwZr3uD70OoZ1FFnpE/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-15_21-56-13" width="754" /></a></span></span></li>
</ol>
<ol></ol>
<h2>
Editing the Optionsets in PowerApps</h2>
The above solution can show the text, but won’t let the user edit the values in the app. The solution to allow users to edit the optionsets values in PowerApps is little tricky.<br />
Here are the steps to achieve this.<br />
<ol>
<li>Add the <strong><em>Preferred Method of Contact </em></strong>optionset to EditScreen1.</li>
<li>Change the display for the field to <strong><em>Allowed Value</em></strong>s as shown in the screenshot below. It will change the field to a dropdown field.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuO2m2kvYXJCH5aXl75jKrFboiY5pgSRZdWud88OK9C6UfpEH7rf7v8_juuv5uSnK9h11aMjadYdqRpsDTm0zKTg2Rgoy7f9zg-4Gsso9FjQ2aU2UH4h-jIzwkKmUqwUxMfFyffQhvM7Y/s1600-h/2017-10-15_22-12-51%255B11%255D"><img alt="2017-10-15_22-12-51" border="0" height="519" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT653PHqgYg6ykgUSReBYUSDJwQBMS1GsTrCzdOMlextrgVI7Uh1UWMoZYqL1S9WXcZ6eGA_Cr89Oyb2yPhplE9YM5APLW8yE8DZ53el2ww1VUdFOqf76IV-cdcRN1gr-WZ_p_7PK9t9o/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-15_22-12-51" width="750" /></a></li>
<li>Click on the <strong><em>Unlock the change properties.</em></strong></li>
<li>Select the dropdown field and change the<strong><em> Items </em></strong>property to collection <strong><em>Myc.</em></strong> In the dropdown properties pane, select the column to display in the <strong><em>Value </em></strong>field. By default, the first column of the collection is selected.<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiInlrKYfYwCimVKdHLpBJFsZFXRh2o1Aq5-3UnaZe9dl2JkIOSNbLP751nMCzZz5Z1j_u3R8HNxriCDS9dzaAZ_aU1WW5QdEgmZ6VFXp_KV3Jwxm4tbdH4X47w1t7nBUwXR2x6ic1-YfU/s1600-h/2017-10-15_22-30-50%255B6%255D"><br /><br /><strong><em><img alt="2017-10-15_22-30-50" border="0" height="505" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghULhTBAjYhRQKp1krUBIhFU-RTbujF9o6PhTfvEfyBghPmmBfna9Ow4PO-IX2eKDUBExLgtTjm92oli2getF3fwbILd1JZ3dUNG5FYEfcW1qfzLpl-Ti4ZCkMKBe-ATQgLw5wn4vU0og/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-15_22-30-50" width="762" /></em></strong></a></li>
<li>Change the<strong><em> Default </em></strong>property to<span style="background-color: #cccccc;"> LookUp(Myc,((OptionValue=preferredcontactmethodcode)&&(optionset="PreferedContact")),DisplayText). </span></li>
<li><span style="background-color: #cccccc;"><span style="background-color: white;">Select the optionset card and change the <strong><em>Update</em></strong> property to DataCardValue4.Selected.OptionValue. This will tell the card to use the OptionValue field of the collection to update in CRM.</span><br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZf4rtOwZGhambJIJ7JGHj2ZTmI0UhJuL5byswv4L9fOF2ccQvei2dk4vQJmXvWNuaPhlbOTrLoDRTiqo3LcdSIwdYvEhVSQSmA-2dNZnypADgjM0UWf-JRccfcF9KHm4cSZKpaMjUIuE/s1600-h/2017-10-15_22-46-06%255B8%255D"><img alt="2017-10-15_22-46-06" border="0" height="767" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFWYZfjEU3vsa0OmdUNuXNN3WfGYe7Bhhzk70QaQnrROeJKY7qZROWRZMEXmss5FwJW6wiq4NEN2SUaCYYKLlq9v08LNGOboPr_LlPcq0tT3U5EdVPR7egIbL4EtfNCS90u5wQvbfKXCM/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-15_22-46-06" width="767" /></a></span></li>
<li><span style="background-color: white;">Save the application and test it.</span></li>
</ol>
<span style="background-color: white;">I hope this helps.</span>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com18tag:blogger.com,1999:blog-4535447606986422873.post-24074981253830206632017-10-11T19:50:00.000-07:002017-10-15T05:19:36.444-07:00CRM and PowerApps revisitedLast year in June, I had written a blog about <a href="https://mscrmshop.blogspot.com.au/2016/06/crm-and-powerapps.html" target="_blank">PowerApps</a>. I created a simple app that could update a few fields and the entity image of Contact records, but there were a few problems with the functionality. Microsoft Flow, CDS and PowerApps are getting a lot of attention these days, so I decided to revisit my original blog and create the same app with latest PowerApps functionality. Since the PowerApps studio has changed from the original version, I have a made a few changes to the app as well. I am using PowerApps app installed on my Windows 10 machine.<br />
<br />
Here are the steps:<br />
<h1>
Creating an app using Dynamics 365 as data source</h1>
<br />
<h2>
Create connection and generate a default app</h2>
<ol>
<li>In PowerApps, Select <strong>New >> </strong>“<strong>Start with your data</strong>” >> <strong>Dynamics 365 </strong>, as shown in the screenshot below.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoqzIFRnMQ1Ky4lvvzYE7iRctr0nGV39HcmNlt7OfWSSlTepzq5cBm2Rmys6BcapYL6qS9YbhUwCoRwhj8ndVNez_owCyBYdzOnMJdFHxOQLN8hiIZaFczx1WeYXR7tEHJ6ra2RKQrZ2s/s1600-h/2017-10-08_21-42-12%255B5%255D"><img alt="2017-10-08_21-42-12" border="0" height="393" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCjLhgrD1I5T6ObuWP4qzHzhmAJm1gvluzlTpBB9p5bYYojMJT3rqjfCa0pV9AHWUW4MBlahjZMWWee3lVpSxBTtGm-jSZUeFEyv5XNN0cLarpDCtMKrJ-KQ_YmoPfoca0sTrkhCgq2Qw/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-08_21-42-12" width="723" /></a><br /><strong></strong></li>
<li>Create a new connection to your CRM Online organisation. In my case, I already have connections, as shown in the screenshot. Click on the dataset for your organisation <strong>(in my case it is <strong>HPE</strong>).<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ1Xyj-8QNE0GdnSr-JkB-HQYg6Nygkjx_Em8qbRHN-5YZFDdj9gSQFGryBGhErAQCAy1Svjzdwznk7rrK9Ajcqt7gTsUcTC79WdJMlxfdJ5mxVWuAiVChfMwNaEdPMov3QN1CDZ5c7nE/s1600-h/2017-10-08_21-44-03%255B9%255D"><img alt="2017-10-08_21-44-03" border="0" height="388" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOHLHGZWGZzVjfhOzrk-4PSoZWiKMb6U8DS32sWg-gJpon-NRjehZoSV3Ji8a-LqYPfF8Y6rr7PVwqyyk-JJr-wRMxlSfAhGisHmFTS2rJKptFhUCrlwGYfhu7sCFRDvdy1D5ZpE16pT0/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-08_21-44-03" width="725" /></a></strong></li>
<li>Select <strong>Contacts </strong>from the dropdown<strong> </strong>and click <strong>Connect, </strong>as shown in the screenshot<strong>.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRH6Kxb_AMfolZBdLFyczg_X_jXxgUjNgp-y33Cb6sDSlvFCgT-OUryX8txa-h8bTFK2to5HNVDYHlo3iVAEK-F59m-futWaHef_Z2_8xd5eiF-tbNqrt3O9ts1woHqlrTuEAwszK6Mo8/s1600-h/2017-10-08_21-44-44%255B5%255D"><img alt="2017-10-08_21-44-44" border="0" height="378" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvfxp07QJ7aJnwCuA98ytBGcEhEKnq7ptphme3_ilQmFS5VdRtIRADxJrzxrTqTpwQ3TbRga5Mgb9WPIGWoXj97QKPlotv3xBmNMNvu51llgVMDe6UvklMdzX1jLfNUkjHPjNgMKAVvgs/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-08_21-44-44" width="725" /></a></strong></li>
<li>PowerApps will create an app. The app will have 3 Screens:
<ul>
<li><strong>BrowseScreen1 </strong>(Home Page with a list of the contacts and a search box)
</li>
<li><strong>DetailScreen1</strong> (Displays the details of the selected item on BrowseScreen1)
</li>
<li><strong>EditScreen1 </strong>(Opens the selected record/new record in edit mode) </li>
</ul>
</li>
</ol>
<h2>
Update search and sort conditions on the browse screen</h2>
<ol>
<li>On <strong><em>BrowseScreen1</em></strong>, select the browse gallery. the editor will display the <strong><em>Items</em></strong> properties.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2I-z9dSXb2dwpsqrBUBpb9fjlvmrVpf6QLaBTfF4C-vB0kojRggQuY8eSnCkvW_Q3CyIyh5pelJjzEyumb_wpFQ85yScwgsiZ4Sal1L6iu_jjNiXrkXTf0d5cuudPfLOuhpvZTh4SETQ/s1600-h/2017-10-10_23-20-4511"><img alt="2017-10-10_23-20-45" border="0" height="545" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXYhdUFp492Vzzp2YrSsphgK0cok4V-0FY6pZ9xhi-QgMnJS5bdPlP2ZWRG_whO_gVKWHK0M2QDYXq9rcGjw2vm-oiD-muFtUWH2DlcDbsosWx-20a-MagieJ3moVtID8_mtQch7yx0nw/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-10_23-20-45" width="734" /></a></li>
<li>Change the value of the “Items” property to <span style="background-color: #809ec2;">SortByColumns(Search(Contacts, TextSearchBox1.Text, <span style="background-color: yellow;">"fullname</span>"), "<span style="background-color: yellow;">lastname</span>", If(SortDescending1, Descending, Ascending)). It will change the search criteria to “fullname” and sort the records by “lastname”. </span></li>
</ol>
<h2>
Select fields to display in the gallery</h2>
<ol>
<li>Select the fields in the first item of the gallery and choose the CRM field you would like to display in that control, as shown in the screenshot below.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaib2YVCcJFJUnrqsxgy8RrMA6MjcTXtmd6zFJX6XIc-41uXUYmPYOOCKUkC33taj_llGG1yQ-NDLchmirv1XU-EOXF_RlYSgcI58IvLDIzYhYu6HSd1_y_mRSk7NViSxncpygjuQKVNA/s1600-h/2017-10-10_23-35-12%255B6%255D"><img alt="2017-10-10_23-35-12" border="0" height="540" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn0cIBjpRi0VOyFqSqwHVVzbG7dtTJMTgbpOHHCOyBhBtDArYhRxXRFyNfZuezhWqcJyY34fiBOdee2myZlKuq9nM2TVsI287WaDOUT1VSLVTczJDw-NVHPW_CdjOX9R9GVdv6o0KBmcs/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-10_23-35-12" width="727" /></a></li>
<li>Choose the other fields to display in the gallery. The image control on the gallery is already set to display the <strong><em>entityimage</em></strong> of the contact.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1bIQ4orJwCdiGEpLciRVpR_FXKJnk3P9_Zbv1S-TMGCfo0VA1wrORcn4Jb7HODzzPtUr7S3O3jMKcg-n_788vOiBsXtvO4p4fAl1It016IrMSdwx3zwszhzRnplnxciSX8Mz3xxP-3B8/s1600-h/2017-10-10_23-43-13%255B4%255D"><img alt="2017-10-10_23-43-13" border="0" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyGiBmc-nLHoEO10wUbr4Scs9jw3Ogg4Wx3Yz9o0cc5kPcHKuA0bOSqTMVM8BnehTPqcvVbZZKGRpAGkN1DjJYPvwDspD7E3TqAb6CGZ3Biw5QE9JpfND8Y6SmbsXTXKxbp473aJEVgU8/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-10_23-43-13" width="730" /></a></li>
</ol>
<h2>
Select the fields on Detail and Edit screen</h2>
<ol>
<li>Select <strong><em>DetailScreen1</em></strong> and then select <strong><em>Data sources</em></strong> from the View Menu. It will display the <strong><em>Data</em></strong> window as shown in the screenshot below.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyBKGnc8E3P-9UdJdMxcH15LEFNrNHErkT3TbKt3tIFZbV6UAwgO09miDnBqPlgvOvswj4u_rl6XV7qyzoiFsbxXxBdNEYVpo5zf75ark3b_bi44BSI0ofvZhAvMk9jRtJHJ2ltnvMorg/s1600-h/2017-10-11_00-00-48%255B4%255D"><img alt="2017-10-11_00-00-48" border="0" height="344" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUqNDGHOrsVkjmoY1eR9be0fFkZSOBjwXSBJGWzeUDNaAY6_GWJUBFTovhyphenhyphenhLxQqP8nBpfPpMBZ1rpyA5kPnEGksV8IMQYkBT6Lxnqw_yBvTp4i3dYRpyv9YnwlX3-O1Lxj88Aa8uli0M/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_00-00-48" width="734" /></a></li>
<li>Select <strong><em>DetailForm1</em></strong>. It will display all the available fields in the <strong><em>Data</em></strong> pane as shown in the screenshot. Click on the purple eye in the options pane to add or remove the fields on the form.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEmKIIOZSN8eiuNpM2a56f0_6U4NuK928as0x4tb1-DJmmvZXSeGcnchGwKa3al8GsQywPsqQNiuQVBaReiDALBJ8kLv2m3jqCfQy0pHm8nIZT27q1axyMjjRwhNnLmNTcCDxULaRBQl4/s1600-h/2017-10-11_00-06-16%255B5%255D"><img alt="2017-10-11_00-06-16" border="0" height="521" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3UTj4wJPQ27MJ4RNOnYqDioM8kapkHrl136Sknsn1dojkTZICtk_up5d3wNLgAuwEAna3yijiJyKU-DxH3IRs8MjgCv-xmY-70ebChUjr7k3CMOl0NU89XlnUxDWlnx_38kSa6gEj6tM/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_00-06-16" width="734" /></a></li>
</ol>
<h2>
Change the theme of the app</h2>
<ol>
<li>You can change the color schema for the app by selecting predefined themes under <strong><em>Home>>Themes</em></strong>.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM9Rh8bUbtIR2RGCflQQK2U0d6A_CdB8p25993emoli3Q-x3pNRv8gXLHS310l_LCR9NEetDpKC0eEYXxakcHB_MoMsjndmVI9hWVgv0s5tDAldMuLzzu3EsKjYqOjv6YGQBmcYCgvSVw/s1600-h/2017-10-11_10-17-214"><img alt="2017-10-11_10-17-21" border="0" height="521" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigQU0J975q2eEBmqz4PpeJ_TDO-PJz4q_1NID-ejPiqSr-cX2tb8qtOKZtN_qOorAxEM2zuiZrOAL4DqXT2YWEKcj7gJs9GqSatjZh2mYtEoz2IF1wplDUG24QNXGNIGbX1cG71HYEoGM/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_10-17-21" width="744" /></a></li>
</ol>
<h2>
Save and Share the app</h2>
<ol>
<li>
Save the app by providing the name of the app. You have an option to save the app on the cloud or on the local machine.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOLoYXIg4DmlwsYY8f_mfXR3bcnOMxoypTmg6CLIek6P0NhojA1o4b0xQQiyC_NJ4EFfwRb3naPfSP0Z2lQI85FUq7FulznwK6J6qST9s5HSzQcyePpRbr6acT4qh0dVnJNAOQSZ7MQSc/s1600-h/2017-10-11_00-17-27%255B5%255D"><img alt="2017-10-11_00-17-27" border="0" height="536" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjTHzbC-bNH0UjypXEdBigM-ujiJDEVKkmBUV-9jHchX6mLP5Tngqahg7ONG1nqhiz_eqbZ558qo4UgdjHINTl35ot5oVPlddoBj1dV9QXeLo1CffLTTq8BDDGpot0OJfeKSYI7ev8jYo/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_00-17-27" width="739" /></a></li>
<li>Share your app with your colleagues by selecting <strong><em>Share this app</em></strong>.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbNt00ijxFvC_CquCkki2QETxWgoQujVuhFwC63_-3FQqzGklv8pzKFRgy25azxeCNSOXr48-j6eMHIiSrdhfbjvQENFQ_U-iKQ3IHUEq2nwVqsV_RkPLHCw0WpsvmCHI8FvnGcMqeW_Q/s1600-h/2017-10-11_10-22-404"><img alt="2017-10-11_10-22-40" border="0" height="353" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEing8Pjo1O7fb4xc6NVEMNEdFoIjXIcAM3f7v38SZLpdcrkhXJJuhKFkyx_SQ-WnidWfcWctp-Dqvxg39dUgCkcWYq7nQaqj9tRwoDKjxmR0GSXyJ79aG7NAIfZgS6Ug0jfnEZ4mzup_qM/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_10-22-40" width="645" /></a></li>
</ol>
<br />
<h1>
Testing the App</h1>
I am testing this app on iPhone 7S. To run PowerApps on your mobile device, install PowerApps from the app store. <br />
<ol>
<li>Logon to the PowerApps and choose your app.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgICmnJpyU1DJzCyiDN24lQEAx81e5_QaKoMPMspwhrADpjrzF108zkJnoW0yytryHzj8lCLVeD_SO4WCzotPfsm2NkAlgNNloV8JqH9RawS-iRiaHQRZHznf0-1CJresXCf6TkW3Oibkk/s1600-h/2017-10-11_11-27-564"><img alt="2017-10-11_11-27-56" border="0" height="436" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihnhYo5h8c5mB3rgRAXuFQoTh7mk0nGMgtLeUYh3AkZGOcyyj5Mpe1JJI_cNQ2VKCfjUJXHYO6WZnnE3P5e3Kh81t1RYJku9hN5btqVxdjW7jibau7eWIkBPyrRbLsYjCCRpkifHREVmU/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_11-27-56" width="315" /></a></li>
<li>The app will display the browse screen. <br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtuLnWqNB7FH93GQRVYN_aeupYxNNAOjO2qep6W4gjLZKC5MdPJHEGMpOwi0PzRKrTdVopbOvoRifS-Ub0TBMI15PsRW3Kl8brtB4vjSbzzn-1NVMtiFF2pcXrGJbdFCgewNlBvgObydw/s1600-h/2017-10-11_11-30-115"><img alt="2017-10-11_11-30-11" border="0" height="507" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0TqAX5WX-ErYcgJGFH16Ih4dhcLGDn7nUcQ2QPVxzS3eiIaFE9lrrdPdQhhPeo3PFQXaN1VKPaEchg50PSCRSk39ZXUECq61wrZnQwJKkl-kzsDvEScKd-33QwAphWR5qyv1ter-nXuk/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_11-30-11" width="311" /></a></li>
<li>Select the record to view the detail screen. All the fields are disabled on this screen.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP8KFNdwOA_BkrgCvjyml8DlmNEksp0pKoLWreapV_Sy8F0HYUrKeQpzV66bG3AZfSEWlWUekA_jy8r19H52OWbR_XR8UslIX9MAxcvvC0GpsosPP3lLB7Js2ky7OkQSib94KeAH4uG_0/s1600-h/2017-10-11_11-32-335"><img alt="2017-10-11_11-32-33" border="0" height="482" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiiFX1C-G4Ih7WWSZFnH4TzYggmSgHS3bxOosOBZa_Q7PZJ3iGhf5z1crVGsWxyna6U-5XyVEuwJcHsoby4-4b8EavqI-0UUOMLaMgi0yTELPNMFwUTQaWqu-nef9L08klf0KVZ6YExn4/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_11-32-33" width="310" /></a></li>
<li>Click on the edit icon to edit the record.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWnmTQnYZdRkAc1Q7NVDNR8oQbeDfNK5lKbqDTkgp_DkqIWpru90L4cawVOG5DVhtos6W8fhgRcmZQ5R5lTph0ud6S6t2E4rKAl2-dU2_92BhQaEve9VIJZZu6E2DQlhtFncqw0KU6DQ4/s1600-h/2017-10-11_11-33-115"><img alt="2017-10-11_11-33-11" border="0" height="510" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5yPwu2CRQXj_wSDGKQrkW1jYPvfi66UIymqX70-MiZRW81E3nsMlXc6CaSY7tApwZp9TUp1Uh4XUMaAr4izG0w1qPB3XngDmtjByWgzRMxkQtjRlR13v_cdvJhSKIZxhOEwV-VzGVy1E/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_11-33-11" width="315" /></a></li>
<li>Click on <strong><em>Change Picture </em></strong>to upload a picture. On iPhone, you will get the following options.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij39yjClqmoJ1_zWNKGKQkQNByfYhPomPedTY41F2kdzSo-cw9LV38Cl9h2zy6CrZ4WPBWIxHcbdXUCieO3_pyj1i9wYdoIdiJuHXyRHeiGo6QbwA_Kl0XgxRL4SwZ9bKpqbQHMtk69L4/s1600-h/2017-10-11_11-34-154"><img alt="2017-10-11_11-34-15" border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifkcot7lJcxxZmWMA8rElE16I65yM3-sbDXiwNxwRt6UdltjQweJ31uQQnAqtJYLBaRqX-a5Xsw_Ljj3q8WkV3dpPSlZOwHvdqqBrRc5CBCnEONS_1fF5GFZl65JpErI-DmepTRJ7ZTrM/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_11-34-15" width="315" /></a></li>
<li>Take a new picture/select an existing picture and press save.<br /><br /> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrkRMVjKeFsSG65e_j9rsY7w7eV9LW6ilwwRQjhBnn3Hz_5uQ2EjBhtrIFtX12Xv-mcjSlg-Dslypouu5w1RNM2KZPEJ459M67YuLmaGxTrABVcETG_8erOmKPPwwjXh-ACpFfZ1pJ7K8/s1600-h/2017-10-11_11-35-305"><img alt="2017-10-11_11-35-30" border="0" height="580" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLN6h0Kw3rEbW69QX4fZwJFxjHrcIKE4nWaEciqSR1PU7Gl0fT09qKA74_sfEsYM2ALPVf4QIMOtaGzgBvTapFXeuCvbBI86PrFKCxq-ciHj6tqYtVcnAcfSxQ3PBpUqwfluIjDAZzkvs/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_11-35-30" width="323" /></a></li>
<li>Have a look at the browse screen. It should display a picture on the edited record.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgImaF-UzasuzTXXqAATMmPGRNVyWeFDakPMTHoCMDhoFSnWWo6utr-a6j07b4b7vJuLxMKP7GemWfYD-NItCDtrHW8cRhlUdSx4xiM3EPhoKtNXjZCfTlnNMFpmALKkuokxry55y8IG5Q/s1600-h/2017-10-11_11-36-384"><img alt="2017-10-11_11-36-38" border="0" height="560" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZyA5E9nKGqxKZVvUh9NsAtmeTwFnTrVKswxdEf92eYiCKR8oLK5zyyaNHs1-DB5iy05lQmDWn69suepu7I_WRkdjUdSDJ1OQqm4B4UotkrkLBu84cyFADtYB-FRPkUvj6yTT5CibZz6g/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-11_11-36-38" width="383" /></a></li>
</ol>
<h1>
Conclusion</h1>
In general, I think PowerApps is great to build something quick instead of spending months to go live, but performance must be improved to make it usable in the real world.<br />
<h2>
Improvements</h2>
There are a few improvements in the latest version of PowerApps.<br />
<ol>
<li>Image control can display CRM entity images. This was not working a year ago.</li>
<li>Image control can access iPhone camera. In my last attempt, I had to add the camera control to take the picture.</li>
<li>The performance is better than a year ago.</li>
</ol>
<h2>
Issues</h2>
<ol>
<li><h4>
<span style="font-weight: normal;"> Photos take a long time to load. On the browser screen, the data fields load very quickly but photos appear after a few minutes. </span></h4>
</li>
<li><h4>
<span style="font-weight: normal;">Users can’t control the orientation of the photos selected in the image control. Some photos get loaded with the wrong orientation. I have read on the PowerApps community forum that the PowerApps team is working on it.</span></h4>
</li>
<li><h4>
<span style="font-weight: normal;">CRM connector does not have an option to retrieve specific columns instead of all the columns.</span></h4>
</li>
</ol>
Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com1tag:blogger.com,1999:blog-4535447606986422873.post-49375655637726161232017-10-08T22:33:00.000-07:002017-10-09T03:37:21.607-07:00CRM Web API and Certificates IssuesI have not written a blog in last 8 months as I have been travelling nonstop for work. In this blog, I am going to share some behavior I came across a few weeks ago.<br />
<br />
So here is the story. We are using CRM Web API for integration between the on-premise system and CRM online. We are calling the CRM Web API from JavaScript running on the on-premise server using OAuth authentication. We used a process very similar to what is described in the following article: <a href="https://msdn.microsoft.com/en-us/library/mt595797.aspx" title="https://msdn.microsoft.com/en-us/library/mt595797.aspx">https://msdn.microsoft.com/en-us/library/mt595797.aspx</a>.<br />
<br />
Generally, we don’t need to manually install SSL certificates of public sites on our personal machines, as most browsers and operating systems have already installed the root CA certificate of well known certificate authorities like Symantec, Digicert, Microsoft, etc.<br />
<br />
For security reasons, in an enterprise environment most of the root CA certificates/trusted public authorities are removed from the integration servers.<br />
<br />
To make the successful calls to CRM Web APIs, you have to install the following certificates onto your integration severs.<br />
<ol>
<li>Certificate to communicate with https://login.microsoft.com</li>
<li>Dynamics CRM 365 Certificate</li>
</ol>
Now the real story. We installed the certificates, and everything was working as expected for a couple of months, when suddenly it stopped working. After some investigation, we found out that we are not getting the authentication token from <a href="https://login.microsoft.com/">https://login.microsoft.com</a>. A bit more investigation, and we found out that the issue is related to the certificate. The server certificate presented by <a href="https://login.microsoft.com/">https://login.microsoft.com</a> was different than the certificate we installed on our integration server. The old certificate was not expired, but still replaced by a new one. We replaced the certificates and everything is back to normal. I have attached the screen shots of both the certificates.<br />
<br />
<h2>
Old Certificate</h2>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6bj2MEtkBrjkwyKs87rBQJs_beYQmiMB1w52S3VGwKFpfCDScWAJ8n1uDGxdyQ0IlYml9K3HZZVQ3rXBuUqHgS2HGkj-AyMZXABGVL0ADspBA6NeprmfG_WalwXLufX7gH4atO7XxfS0/s1600-h/2017-10-09_11-53-51%255B10%255D"><img alt="2017-10-09_11-53-51" border="0" height="497" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKBbaYHf8OdPeMqD2Iq1KtrQotibrIiAost29STkEkx9Q1cUOXin_npKKZHmlBFQwkoGTrzJOyIqJtem4gKAyTjd911mo77__K2xSnv1wLdWWXc08c2I5yM9ZIlxDbiKA6dOtS5oNNwGU/?imgmax=800" style="background-image: none; border: 0px currentcolor; display: inline;" title="2017-10-09_11-53-51" width="410" /></a><br />
<h2>
New Certificate</h2>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_42bx9kr9nGMp1xnOz_KNCRnIp5BA1R1LklWMxoqqLHDxadT2T9HHLdyHJM2RlbZPGx3Hjd5zQrHIOXTYXHcXvXT6091YKjsNUE93zaro4SXA4Bnmwuhuu0G9ys4r-cXBEAybjy8SxdI/s1600-h/2017-10-09_11-55-44%255B5%255D"><img alt="2017-10-09_11-55-44" border="0" height="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2mXgq9Lk-BPKjtqw27Kl9J-I0MPxoPilFThNGM_w8sdmo7AQW4WrB7qFf863HI_TPlJ_5lrLIHO9LlJti7BPgzygR39CdYzpyKdrmmySufKyWDCvflQHvOoszIWgzaZh0aTIkrhRGXqA/?imgmax=800" style="background-image: none; display: inline;" title="2017-10-09_11-55-44" width="410" /></a><br />
<br />
If you look at the certificates, the original certificate was issued by Symantec and was expiring on March 18th 2018, while the new certificate is issued by Microsoft itself. I hope this won’t happen again. So if your calls to CRM Web APIs stop working, check your certificates.Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com1tag:blogger.com,1999:blog-4535447606986422873.post-2024672897316658202017-01-19T18:06:00.001-08:002017-02-25T04:15:12.850-08:00Dynamics 365 and Logic Apps–Part 2<br />
In the <a href="http://mscrmshop.blogspot.com.au/2017/01/using-logic-apps-to-create-records-in.html" target="_blank">first part</a> of the blog, I had created a Logic App that serves as a callable endpoint to create a record in CRM. In this blog, we will look at adding some exception handling to the same app. Please read the first part <a href="https://www.blogger.com/Using%20Logic%20Apps%20to%20create%20records%20in%20Dynamics%20365%20-%20Part%201" target="_blank">Using Logic Apps to create records in Dynamics 365 - Part 1</a> to understand this part. <br />
<h1>
Current Solution</h1>
The process for the current solution in depicted in the following diagram<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY2HcpGZzO5hgud6ASIIoDLSQM2oXMeeIbb_sNrOoehi9SdCP9_1RB3W6LnfmsUyWGEuKzlkhHA21EnMn-8UfrjCulx3gN7InJTHrCk-MmqHkugzQbUC7Pmm5RhcBTQ5iUe2mPjDhQOUM/s1600-h/2017-01-13_16-57-421.png"><img alt="2017-01-13_16-57-42" border="0" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhfBCuXRg5J6nNY24vOP_u608pXIdeuOcOTSlHQKSpxMkhyueOxbvf0VtB3i5rlNhJZ39buSTACv551wdk2ssSWBRf3SwApTaVl6qysQqBxE7yNvAjgg4mvNAf6U0hBE9wsV9TuD4usa8/?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2017-01-13_16-57-42" width="634" /></a><br />
<br />
If the <strong><span style="font-size: x-small;">Create a new record</span> </strong>is successful the <span style="font-size: x-small;">Response action </span><span style="font-size: xx-small;">will return the customer else the Logic app will through an error message.</span><br />
<h1>
What will happen when CRM throws an error</h1>
For this blog, I have created a synchronous workflow that will throw an error message if the <strong>Last Name</strong> is not provided in the request.<br />
<h2>
Error 1 (ResponseTimeOut)</h2>
I am sending the following request without the last name.<br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="-ms-word-wrap: normal; color: black;"> {
"customer": {
"firstName": "MSCRMShop",
"lastName":,
"streetAddress": "21 2nd Street",
"city": "New York"
}
}
</code></pre>
The Logic App returned the following error message.<br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="-ms-word-wrap: normal; color: black;"> {
"error": {
"code": "ResponseTimeout",
"message": "The server did not received a timely response from the upstream server. Request tracking id '08587170410911854011608943569'."
}
}
</code></pre>
<h3>
Reason</h3>
The reason behind the timeout error is that there is <strong>timeout limit of 90</strong> seconds for a single http request in Logic Apps. The other question is that why CRM would take so long to return the error message. The reason is that CRM is not taking that long to throw the error message. It is the default <strong>retry policy</strong> of the Logic Apps that will try 5 times before throwing the error message.<br />
<br />
For verification, open the Logic App in Azure portal and look at the failed run. The action will display the message shown in the following screen shot.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-PgSehyMROSiM8iPmyxQb62zqLAWGUPevAoc_DHBAdX7OkDrygBw3dmLJFosM1eFmFlDp5Yxi4oxEMnTSiXZzXnMaHLxRacdwp2b5uxZ-dhvGrVNFnODY1XHppivi7uzADWqqc2U_TeE/s1600-h/2017-01-16_23-00-465.png"><img alt="2017-01-16_23-00-46" border="0" height="610" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg28Z-Dm0Z_kpMqtHPT-RkSfJFPzpopZmTb2rAxn1CKTk9xgOKw-NAK-6WPXiw-tzAOTRHgtJUACuLJwXqluGZkeXyBQgaztCvFipyWJ35kFfLeDsmojhuksxCzFh3XyqPJ3d3EqXXM5mY/?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2017-01-16_23-00-46" width="810" /></a><br />
<br />
The App run is showing that the execution duration is 1.92 minutes. The error captured in <span style="font-size: x-small;"><strong><span style="font-size: x-small;">Create a new record</span> </strong>is the actual error thrown by CRM</span><br />
<span style="font-size: x-small;">Now log on to CRM and check the execution history of the workflow. It will display that it has been executed 5 times.</span><br />
<span style="font-size: xx-small;"><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0s4K37290iYGKl7XZDrLKqupHKQ7rmR_QJzw556tU3d9Ch62UMicRT2OHJCLpkuAghIEhADnf5PaKTQaLy61ubXWHJbr4UFMs7LaTDaQeA1qe63x64CdxzS6gOMttVSJ2AK0bQJBwqyA/s1600-h/2017-01-16_23-21-036.png"><img alt="2017-01-16_23-21-03" border="0" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV9liUeED7t9eK1nOEGh05r21Nut-HZICUiOvTrUVHwqZayynZuomWeO-JWkbWIgv-JfDFAb9iqhNrJOjIFOfQhEuOw1-wrp102iLPdcTVXzDK1DTHskLuWxxqIraY16K3VswN4nY18X4/?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2017-01-16_23-21-03" width="817" /></a></span><br />
<h3>
Solution</h3>
The solution in this scenario is to set <strong><span style="font-size: x-small;">Retry Policy</span></strong> to <span style="font-size: x-small;">N<strong>one</strong></span> for the action <strong><span style="font-size: x-small;">Create a new record</span></strong>. Switch to code view of the app and add the retry policy section as shown in the following screen shot.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWu5iXOraXCidKp62h9OjxcJu0dRlItZI4FSuy31xxLv_kPdCxz4BP_p2-VEoySMz9HbL9tyMzZrXUk6wA__uyVgqCVXUIAIAuWo0SX69xQ2uLKfaKWz8KZ_2FY3y_PGztp0bDfeGZZfQ/s1600-h/2017-01-17_14-44-265.png"><img alt="2017-01-17_14-44-26" border="0" height="346" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCbwXhQByLD0oWdnYr4tHQ_Eb28k6XhT-seutlsupWK3rnfDoSQDa7dsN9pJy_cge0nr8AjxeuBaMU_WifZN6M5b91tGm1wrxmq-IWOIImjoQlLvoplGd8V2E3SwyV-LCmwYsGG4Gmv8s/?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2017-01-17_14-44-26" width="817" /></a><br />
<br />
<h2>
Error 2 (NoResponse)</h2>
After fixing the Error 1, call the Logic App again by passing same body as in Error 1. This time the app will return the following error.<br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="-ms-word-wrap: normal; color: black;"> {
"error": {
"code": "NoResponse",
"message": "The server did not received a response from an upstream server. Request tracking id '08587169819578381630235279815'."
}
}
</code></pre>
<h3>
Reason</h3>
The reason is that there is no response defined in our current solution to handle the error. The only response defined in the Logic App is to return the customer Id on successful creation of the record in CRM. Every action in Logic Apps have a section named “runAfter” which defined when this action will be executed.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT-4j1IjtZWJGD7i_qU_2HnBmLPW8UymoH7ajPbgMbz4ah8PbEFAYb6Uk1621oFK7gwH9eVkFD6S6XK8deqcuSjPIW508u2WLdawO-kbO7bz7Dx-NHlAdHdXBzqhMAn9ycQ6xZwOvqSAU/s1600-h/2017-01-17_15-03-144.png"><img alt="2017-01-17_15-03-14" border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4mIX0gz5htb6GVEo5n2nU47r9g15fZ2qgGPCOuWFn1FVypTI_fwp85W-PLU-uggJEDPpnLgEZPfk96La6NDsEikN_tzNSjf9KyvWqMDWaI-25_r_JN6RZqG4xHUBYBSjoqn7W3EAve-k/?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2017-01-17_15-03-14" width="499" /></a><br />
<h3>
Solution </h3>
The solution in this scenario is to add another <span style="font-size: x-small;"><strong>Response action </strong></span><span style="font-size: xx-small;">that will be executed after the failed execution of <strong><span style="font-size: x-small;">Create a new record</span></strong> action.</span><br />
<ol>
<li><span style="font-size: xx-small;">Add a new <span style="font-size: x-small;"><strong>Response </strong></span>action to the app and set the properties as shown in the screen shot below.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-_WO1SpDOEOZinye5M7BDrMeIgxP3LzgNd6_i6oi3Ywjxb_RTCh8dNAV4dMeYqLUSIYT59AUCVBEV4Upf_Nenl35-y493HVDmvICxgzFmukHY1QQc3gghuq1-Ak2iZmDbys_DFd7GgRI/s1600-h/2017-01-17_22-24-445.png"><img alt="2017-01-17_22-24-44" border="0" height="632" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn9Urm9gs-uqZkUQ6ZUh1ojhHN9ZWnMa2Iy92-hnQPX41lCdozYSraVRoFmBiRXoOsq2RwiUVpP-GTwfdtWZA4SuaGewxlM1jaOUKhHbcOuUtbSi2TWkTMNbPXhaYJ7H3u-n2bvMmpqLE/?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2017-01-17_22-24-44" width="474" /></a><br /><br /><strong>Status Code</strong> is set to output of <strong><span style="font-size: x-small;">Create a new Record</span>, Headers</strong> section contains the content-type and B<strong>ody</strong> is set to body of <span style="font-size: x-small;"><span style="font-size: xx-small;">Output of</span> <strong>Create a new Record</strong></span><strong>.</strong></span>
</li>
<li><span style="font-size: xx-small;">At this stage <span style="font-size: x-small;"><strong>Response 2 </strong><span style="font-size: xx-small;">will be fired on successful execution of </span></span><span style="font-size: x-small;"><strong>Response </strong><span style="font-size: xx-small;">action.</span></span></span>
</li>
<li><span style="font-size: xx-small;"><span style="font-size: x-small;"><span style="font-size: xx-small;">Switch to the code view of the app. Scroll down to <strong><span style="font-size: x-small;">Response 2</span></strong> definition.</span></span></span>
</li>
<li><span style="font-size: xx-small;"><span style="font-size: x-small;"><span style="font-size: xx-small;">Change the <strong><span style="font-size: x-small;">runAfter </span></strong>section as shown below.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipHBCLxblVP69gkKV81fCvWYH69XCtYalpZP3N4SyV5IpeYg5t2-A2PS1lASZq3GNkhCDszq8FTCHI1ArVgAPyEKkvF-2ZHwdHHmX5mNqoIEAgrDElO_mMDM5qTFd49SvnZ79ZDZ27U0c/s1600-h/2017-01-17_16-46-496.png"><img alt="2017-01-17_16-46-49" border="0" height="299" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0lItwQffhGkUBNw8l40Qn1lF8ic75ET5Tk-cbpC09kRZc1oKiaBUlh0M3AOMYHHpfqW0yGZHqXBcJCpjs32zfnXebRaEnlLz51aVH2ms_576pCpR7juYtKPGisI8rX0UcB-7efaUZ8DQ/?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2017-01-17_16-46-49" width="581" /></a></span></span></span>
</li>
<li><span style="font-size: xx-small;"><span style="font-size: x-small;"><span style="font-size: xx-small;">Save the app.</span></span></span>
</li>
<li><span style="font-size: xx-small;"><span style="font-size: x-small;"><span style="font-size: xx-small;">Switch back to designer mode and if there is no error in the app. It will look like the following screen.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigTI64Y5BZCsWs1UDo7EeK3KPsZc1akPTJ3NqfokBMGld0gIiIPpJ0EhGDtHuaa9n6vB95_qV3S7_AAix3m8LTDpWzdKqS36BJp9hzvt4_yYRm5i_X5cYj8KRzcdXTUmeoEJSLtFNog6A/s1600-h/2017-01-17_22-29-394.png"><img alt="2017-01-17_22-29-39" border="0" height="193" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhra4XKZeEiyPiGnqQHMHHv2uGYphgRkpkPiQ7opa8c6z23iHqpSrwAJVlwsFiYuyIN8xZ6Z1z_Mufwsb1B0wn5dPyOXyGyIl9yuiGgHprJhi0kVPrSPtyVxWnJzySESsszjZxMOQT1vvo/?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2017-01-17_22-29-39" width="740" /></a></span></span></span>
</li>
<li><span style="font-size: xx-small;"><span style="font-size: x-small;"><span style="font-size: xx-small;">Test the Logic App again without passing the last name in the request body. This time Logic app will return the following message.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBrVcekrQvzPVd7N9mhqL61ZlJfz7Jtu_7SPWcdjlbkwHryuwmUc4U_cSjrJEBZOeaRk9_S1qHS5w74EEfv82lNjbmT4_CyUywbmOyCLzAytHRXtKf3rKFNoRbtHTftkuRAYvbq96uw5s/s1600-h/2017-01-17_22-34-104.png"><img alt="2017-01-17_22-34-10" border="0" height="468" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB1qHOZlGkMlIRZCfdgqJ9b_cIz9Zt3lUU2aVX07_yi1ZhD18c4IsAknb5VqNtJuDSir9sKbMsE7ECUErkMN3EOTuGz2zKzHY2RKUxrN9dD2Oh4VmB-sGjAgXRHispQ7ugGbXLfnae8JI/?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2017-01-17_22-34-10" width="768" /></a></span></span></span> </li>
</ol>
<span style="font-size: xx-small;"><span style="font-size: x-small;"><span style="font-size: xx-small;"></span></span></span><br />
<h2>
<span style="font-size: xx-small;"><span style="font-size: x-small;"><span style="font-size: xx-small;"><span style="color: red; font-size: x-small;">This solution will only capture the errors thrown by CRM (Create_a_new_record action). If the error occurs before the call that won’t be captured by the solution.</span></span></span></span></h2>
<span style="font-size: xx-small;"><span style="font-size: x-small;"><span style="font-size: xx-small;"></span></span></span>
<br />
<h2>
More Resources</h2>
<span style="font-size: xx-small;"><span style="font-size: x-small;"><span style="font-size: xx-small;">Check the following resources for advanced error handling information.</span></span><a href="https://docs.microsoft.com/en-us/azure/app-service-logic/app-service-logic-exception-handling" title="https://docs.microsoft.com/en-us/azure/app-service-logic/app-service-logic-exception-handling"><span style="font-size: x-small;">https://docs.microsoft.com/en-us/azure/app-service-logic/app-service-logic-exception-handling</span></a></span><br />
<a href="https://docs.microsoft.com/en-us/azure/app-service-logic/app-service-logic-scenario-error-and-exception-handling" title="https://docs.microsoft.com/en-us/azure/app-service-logic/app-service-logic-scenario-error-and-exception-handling"><span style="font-size: x-small;">https://docs.microsoft.com/en-us/azure/app-service-logic/app-service-logic-scenario-error-and-exception-handling</span></a><br />
<span style="font-size: x-small;"><span style="font-size: xx-small;"><br /></span></span>
<br />
<br />
<span style="font-size: xx-small;"><br /></span>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com0tag:blogger.com,1999:blog-4535447606986422873.post-43847262818361183092017-01-09T23:48:00.002-08:002017-01-10T14:44:18.906-08:00Using Logic Apps to create records in Dynamics 365 - Part 1<p>According to Microsoft documentation, Logic Apps is a service to simplify and implement scalable integration and workflows in the cloud. As a CRM professional I was aware of Microsoft Flow but not of Logic Apps. Microsoft Flow is actually built on Logic App Most of the features and API connections are the same. <br><br>The major difference is that Microsoft Flow is targeted for business users whereas Logic Apps is targeted towards IT professionals and developers. Logic Apps can have some additional connections like BizTalk APIs. The other major difference is that Microsoft Flow workflows are created in production but Logic Apps provides the DevOps and security assurance.<br><br>The following link details the comparisons between Microsoft Flow and Logic Apps<br><a title="https://docs.microsoft.com/en-us/azure/azure-functions/functions-compare-logic-apps-ms-flow-webjobs#flow-vs-logic-apps" href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-compare-logic-apps-ms-flow-webjobs#flow-vs-logic-apps">https://docs.microsoft.com/en-us/azure/azure-functions/functions-compare-logic-apps-ms-flow-webjobs#flow-vs-logic-apps</a><br>For this Blog I am building a Logic App that will act as endpoints to create records in Dynamics 365. The good thing is that we don’t need to write code to create the endpoints. <br></p> <h2>Create a Logic App</h2> <ol> <li>Logon to the Microsoft Azure Portal. <li>Create a new Logic App by Navigating to <strong><span style="font-size: x-small">New>>Web +Mobile>>Logic App</span></strong> as shown in the screen shot below.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-hV6VnD2zbIqvNzGfNaRATc2CBEOKf9mde9c7jWXjeu_v-rSF9p0573x0oDNkf_qk9wVQG-J5A68sjL_ywWQbRMJh1wx5OG93OesfI3WUWl9-tR6mgBsmyRsU2WJHupumLDkGgu9YPlc/s1600-h/2017-01-05_16-01-496.png"><img title="2017-01-05_16-01-49" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-05_16-01-49" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBX5kxDTrfXNX0zb9_-KkM0PzH0t86U80NRegj-0va2nud-q-nd3tBx9NO28NnNcviGe0oKY2rAHsp0Z4NJXCisOSATR1r17Fz_1iLr3RodsY_iGOoYZKcV-l0q0KO1o9xujj3Jw0oi-A/?imgmax=800" width="733" height="417"></a><br> <li>Enter the app name and other information as required and click <span style="font-size: x-small"><strong>Create</strong></span>. (I generally checked “Pin to Dashboard” to open the app straight from the dashboard)<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLdYs0WDhuseW-Y-4cunRa9eo6MsLDYnqI3MthnBrIVMZ6j6t77QaHhMBEZJkzlZbaN-8f4KK-wOUVsMcrCp-E7_p6UTrFc1KvGVJkxmNqnZgHZ2RfGodM3kbxgZXJ60nyWErGgYIgZPY/s1600-h/2017-01-05_16-05-458.png"><img title="2017-01-05_16-05-45" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-05_16-05-45" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBFf26tRv_NgQlFdEPRRiv4pNKc0ZSS6OxZapYl_WLU71vz3z_ZDLHM_B6vRRf5AsD305L08h_Rp2LCKn5s1m5mlSXpyy1DuADefi-MEJHOgVuRM8wsRqt8SXArGYH6fds8i7uow6diiE/?imgmax=800" width="726" height="463"></a><br> <li>Open the newly created app.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifg0MyCnad342yxlUTVzn9jc6NgaiM_5pz2uc0JzAffS669buIMBSSq04DSKL-Cf5LweUwgIqzeEUfF704FtyVDAZHEck-pooFGTWnW-xQHVTQgcghltIZJx1GsbiAql5rEoygQ3N3pJY/s1600-h/2017-01-09_21-37-246.png"><img title="2017-01-09_21-37-24" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-09_21-37-24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIVC6Hr9H1uhSjK3Dmicv6vPX_nYq-P4KVcPiM-WxpVqi31cbc29Xzd3NWIE7z8YiyGj84m2WS-Kdd5yVBmfbwEGQd-WnPBXmc3EBgkFoxbR-VxhZxSS53Kt2XkGte3F0pbRhvwY97Y98/?imgmax=800" width="730" height="385"></a><br> <li>Click on <strong><span style="font-size: x-small">Edit</span></strong> to open the designer.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc4iE9D1S01GoXz-tCkfds_x-drEGM0nLhQec3MSkhFnnIrgFDJdCtbwTh9CSk2fXJI_J3I1Ce48KsBzLZdpfaBK1G2aOq5jtZVRQnLzZEDjsLyo2QHShrbHZH7y_85iWBP2kvmyyU7oM/s1600-h/image6.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnSpGhqYdOxn558WR-2Iyoxq_ePB60Xf27lfG6_qyymfpqnIt9lmFwmQxsTzZ7Dm6vxirhcnf3wpIf0gidd6X6S7LEBw3et_AOX8w38-1NWwup40KRAo82u4LrtqeHumCvS54MVSlbBrk/?imgmax=800" width="733" height="572"></a><br> <li>Select <strong><span style="font-size: x-small">Request</span></strong> from the list of the managed APIs as shown in the screen shot.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEsXSF-jzSuVZE0gPxU5dyn86oMkv_shAy5aaWU8zTD6GKc3QgPQmC3jHBDsQrsnULtf88I6BlsnzkPA-M3hSAqPK32E_1Sixx_CNaf2xR9zDnZ605PdX8AF8YSFOQVvFiRDg9MEFcmn8/s1600-h/2017-01-07_22-35-446.png"><img title="2017-01-07_22-35-44" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-07_22-35-44" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQHH2LZ8RRuUPImjlyRPHf_0v3-TAtPNz_ivf1ZOez1LP6sgJVyIqO1Uls4KJkJOOoA9j-VuPCqXSHez7E9IY-2r1xZFPlNMTDIsbUIdWevU9i2UGHY1RTfaFQUManZYQqrzgnaNpmXvM/?imgmax=800" width="441" height="414"></a><br> <li>Enter the JSON schema for the request. I have created a customer object with first name, last name, street address and city.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq3l67d7HHX7jMQblqCSiBC9j16_3ZxyZZzrw0boRp3-DugCxVCrGMzMGvx7ZCh38OHEDFSp9eGRJK8odzXCIxHqOHv7MRkpS7iDUolKuFWcXX53iRDJfvwN4G8VGEUEL3G08Q_3Y1hZw/s1600-h/2017-01-08_17-41-3117.png"><img title="2017-01-08_17-41-31" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-08_17-41-31" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWIWvJdoP2jPoMmoN7oOQPSIi4LHV-JxQQkJWk7-O8M8NDBezTU67pYtOXe4gQHBrtr-PhoINoJnjbRlarsycvSO5GdqI9UDuAOTElySfi9LA8ZIyT7G9-RyqRKTW9JRlctK0oWKf5fWU/?imgmax=800" width="724" height="488"></a><br> <li>Click <span style="font-size: x-small"><strong>Save.</strong> </span><span style="font-size: xx-small">It </span>will populate the URL field of the request. This URL will be used as endpoints to call the Logic App. <li>Click <strong><span style="font-size: x-small">New step</span></strong> and choose <span style="font-size: x-small"><strong>Add an action</strong></span>.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYqQDtDwbiAnfpX0i1ClbNxSV2xhXc5NAq_6Wj9vh93Mctqqs-9xvI3Et_mzjJkBYOqps32EGH8REYpHVbaYXiPYMoh2lYBiZ-hirnwArudNJXOSKrCRV6Tlt9QyhRyt_TAkHj9EH9GQQ/s1600-h/2017-01-08_17-44-137.png"><img title="2017-01-08_17-44-13" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-08_17-44-13" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE_E2lztFEHjHzvPBYO6scmF5TinGfF1VVagF2v6QpVCU9qCXoS4HWxLQ8GIte6FbppJHdt_AADq9HozJ7YO2orV1Im7d4yzBbSaMI15sCIHMpKK08uXEkVRGvCPHM3SYA_Emxp3Vxve4/?imgmax=800" width="437" height="229"></a><br> <li>Select <span style="font-size: x-small"><strong>Dynamics 365 – Create a new record </strong></span>from the managed APIs list.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNmUfhT1TTFDlvHiaMViUZ9d0sAYdXJsFBH4re-5yJsXK7Cwh8E10eKM1Arr8uj2sJjeq55AUGNxWsH_KPeUbZRBbf7qVRXBu6SwHXGv-NhbXrsehyFSnbeNpgYFFnpI36GEDZD-gEp4Q/s1600-h/2017-01-08_17-46-1711.png"><img title="2017-01-08_17-46-17" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-08_17-46-17" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxvQTO8DKn07rPPLGgKzUIyNiGOtwGhuHGXL8YHo2-LxG4WzLOwoST4tPwJ3Q9QgA6pSUa8fw8xD2ur8lGKrR0fwCzehuURf1N_8r5XUGAVKOijSQNA07pkr8f9_KNNQV1blt9EQytodA/?imgmax=800" width="475" height="585"></a><br> <li>Choose the <strong><span style="font-size: x-small">Organisation Name,</span></strong> choose the <strong><span style="font-size: x-small">Contacts</span></strong> as the entity name and map the first name, last name, street address and city with the JSON schema added in step 7.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPVZDwqJzqka-AmxefNmX0xpEndTc6O_rU7lpiWV1N4QbW5clCWi8dWggJAP63ZKCf2tZ8UXkjdJzp5rZrOjxRlrGS-NJS38m1KakrOrX_yytN-SVCK01t09fSW3OtlqQj0ksajVz8LQM/s1600-h/2017-01-08_17-47-526.png"><img title="2017-01-08_17-47-52" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-08_17-47-52" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGlwPRHesqXrBZeQc71tm-m3So9Kb7-gvPWJsqxkYofT6ySrtHPn8BbxM9STPS26X2F3tpT9J0FixVSTsxBXGA12U0PL5H6z2JcjlAcn2k2jNe1SKIeLRtduI60ciz3_udAmZFZrzJByg/?imgmax=800" width="733" height="506"></a> <li>Click <strong><span style="font-size: x-small">New step</span></strong> and choose <span style="font-size: x-small"><strong>Add an action</strong></span> as shown in the screen shot below.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWtY_3IzaAbRRpJwVkxG2tekHf9Qoj8I48wRn6gup3BGwh-iVvv6tx9uO72wTjcZSfL8YIm0HE8n-_CV8TDHtAuNrxrzvXJLv19a-Ni8IP71oB7Ct_nFc5SoSMID3eVErp0RXA3DLK2CI/s1600-h/2017-01-08_17-49-196.png"><img title="2017-01-08_17-49-19" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-08_17-49-19" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3-EMP05ldFtxj7ZkaCQa0o-WoKOGPcAvOjsrSXBKwXaI_RYRAJVv1T6qAo6HRPhsMeMgzH82JjGGkH0zvc_k6rjT8NjZdq5ML97nZTXA3p6M7VXyt6_S92ZCn6O-BBfW0-Y3Ak6wRmog/?imgmax=800" width="424" height="295"></a><br> <li>Select <strong><span style="font-size: x-small">Response</span></strong> from the list. <li>Enter the following information as shown in the screen shot below <ul> <li>Status Code of 200 (Which represents successful call). <li>Enter the “content-type” in the Headers section. <li>Enter the JSON in the body section. I am returning the contactid of the newly created contact.<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRhaq8T681SYjRRLdP2E0eUpncA6D2hwsKMavwXuS-PT31UnaE9cbo-i6CBJqtpXaVcRh-EhUqzpshxlCcI0rEC4jDcpH7vHJ5lZ8CPi69cmzHJD2vYaAij5vsIsgpU47K4BuqWwA8_OY/s1600-h/2017-01-08_17-52-288.png"><img title="2017-01-08_17-52-28" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-08_17-52-28" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8wnZ9AC0I5_1oQbm7CgOcWaa-J1aOUaOsAvJ8s0j5cqI00eJTH1FXng_KqILfSJAl0NqcfH7TpSf0aSzpJb1Kg9GqlBXaTcj_VJRi6jNUqqGpYzvtnaFoBjhcyiviM6kfAbU19Vobjjs/?imgmax=800" width="668" height="494"></a> </li></ul> <li>Save the app and test it. </li></ol> <h2>Testing the Logic App</h2> <p>For testing we need to call Logic App using URL created for Request step 8 of <strong><span style="font-size: x-small">Create a Logic App.<br><br></span></strong></p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1MWqkT_0Pj8ZDMlM9w2nuJECu42E_2wYToLk5tgoVKX9F0xxNl3IkrVSlhayrpHBG6R3jefbBcG1SxQqW3smZL52mBK1HKFfXtMPscZ6sif0mqUBsxWqB3qdExbFXmAb2G2UYMhudseM/s1600-h/2017-01-09_22-31-297.png"><img title="2017-01-09_22-31-29" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-09_22-31-29" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdvjOMdlOEY31K8pGzct9tAIIZI6QXVuALjdlnyXpgZxB-5H3fsIN-urtUmCOwqzruC7C3vfFh94p9-aOeGgrRtmagbWAFlJilGWox9Ub9c4j94AkKTd5CgfumnXSZ7328jLIrQ2Ht8Do/?imgmax=800" width="477" height="547"></a><br><br>For this blog, I am not creating a new application to call the endpoints(Logic App). I am using <span style="font-size: xx-small"><b style="font-size: small">PostMan</b> </span><span style="font-size: xx-small">to create and send the request</span><span style="font-size: xx-small">. Here are the st</span><span style="font-size: xx-small">eps.</span><br></p> <ol> <li> <div align="left"><span style="font-size: xx-small"><font size="1">Open the PostMan application.</font><br><br><a style="font-size: x-small" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjqyMAOlQNNdytvNV5fNWJWTJ2VMmEZ636Ni-ojUKdBdsM731nHhYKTpNFXbLFyRcgcQQTHe2g6k5v0oYGGdWcgm3WcmgI1NDF4Me6MvixH6xPpRrjGHO4PI6YVfm3nywP8dZUPmka7zg/s1600-h/2017-01-09_22-38-286.png"><img title="2017-01-09_22-38-28" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-09_22-38-28" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfZ08rVK4PZP8wGUqVcR9uXkE6AzehZFFqK19ZrMNXWmKPT2E7vLX8AlCT-VEC-Mhpc_n-51_FXYbCCBl5jNX3hk1QZAQl3A8JNXUHBiXv4QX74VRFnPQN9iKmpIki2JCcGVF69bft2r4/?imgmax=800" width="710" height="484"></a><br></span></div> <li> <div align="left"><span style="font-size: xx-small"><font size="1">Enter the URL copied from the Request.</font></span></div> <li> <div align="left"><span style="font-size: xx-small"><font size="1">Enter the Headers as shown in the screen shot below. The endpoints are expecting JSON.</font><br><br><a style="font-size: x-small" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge3GnAcMJEpjthX4wv2QPcX_NgYynFfkpw0JzBoSBZpdzGPGA4YhQNXnLlT7DXxTnWV6y9YZ4kRXD7hfDk_T1CRPDilDlAgy9PlMkdo_H18uvEzkOm9LqWC0VkwdUVSssnUflu4olLnOo/s1600-h/2017-01-09_22-43-28%25255B5%25255D.png"><img title="2017-01-09_22-43-28" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-09_22-43-28" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdZrpTaQTJZhyphenhyphengn62QojYsafh3s7FkECNfdyTtDDQ7_BAs1suzw5A0u8_olIyQe-be8zbSdFZSLbBGgPmW1-ecOcRZRKqBRTeSXz25vZv_rXILliYthXjpTaJUpC0B5Ism95J1XTWbh2M/?imgmax=800" width="568" height="125"></a></span></div> <li> <div align="left"><font size="1"><span style="font-size: xx-small">Enter the Body and Click</span><span style="font-size: xx-small"> <span style="font-size: x-small"><strong>Send</strong></span>. </span></font><span style="font-size: xx-small"><font size="1">The Logic App will return the customer id as shown in the screen shot below.</font><br><br><a style="font-size: x-small" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgacgU_YO-Qezy7v2Bm9AXicWd6Df104Cak6nE2s90dPJ1tRgn3GNxwaCzds5ZCTxloFP_xW7RNyPL-2XuX1N0cHEKhXxvTriPmgnirmpNcN-GcTSq22s96CgdqkJIvV2I1l8OFNk98nu8/s1600-h/2017-01-09_22-50-395.png"><img title="2017-01-09_22-50-39" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-09_22-50-39" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiScy54C7SFKsdNopb2UVGJPKCTNLzmKPsVoM5adPZgpYKzBItX0M8jjS_mSZNlpoI_usY-1mS3T2_0ZBm_VqAsGFqNGjtIhMdFkxTOUjd8uIFsVp9cvL3l4SeZg5dV0NXpwVQasfdm4ls/?imgmax=800" width="717" height="427"></a></span></div> <li> <div align="left"><span style="font-size: xx-small"><font size="1">Open the CRM and check the contact is created. </font></span></div> <li> <div align="left"><span style="font-size: xx-small"></span><span style="font-size: xx-small"><font size="1">If there is an error, go to Azure portal and look the app summary and troubleshoot the error.<br></font><br><a style="font-size: x-small" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9GzchY3uf2VUHTpapw5T7au2cEIE_JBkA6dCQXgWVV2kOfZuGAS1ig3KB_6rios2-DwKZVsEpCrV2XkW6DP3dgnjP3EPqKAkZp8p718ZN-uy88WeDYhIFTCrKIZIBfDI5qPaHbdD8LHk/s1600-h/2017-01-09_22-56-075.png"><img title="2017-01-09_22-56-07" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2017-01-09_22-56-07" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXfkuUFSkHC7QXuPrbXpr0Zyl18ib7l528TZ_LWuBeJdosxUhKTJTGRFo0oKNoUcYhFgImtD0xxmspBZtI9_YJUF70foLv4mJLUrUt1KK_-q3gZh8u13Ajm12NtnVKw0pNCSozi7z-INI/?imgmax=800" width="723" height="565"></a></span></div></li></ol> <p><br>That is it . You got your Logic App as callable endpoints.</p> <p align="left"> </p><span style="font-size: xx-small"></span>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com2tag:blogger.com,1999:blog-4535447606986422873.post-62574023555548942532016-12-13T21:48:00.000-08:002016-12-13T23:58:06.627-08:00Adding Icons and Tooltips to grid columns in Dynamics 365<p><br>I was going through the “What’s New” section of the Dynamics 365 SDK and found out that you can now add icons and tool tips to the grid view columns.<br>Microsoft has added the 2 <strong>imageproviderwebresource </strong>and <strong>imageproviderfunctionname </strong>to the layout xml of the <cell> attribute of the saved query. These fields can be used to attach a web resource and JavaScript function that will display the icon and the tooltip.<br>For this blog, I am displaying red, yellow and green light bulbs based on the priority of the case. <br>Here are the steps:</p> <h2>Create 3 Icon web resources</h2> <ul> <li>Find 3 icon/image files for red, green and yellow color. I am using PNG files of size 16x16 pixel for this example. <li>Create a new web resource of type “PNG Format” as shown in the screen shot below.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrDhhuROgHNahFEOysXIxW5YkmqM20q5Jlzz5fpJiN4B6lK8BAh6kUpOk2HqaT2I-KsVhwXm8TwtGIeoen2yaC1qlq8rqb4zwuKsDPQUh9zvJuwwMfBUEAezUjCOwqspuV7qEMub6qJ4E/s1600-h/2016-12-13_16-04-47%25255B5%25255D.png"><img title="2016-12-13_16-04-47" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-12-13_16-04-47" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpXtlJ5OJa2MbLVkTT0GrkU0ZOza3z1FbdKkLw3n3hyy4k0OrfTzwRR6MQJnbz6F5hz4-rxRYlPKIommOa394oylfdRNIwGxBAPUkVeA5PNPfocV7iSiF2AccI8ERcaFqZkoeczYDv3r8/?imgmax=800" width="572" height="460"></a> <li>Repeat the above step for green and yellow icons. </li></ul> <h2>Create a JavaScript web resource</h2>Create a JavaScript web resource with the following function. It is the same function that is used in SDK sample. The function takes the 2 parameters rawdata and userLCID. The userLCID can be used to display the tip in different languages. Check the SDK example for details. <a title="https://msdn.microsoft.com/en-us/library/gg328457.aspx#BKMK_CustomIcons" href="https://msdn.microsoft.com/en-us/library/gg328457.aspx#BKMK_CustomIcons">https://msdn.microsoft.com/en-us/library/gg328457.aspx#BKMK_CustomIcons</a>. In this example I am not using userLCID as only default English language is installed in my CRM.<br><pre style="font-size: 12px; overflow: auto; border-top: #cccccc 1px dashed; height: auto; font-family: "arial"; border-right: #cccccc 1px dashed; width: 99%; background: #f0f0f0; border-bottom: #cccccc 1px dashed; color: black; padding-bottom: 0px; text-align: left; padding-top: 0px; padding-left: 0px; border-left: #cccccc 1px dashed; line-height: 20px; padding-right: 0px"><code style="word-wrap: normal; color: black"> //display icon and tooltio for the grid column
function displayIconTooltip(rowData, userLCID) {
var str = JSON.parse(rowData);
var coldata = str.prioritycode_Value;
var imgName = "";
var tooltip = "";
switch (coldata) {
case 1:
imgName = "new_/images/red.png";
tooltip = "High Priority Case";
break;
case 2:
imgName = "new_/images/yellow.png";
tooltip = "Noraml Priority Case";
break;
case 3:
imgName = "new_/images/green.png";
tooltip = "Low Priority Case";
break;
default:
imgName = "";
tooltip = "";
break;
}
var resultarray = [imgName, tooltip];
return resultarray;
}
</code></pre><br>
<h2>Attaching JavaScript web resource to the view column</h2>
<ul>
<li>Open the view for which you would like to display the icons and tooltips. For this example, I am using “My Active Cases”.
<li>Select the column Priority and click on “Change Properties”<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiucJ-4eEw1S7mtCnPqQ3_ci-wbfn08nvcJykq9MiN0MEkvEwETYvXMxZ4fyZZd1MI8RvoCb5e9m6UiYpsWjH5ZhwPHhS_rGFqQVdcT-FWOcZd4rYkBCwr9t6CROJIlMTC1SCWC84Wq7wc/s1600-h/2016-12-13_16-23-09%25255B4%25255D.png"><img title="2016-12-13_16-23-09" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-12-13_16-23-09" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibrU5pnSDpH-pASSrvRtUgKmt2z3C9LXppU-am0jDHfsJM-km84WOzy3AjZATiQDHIVgM8WUyV_uf5qbdi74gmw-mK7vyyOS3fcqfuc9CwxlxqME5Smyj1rGQ2AW1LV9KJjGQ112ZyEwc/?imgmax=800" width="592" height="226"></a>
<li>Specify the JavaScript web resource and function name.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1FZM8totgw63V89lj0qHbTXlTErY1s5eBq3ICzXDQ2yO_IDqD_1OvWmacSf64ns4J1S3AUNWl2YW0ETLLO2yDJLCb62LUzezrULWII9qJxf3bDRKQIbwk3on2e941lZmLBf4gPZA1EAw/s1600-h/2016-12-13_16-25-30%25255B4%25255D.png"><img title="2016-12-13_16-25-30" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-12-13_16-25-30" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp8Z7XQIbNFcgLRfuZBbe9LtjEC4wm6xON_8cx8FkxGgBGjch-oKlfgWezjxGnebxkdcW9SJiaO8sMdjUruFUUmpHjUm5yzXGg0wSHw_sUfVxLmiNvdS1T9bJigdxBfwBW6PvY5NAF_3A/?imgmax=800" width="590" height="600"></a> </li></ul>
<h2>Results</h2>Publish all the customizations completed in the above step. Navigate to “My Active cases” and check the results. You will notice different color icons based on the priority of the case.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4xrOHxP5HGgvWVNQZBh5AtynlgBGOqyNJT62xFIZwcAPnHVkAnBxsDbTOUXolPS5TQ_kB9LGnjhFqtOCJ3HMDJqi0XNav6oYBfZIe0mLV7_PuBRpbd9anhNL8w3TjfjqRc5ycYBPYGhY/s1600-h/2016-12-13_16-46-25%25255B5%25255D.png"><img title="2016-12-13_16-46-25" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-12-13_16-46-25" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUOGjq9An5mw_IKRjBOuDsbEwiKCb4jNbDYQ_B0WkNnI-40vF516UhROS5WbjVnfvOlNitvexQOXiZRX1qMU1gGG9SY1CViDJ6XG7FfpfUfnuXUc2v3ZlsIM8LXezS4OpZX_sI3kxdgVs/?imgmax=800" width="774" height="384"></a>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com15tag:blogger.com,1999:blog-4535447606986422873.post-54259845431969712202016-11-27T15:04:00.000-08:002016-11-27T16:59:25.590-08:00Enhancements to Client side Notifications in Dynamics 365Microsoft introduced client side notifications in CRM2013. Dynamics 365 has introduced enhancements to this functionality.<br />
A new method <strong>addNotification</strong> has been added to to the client side API. This method can:<br />
<ol>
<li>Display a error or recommendation notification. In the earlier version the only option available was error notifications.
</li>
<li>It also allows you to specify and execute actions based on the notification. The new method not only display the notification, it also display 2 buttons:</li>
</ol>
<ul> <ul>
<li><strong>“Apply” </strong>to execute the action
</li>
<li><strong>“Dismiss”</strong> to close the notification</li>
</ul>
</ul>
<h2>
Code</h2>
The following sample code will display recommendation notification if there are numbers in the <strong>“name”</strong> of the account. If the user clicks on <strong>“Apply”</strong> button, it will remove the numbers from the name and clear the notification. If the user clicks on <strong>“Dismiss” </strong>button, the notification will be closed.<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> function addNotification() {
//get the name control
var myControl = Xrm.Page.getControl('name');
//get the name attribute
var accountName = Xrm.Page.data.entity.attributes.get('name');
//get the value name attribute
var accountNameValue = accountName.getValue();
//if the account name is null then return
if (accountName.getValue() == null) {
return;
}
//regular expression to find numbers
var r = /\d+/;
var s = accountNameValue.match(r);
//if match the display the message
if (s != null) {
var actionCollection = {
message: 'Remove the numbers from the name?',
actions: null
};
actionCollection.actions = [function () {
//remove the numbers
accountName.setValue(accountNameValue.replace(/[0-9]/g, ''));
myControl.clearNotification('my_unique_id');
}];
myControl.addNotification({
messages: ['Number/s in the account name'],
notificationLevel: 'RECOMMENDATION',
uniqueId: 'my_unique_id',
actions: [actionCollection]
});
}
}
</code></pre>
<br />
<h2>
Results</h2>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh55TKdpG_eBo4EOuxuXxFGtBAI70_LiPkF7ZYsYWuFbnp376gLn4eWswFgiJcGS3Va38vWpDdBlnhykxNR8D5B5E5Vh75MCjqFGI822HhTQAvQCAyn7HltzBDGBPXrF96kXxRcTZtayI/s1600-h/2016-11-25_22-36-28%25255B5%25255D.png"><img alt="2016-11-25_22-36-28" border="0" height="468" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLR3msbqsPgllt4kY54tBPhL2NY3rYjMjjpATWOzopVdylOq-TM_zsY3xaOs2BCOgdwH80hkMOZUkboQyMkNL_lrnyHVQQkO_Z5jVLBYDVFoN-HZJ4as4SGAUnEvlpfKIwjAjQQ38NcDY/?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-11-25_22-36-28" width="820" /></a><br />
<br />
When the user clicks “Apply”, the system removes the number 7 from the name.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSSPF9JXykdg3zcS0Sdd5Fek0Cyl262V6BgvOE4KxhHgEe3fT0r4kP3Ay1z70JK2wn-zhD_unRUu5yiFYsgy43o4Rh2s4q-ROwnS3aFYEocTpt7uuvXGQhOdzhgXz9nWGN-JrsClOotfo/s1600-h/2016-11-25_22-36-56%25255B5%25255D.png"><img alt="2016-11-25_22-36-56" border="0" height="327" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigivxKjgPx2loiIejaEU5mJ3tRBEjBXaW0naJmaqvOso9FR8UOYHmdDtc4BzEEEmc4XVXRnxMD8qZM-mHocGNTu81YMY7m209oxXv8ErlVUX6LcPsCM1F_C6-X8tdY6uN2dez6_L3MlSU/?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-11-25_22-36-56" width="819" /></a><br />
<br />
This functionality will be very useful in number of scenarios, for e.g. validating a field and recommending a value, moving the focus to specific tab or field, validating the field value on the parent entity, and opening the parent form to update the fields etc..Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com1tag:blogger.com,1999:blog-4535447606986422873.post-28436359741317212972016-11-16T19:37:00.000-08:002016-11-19T04:36:58.688-08:00Interesting integration scenarios for Dynamics 365The release of Dynamics 365, along with the general availability of Microsoft Flow, Power Apps with CDM(Common Data Model), and the vast range of Azure services have opened up a whole new world of integrated solutions.<br />
<br />
I will go through the following 3 scenarios to show case the integration possibilities for Dynamics 365. This blog will only discuss the architecture of the solution, not the actual implementation. The aim of this blog is highlight the solution possibilities using Dynamics 365 and Azure cloud.<br />
<h2>
Integration of Dynamic 365 with Power apps </h2>
<h4>
Technologies used</h4>
<ul>
<li>Dynamics CRM 365</li>
<li>Microsoft Flow</li>
<li>Common Data Model (Part of Power Apps)</li>
<li>Power Apps</li>
<li>PowerBI</li>
</ul>
<h4>
Solution Overview</h4>
The following depicts the solution architecture of Dynamics 365 and PowerApps.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLD-95dr7rGYyAwwUFygIftpfcmkqOk6OLKBRAy6jMFIm5-d1e3nG2hMGZHA6YeT1YbuC8ohHdgdMiwaK-P6FbnsK0w-36lW3FTMJo_7rdr4SkBz4CReqY5lGGlx6fKcRqZWG_yryVy58/s1600-h/2016-11-17_11-15-32%25255B9%25255D.png"><img alt="2016-11-17_11-15-32" border="0" height="305" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit6yQTA_-5llML-rW1b1Q5bBfsFTV_3RZmq6cby8iYlHGB5KWQ1dH884wyEfg_vlhpbLJSSo2Mv_hqTi3PBxyf6aRQjLKdXQWCnDQTzMqdnwfnKyQNVfQIQbmE6xfBRpN36_Z6cY9hQXI/?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-11-17_11-15-32" width="694" /></a><br />
<h5>
<span style="font-size: small;">Steps</span></h5>
<ol>
<li>A record is created/updated in Dynamics 365 which triggers Microsoft Flow workflows to create/Update the record in CDM. </li>
<li>The PowerApps’s mobile app connected to CDM presents the data to end users.</li>
<li>The end users read,create or update the data on the mobile app.</li>
<li>The changes are saved in CDM that triggers the Microsoft Flow workflows to create/update the data in Dynamics 365.</li>
</ol>
The data in CDM can be used by PoweBI for analytics. You can also add the data into CDM from different sources to get the consolidated view of the data.<br />
<h2>
Integration of Dynamics 365 with Microsoft Bot framework</h2>
<h4>
Technologies used</h4>
<ul>
<li>Dynamics CRM 365</li>
<li>Microsoft Flow</li>
<li>SharePoint Online</li>
<li>Azure Storage</li>
<li>Azure SQL database</li>
<li> Azure Search</li>
<li>Cognitive Services</li>
<li>Microsoft Bot Framework</li>
<li>Skype.</li>
</ul>
<h4>
Solution Overview</h4>
I am very impressed with this solution. This scenarios depicts the business process of an insurance company where users have applied for the policy online. The business process workflow creates profiles in Dynamics 365 and stores the customer application in SharePoint Online.<br />
<br />
A Microsoft Flow workflow will push structured data into the Azure SQL Database and the unstructured data into Azure Blobs.<br />
<br />
Azure Search crawls the data at regular intervals and keeps it current for querying.<br />
<br />
End users interact with the Bot application using Skype. The Bot application processes the user requests without any human interaction using cognitive services.<br />
<br />
The whole solution is taken from the following blog:<br />
<a href="https://msdn.microsoft.com/magazine/mt788623" title="https://msdn.microsoft.com/magazine/mt788623">https://msdn.microsoft.com/magazine/mt788623</a>. Please check the blog for solution details.<br />
<br />
The following depicts the architecture of the solution. The diagram is taken from the same blog.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVodM216tn-M9J9Ir3ff2c1ORTeI24hKCYl2SwCDhmdBo66442qXjc0YHg7eG7D7toifpemAek8w1P4Hh3ypXqjBq9HynqowITYI49vgjbKahV-TabuCxNGOnpDM9sabC93jW4Az0Y7TY/s1600-h/Solution%252520Architecture%252520Diagram%25255B4%25255D.png"><img alt="Print" border="0" height="315" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicLa2ox3bN094m7YqHBbyTxq-XtEsAv4o3elOzjKqvuY98jCP4mRZR5RwmNZF_9Gn9DEdferTRnv0q5VZ10m3MZg3b3Gk3sUdWgEEHWg-lpa03N0I0MYrGK3H7uXLkcsBbtFClOuc9aWY/?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Print" width="769" /></a><br />
<h2>
Integration of Dynamics 365 with Azure Search (Relevance Search)</h2>
<h4>
Technologies used</h4>
<ul>
<li>Dynamics CRM 365</li>
<li>Event Hub</li>
<li> Azure Search</li>
</ul>
<h4>
Solution Overview</h4>
This solution is a preview feature available in Dynamics 365 named “Relevance Search”. Relevance search delivers fast and comprehensive search results in a single list sorted by relevance. It is designed to boost Dynamics 365.<br />
<br />
All this information is available at TechNet. <br />
<a href="https://technet.microsoft.com/en-us/library/mt723654.aspx#BKMK_Architecture" title="https://technet.microsoft.com/en-us/library/mt723654.aspx#BKMK_Architecture">https://technet.microsoft.com/en-us/library/mt723654.aspx#BKMK_Architecture</a><br />
<br />
The following diagram depicts the solution architecture of the relevance search. The diagram is taken from the Microsoft TechNet site<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzK5puc-5Xq2gHltZwYCbAzOyC0mhhDfwVvZYfvheEVvkW5Bj4mgepYruP1Z-oMGeGs38gBxsv6TMhr4tWatMF2GfXv_S4ra5xzCc7qBz_iWL4JaEks_w2GaFqWqghzNKYV-aSMK2EgAo/s1600-h/Relevance%252520Search%25255B2%25255D.png"><img alt="Relevance Search" border="0" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpialG3gDPOjguvoFQWGR7kLFPdIdYqiwopUcEhFT5INWvZv2R8SJi48YF2FzAJvdZaRTU881EVOoUSgJtQCKaSyVLuP-q0rP68qpI2mi5Iem4wEI1t5_DQHNRRxPfYP4h90sHyDqUiGs/?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Relevance Search" width="808" /></a>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com1tag:blogger.com,1999:blog-4535447606986422873.post-9010349722435923492016-11-10T20:31:00.001-08:002016-11-10T20:31:41.251-08:00Duplication Detection Bugs in Dynamics 365<p>Duplicate Detection functionality has a bug in Dynamics 365. If you run a duplicate detection job or try to create a duplicate record, the system will display an empty duplicate detection dialog as shown in the screen shot below.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFxgJGglw-Ei9vgsJLLGLjOW-PlVHRpQQgiZ32SzFMO2py1qZoGhn2sj-xyyHmki193NctdA1UgETpsra_SBAsHVZsABUp6O2fRU1KugPPuotfpze7ZIVy9tNEGw3AYMIswx886EE8o-4/s1600-h/2016-11-11_15-00-25%25255B4%25255D.png"><img title="2016-11-11_15-00-25" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="2016-11-11_15-00-25" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs7HgTiDJCGUAaIHJjVEyCOHUXHsR_BUwPoVsZpmzEtolUNMtN4KeffucdCGCsXE39-yPZYD5Bl-C-_uGI39AS_53fHzopzSKXP-eYWGpemEcA5SIRgCw_W39dfndk7x6pV4pWwNUms8M/?imgmax=800" width="554" height="483"></a></p> <p>The <strong>Updated Record </strong>and <strong>Potential Duplicate Records grids </strong>do not show any records.</p> <p>Also if you are updating records in the editable grid the system does not trigger the duplicate detection rules. The system will not display any duplicate detection dialog.</p>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com2tag:blogger.com,1999:blog-4535447606986422873.post-47855751191169373982016-06-27T17:41:00.002-07:002016-06-27T18:01:38.756-07:00CRM and Azure Service Bus Integration Part 3This is the third part of the series. Please check the last <a href="http://mscrmshop.blogspot.com.au/2016/06/crm-and-azure-service-bus-integration_20.html" target="_blank">blog</a> first, if you haven’t already.In this blog we go through a step by step tutorial to setup a CRM-Azure integration using <strong>service bus queue</strong> via SAS(Share Access Signature).<br> <h2>Prerequisite</h2> <ul> <li>A CRM Online instance <li>Microsoft Azure account <li>Microsoft Azure SDK <li>Visual Studio 2013/2015 <li>CRM2016 SDK V8.1 or later ( We will be using the plugin registration tool and sample code from the SDK 8.1 as the SAS featured is added to CRM2016 Update 1) </li></ul> <h2>Setting up a Service Bus Namespace and Queue</h2>For this post we will using the same Service Bus namespace we have created in the last post <a title="http://mscrmshop.blogspot.com.au/2016/06/crm-and-azure-service-bus-integration_20.html" href="http://mscrmshop.blogspot.com.au/2016/06/crm-and-azure-service-bus-integration_20.html" target="_blank">http://mscrmshop.blogspot.com.au/2016/06/crm-and-azure-service-bus-integration_20.html</a>. We will add a new queue to the existing Service Bus namespace.<br> <ol> <li>Login to Azure Portal. <li>Select the Service Bus namespace. Click the “Queues” tab and select “Create A New Queue”<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivqIaI1KQFb7UY09NV7BoTibFLE6I6FxPrQUEU33uS5CI7XQ9yspiTUktqSdFkp0Uaz6gThTX2qRjgUrZTyyj_PoL5i901xuhxvzfaiQEp_SR_oNM7Qs0XU7tU5ErIY29Z5OU6-NJRVcE/s1600-h/2016-06-22_14-28-054.png"><img title="2016-06-22_14-28-05" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-22_14-28-05" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivbzf26VfvFK2qWmR1FNzpp4vfd73xGgFauadk8Cs3j6J657CExbD7EJ75OIVcrpLLaRNn07865U3lOnSi8sX8x0fVcwi4IyXMsIJmb6jQoW4OZa3a51nJHMPd4lsi9MLZdOK2m9FlzMg/?imgmax=800" width="737" height="238"></a> <li>Enter the values as shown in the following screenshot and click “Create A New Queue”<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCW2uyVGONtaGhifUGigQ55MtuUpvLIOFEl_9x87XaPmGBw7uAWC7xKPyPMn4omdYyUbWEWn42RYe9URUH7ccJb-z-Ttdn-ZAptDGUzKjtcykyA3UWqlsZlmTnNfVSWhXh4n580Qf7v5I/s1600-h/2016-06-22_14-30-184.png"><img title="2016-06-22_14-30-18" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-22_14-30-18" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8dzIjVgLthtwZISKMrgDvGSl4HklX8DLyHuJ7blWLHCjnlfbbbWoAxodfUWdJm16RA-bDOMMhjJZSAr3f_IFdxVG0OJoGh7qbJHEtgrDUH25vX-hSLj6G4MMxCR5DQZEsxpZiPSKbAZc/?imgmax=800" width="745" height="225"></a> <li>A new queue will be created as shown in the screenshot.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQN56WkSJ-k0RBIDDOMG-VRXuoLtqK5Vj5O9ta311RKQ7EehWkILE2gL0UDDoAZdsk3U5Czwgyp46tsdTcL7dikJkpsfVDtT0J48Aqm3oKIqifhRhU3u2-MPo1vRcotBL75Gi2ARuUJKQ/s1600-h/2016-06-22_14-30-5810.png"><img title="2016-06-22_14-30-58" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-22_14-30-58" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUSsXtvtWJpi2Bd69GGVYY4f58r6ycgaQ4Ca4SgUBmfRqvONrsK7S5qGNhHF9JxkELK3HpOlRLuRvHik7Dc5IH3BKaZyTFzTQw9qvKn997pKfrEtxufvEZ2oUibHfIv3-5fXYlzAw12Xg/?imgmax=800" width="748" height="169"></a> <li>Double click on the queue name and select “Configure”. Change the general settings as required. I am using the default settings. Create a new policy to mange the access to the queue. <br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTLsvZtB2NcLA2ugeOMBLlvg7wYHGsSp86-Sz4MflcdocSRjdeiGydLNI_3SCF4q2195QnE8IbsQielRMxEGq9pFoEHZNV6pFJpXCfy2BcG4U_JUw6ar9dXujRIcykOcAhvC-EBwFkJVc/s1600-h/2016-06-27_13-40-125.png"><img title="2016-06-27_13-40-12" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-27_13-40-12" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEginjmIByJbNNy2dtjbUilLB-bIcbab9gUTlKAasHa_U_soAF3kTVpl2P6lBX7fcjMTxyioArGE5LOGGzZgo5JRZbxi_OIE5FuIeGfvWSQxAtfwMxIV4Mt96OQBO-0-dI7_UGDaqgw0Qds/?imgmax=800" width="756" height="551"></a><br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxke6HPVZnV3qwNTZGnL_zEhXdld3UWAO6uQMCUmnzpnqLAce70J2AQJSMJH_5OofqhHdym_KompuTGtRGH72feRlfZesiyp8JWkvny53FUswEAy-1uZGvnmXQNW1Z2Xi4irUOnUi7gIU/s1600-h/2016-06-27_13-44-54%25255B1%25255D.png"><img title="2016-06-27_13-44-54" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-27_13-44-54" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQjrrBWlETn4DFjQ4M4cxkY879crMGAzTvzs8YWXKI4P3CWEqRx24g8kRbX2AEoZu9nLzQYVIpfEiKxM7Pl4IJEwc6C27C-aeuO4gPY0w2wyMO2IpgpWFYVDGmuIzelV6bwcNL1hXu07E/?imgmax=800" width="405" height="65"></a><br> <li>Click on “DASHBOARD” and select “View Connection String” as shown in the screenshot.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLVHhX0Y2Ifc6obMqayx8J0FXzWB82sfuyo0wJ28faL0vW8_i6XVVksNEYroXx2TWLEploibh7hkT1aDWOhlZYFAdOzMsG_9XCd2rq-n2OAccn15QSlCChJjxyDgqBe1PbyGrFSp67wV4/s1600-h/2016-06-27_13-51-045.png"><img title="2016-06-27_13-51-04" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-27_13-51-04" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu4-5DUHym5aPs-zKCd_hbnoTnr607T6ZP22SccbtvKyJt52mL0ig6hsza_1aOsN43msaQvpFZhxjtW2kWC52v3agJUB1YbDSDYj9VlWvP8XMrCh174tlCBhZ8QsOnFX7grCeToyemtCw/?imgmax=800" width="755" height="529"></a> <li>It will display the "access connection information" as shown in the following screenshot. Copy the connection string. It will be used in the next step.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIgTcMxMp3nxyrf6ZLk7pptsjNgsM02y2cjdDd_Djwuu-jaWw7H3KgBPYg1D8B7pvyo3UAowrL7z5rD0uK7YLU4YQOsGN2JVsKmse9bzZMwo9H36bqS85RwrtRuNS-WNJy989CLLWM1Vo/s1600-h/2016-06-27_13-53-435.png"><img title="2016-06-27_13-53-43" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-27_13-53-43" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT4W8eN-jOkXdK7On_eIusC6U-auzB6ctnehWLxglNjN2JNJMlC5cu5W12rRHt_EFgx2-ftXyFGXvzpomcqw3lfl_UJgErmvhQtmCE0x_9HYKRezPzrCw0npbHLHcpW9yikwNX6z5nryE/?imgmax=800" width="759" height="664"></a> </li></ol><br> <h2>Setting up the CRM Service Endpoint</h2>Here are the steps<br> <ol> <li>Start the plugin registration tool. It is available in the <strong>\SDK\Tools</strong> location of the SDK. I am using SDK v8.1 <li>Click on <strong>Register>>Register New Service Endpoint<br></strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjd9Y_7_lmd2Er_8IZ0M2INO1xGefFCNTaXQFkHk0gJ31KxhBw6Y0ZCET-bQR5V5xLediMv9uT71IZBVlJWYhMsxw28IRwDpQ_ApOQUuAGHT-BkqFk4HSd2wOI5SXEwupjc1cwcjSHieg/s1600-h/2016-06-28_10-45-05%25255B5%25255D.png"><img title="2016-06-28_10-45-05" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-28_10-45-05" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkjG0aQv5-ZJc6k1x6CuES2cdu6k22GTvy7OIMX9mCRzNXejM4lN_BSWC-zJL6nIIi0PethW0ZW8Cah2iP7FicFeENam6w5k142EzfWb0wVWYtp0qWRyc2HN7PwCIZg8wcJVZtLCG-w5A/?imgmax=800" width="769" height="256"></a> <li>It will prompt for the connection string. Paste the connection string for the queue here and click “Next”<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvmq46rmFI0W74Tip5m7BqIpVTzV05RluEzGYbEQfa2M7KBsSIz8ICSerkvpSLpLGmNa9OH9qID5rAhddjYLJJPZAlTpXJPzznX8V3UZImx0bPHtk4jztROT4r9wud0fi8qjt0W_uv6MU/s1600-h/2016-06-27_13-59-12.png"><img title="2016-06-27_13-59-12" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-27_13-59-12" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv4blroamn3Et86zRPpqtYfQ-PcaSYJOwpsXErcPIyr53jY6Qp9sT0YPMCIdXl_sQkArG9txS1I-kwLPWcSrs5laAdxC1C3K24kWt9GPa477CxKr_gYtfEGPSKPLori9s-crWaxw-GmyE/?imgmax=800" width="767" height="397"></a> <li>The registration tool will display the following page. It will prefill most of the values. I have updated the message format to JSON for this post. Click “Save” to save the service endpoint.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ84zPaToNytGxMKhkqyBjxLLZauk795gvT2JLqfwa6Axg-HDl9vHKkFKUpmSK7NOraxEEm2QBgHfmD0Qvzgn36JhhnNeNTa9KTCg5G6LtRfIucuU2HPgCJeAe6LoPM7D0ZgIfdffjUm4/s1600-h/2016-06-27_14-08-15%25255B1%25255D.png"><img title="2016-06-27_14-08-15" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-27_14-08-15" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr4g0QsHU3aK4IkYvukkjSvFW8UOK9ty6xQf3IE90uvSwcD68bbyit33wbNaaLOAuyTkzYTt4ZOuPh3p6Q0Glih07OoYc7syh3v4cIfiDVM34rV5ffaLPhKddyr8gCMUNw-b_xgidnTUE/?imgmax=800" width="644" height="690"></a> <li>Select the service endpoint and select "Register New Step", as shown in the screenshot.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoPp0h2pvx-k2jmeQkpsrqsxNSr9ElzMWqwLrmSAesVsX3mmy0r-gmw5-piYTjcvrssi99GMZtT66g6wzIBvC3yuLKLbxErL23_s_AYPgM3mCw7wGf2-zESydGswUMQnlsuhpRyaUmWOk/s1600-h/2016-06-28_10-48-23%25255B5%25255D.png"><img title="2016-06-28_10-48-23" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-28_10-48-23" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs6F-0RA-If6bp3ndaQruMNwOWPoFYEQXRJ4Vcl6jibNA8UIDimwit6MbP5UsfdxY3a81buAEZU_oxUMF9PkYZUyf1P_60nDMogQlD1zhylrc6Jj2ivvlcvcorDWog4-tOCPZhKvUTVPo/?imgmax=800" width="606" height="365"></a><br> <li>For this blog post I am using create message on account entity. You can chooses the other messages and entities as required. Click “Register New Step” to complete the registration.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIwNGpbAZb1cK40gGocbW7oBETw5BU0zbrsKWxr9-G4TbHEtSEJI8mNC7cWEO0PHMn41sVIdHP3FiMs7bfcWwgSNl-Gwpom4Ga2ATrIikwxQSxjiQAJQeMilUkXPGOmeTFGG-iKu65e98/s1600-h/2016-06-22_14-37-09%25255B1%25255D.png"><img title="2016-06-22_14-37-09" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-22_14-37-09" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiG65EFotdtm_hOEqLFRC5I9TOWAjndC518RFcIOU6-UE5GwkRNwYg_oiaw6ddDjSpxjPpQMQW1kDGrvp7IyvRA4WGHsUaBtRTuewRREqE96ZveCyM-tJv3QtkNbDZQ9gFVNARWNHySHkY/?imgmax=800" width="646" height="426"></a> </li></ol> <h2>Test the Integration</h2>Queue integration does not require an active listener. So just create a new account from the front end. It should post a message to the queue. You can check status of the integration in the CRM system jobs. view.<br>Also, you can login to azure. Navigate to the queue and check the queue length. This column displays the number messages received by the queue.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUjYe009i-updOBAaJkZBQCFzcWYpF2W8oGPV5u0Gpruk0uth6zZrWEH49Pqic6M33GRM0aO5yD4mI7iD97-SfwdIOcD-BgzG2ZXWwXEGAPXpsCyZlPbA6qEVyDsQqeWAJ8o_YlSHosJc/s1600-h/2016-06-22_14-44-174.png"><img title="2016-06-22_14-44-17" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-22_14-44-17" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvQjtD82xoJ_uKlGb24fmq48h6T17B9f2nUBk2Lu5B1891l0VhMrMppRecvG1ekIa4yUj6vnXuIO_G-7HYOz3k2w8OhhFOPwh3xid8LhMmPzer9EOyzhQmTHosdhQG8HA4KH82rsiyK4o/?imgmax=800" width="721" height="170"></a><br> <h2>Reading from the queue</h2>Microsoft has provided the Azure sample. For this post, I am using the Azure sample code that comes with the CRM SDK. Here are the steps<br> <ol> <li>Open the “PersistentQueueListener” project from the location <strong>\SDK\SampleCode\CS\Azure\PersistentQueueListener.</strong> <li>Resolve the missing reference as done in the last blog post (<a title="http://mscrmshop.blogspot.com.au/2016/06/crm-and-azure-service-bus-integration_20.html" href="http://mscrmshop.blogspot.com.au/2016/06/crm-and-azure-service-bus-integration_20.html" target="_blank">http://mscrmshop.blogspot.com.au/2016/06/crm-and-azure-service-bus-integration_20.html</a>) <li>Run the code. Provide the values for service namespace, issuer name and issuer secret.The code will read the message from the queue and display its contents.<br><strong><span style="color: red">Note: The CRM sample code is using the ACS issuer name and issuer secret to generate SAS token. So please provide the ACS values as explained in the <a href="http://mscrmshop.blogspot.com.au/2016/06/crm-and-azure-service-bus-integration_20.html">last blog.</a></span></strong><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoVIuVuSrN3jzK7FPuivg1fIRr9-z3_d0d2mrLmIFPQiu0waY8y4De-Y-hcTKgil8xpR0DibRKBJuNc-dyBlifealRJCoN4_DFu_axRrk-nmt6j45Eedl-54oJF3kL7swjDGej2V3Uy9I/s1600-h/2016-06-22_14-59-067.png"><img title="2016-06-22_14-59-06" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-22_14-59-06" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxFIcEqKu8GMEpVoUo5GebTs5NM7GOos1Oo2HALbYtLeHiWk4qsJDs7qR8X_o9uKXMHiU1TwuVbUIWaayPIVNJC5IMjgNeiNdLho1AiifCR-A-HqQRrQNV4PDb4VU8YZiB3e6YIsEFfkk/?imgmax=800" width="617" height="323"></a> </li></ol>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com1tag:blogger.com,1999:blog-4535447606986422873.post-737053917613244642016-06-20T22:35:00.000-07:002016-06-27T18:00:08.659-07:00CRM and Azure Service Bus Integration Part 2This is the second part of the series. We have discussed the contract types, security and a general overview of CRM–Azure Service Bus integration in the previous blog. Please read <a href="http://mscrmshop.blogspot.com.au/2016/06/crm-and-azure-service-bus-integration.html" target="_blank">part 1</a> for the context. <br>In this blog we go through a step by step tutorial to setup a CRM-Azure Service Bus one way listener contract using ACS.<br> <h2>Prerequisite</h2> <ul> <li>A CRM Online instance <li>Microsoft Azure account <li>Microsoft Azure SDK <li>Visual Studio 2013/2015 <li>CRM2016 SDK V8.0.1 or less ( We will be using the plugin registration tool and sample code from the SDK. The plugin registration tool does not have ACS options from SDK v8.1 onwards) </li></ul>Here are the steps to create the integration.<br> <h2>Setting up a Service Bus Namespace</h2>The first thing you need for the integration is a Service Bus namespace. If you already have an ACS namespace, you can skip this step.<br>In the past you could login to the Azure portal and create an ACS namespace. But now, Azure portal does not allow the creation of ACS namespaces from the portal. It only creates a SAS namespace by default. We need to use PowerShell to create an ACS namespace.<br> <ol> <li>Open “Windows PowerShell ISE” <li>Type <strong>Add-AzureAccount.</strong> It will open the login dialog. Enter the username and password for your Azure account and press login.If everything goes smoothly, the PowerShell output will look like the following screenshot.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnYnXZl68Gb7D0k2KO1E-O8tPc6l2xiB31T9AtrQZUsW0vSKJqgOlYvFVbJNC6fxDabP0xoaAaCahNekEgg3E-k2UiiphAgWYFwxlTRX1paZeG-5g5UZR2J0mOOuKnCPGoZ7KelhU6GVA/s1600-h/2016-06-17_16-38-466.png"><img title="2016-06-17_16-38-46" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-17_16-38-46" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWNhwjq4SQ6CseVWTOEuj2IvKNtaQRR9zn27DBubxC5zIvvLBAirRvFmYc7G6v6Lj8Q72EBtNIwaygxQC7Z-N-YXTZH4EF1eBn9Q0uPuKv9bm_SASHog3VGmCmHobMhQPkJvF-pxinPGw/?imgmax=800" width="763" height="113"></a> <li>Type the following command below to create a Service Bus namespace. Replace ‘MSCRMShopBus’ with the namespace you want and press enter<br><br> <strong>New-AzureSBNamespace -Name "MSCRMShopBus" -Location "Australia East" -CreateACSNamespace $true -NamespaceType Messaging. </strong>Replace the parameters values as required. <li>The output screen will look like the following screenshot. It will create a namespaces for both ACS and SAS.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPzfL-o_hGfiHoQ1Y7kS6KyXcinz56Ye6pVQe8cvXGkSaed7eEpn4iGjiyF9bN5qKFSxorNOWCO6yiYwEcvrG8HHiqbI9tXfSiBr6qNO-Ds1Il_nkUa_zzvsOls4c9RCYkK1M6bbSXmF4/s1600-h/2016-06-17_16-44-529.png"><img title="2016-06-17_16-44-52" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-17_16-44-52" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSIhreIoEiWzRoJL6K7sR9nJvAzyFgjK3MLlsg_4G37mr1tL9K5jJ7moFi4iMAPK4yQi7KD1duBBJqVp5M5z-KkW1rytPPt1kf_tnKG__fNzKrTNtM6-pYkSomCjguUlW8wAr_fdaIZKU/?imgmax=800" width="766" height="175"></a> <li>This step is optional. Login to your Azure account and check the connection information of the Service Bus namespace. It will look like the following screen.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC7kUflRm1GpA_qrjnR8i0U9ZPirozztmcojBfx-lo7G3e-a2_E7Tp963M_D7KTSBVIgZEcvILVFKJbAxU1mX7-7yLGNCd81HNVTFgkOWeNgR2bG5zbZVv6Oe4Dh4yk4aCUFP4dV6cYu4/s1600-h/2016-06-20_09-28-497.png"><img title="2016-06-20_09-28-49" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_09-28-49" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJulRsNlrVwf3Us4WAxJx4GLxGLo2dhOCwx2hkHBybfERmSkSFpXIeWbAQRFcXnIdzFgImo3OrHVbi_uc9dyLIqvlunSyhf_VL420Rs_Y7mXBAzGEOxKeqnqHzwHx6ole1zpd3iaSMx0I/?imgmax=800" width="763" height="576"></a><br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmy7t8z1TF1oSDTtjRScLhYb4qosRCv_9tW3bGvq8zQNKQPeMLEpSl2GYefFvZ8KzWxAmvqYp7i7ho-veQS-YRsbCWXYSfPi5AvjTLdlT4MaGrYFw1s96cKEV6hYrCsdQKgOmtmI35HGA/s1600-h/2016-06-20_11-35-174.png"><img title="2016-06-20_11-35-17" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_11-35-17" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiw6n51qwkQzuUqNwHlkxJpAfqCMM6KwnZohXdLo-NEKBgdlhER5zMmjnbY6icUC6hjcSInr6CVLrMM8l_9ou9HXMJ2YDqgHmNP376X4sYOxzU4gYrWzyFJl3AQENEuyFyrSjvgwvPg_A/?imgmax=800" width="757" height="738"></a> </li></ol> <h2>Get the Certificate file and Issuer name for CRM</h2><strong>For CRM Online</strong><br>To get the security certificate and the issuer name for CRM go to Settings>>Customizations>>Developer Resources. Download the certificate file and also notice the issuer name of the certificate. <br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCEztA0ziks8L0Phaa4FcesSBBh6GTwrlQZ7jwQ8Eua5zBZzBIEf6KsS5OWUhQp8LK3n9lyVso1sDLHoCD-xJMgf8eVoTDZWEFXdNaYW5VsuB00XzusfDZoRXYmVXdZRsCjj5fvWszYes/s1600-h/2016-06-14_23-05-374.png"><img title="2016-06-14_23-05-37" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-14_23-05-37" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn816o3nEs_Vwv0jEmA260UjbfwA6GT-FrOy5Pov68OqOBfcakMIVSjsFWIdhfmOTlKUoux5y7iNw0KfHDnJJUmS57HmTuFAT-ZMUFpKk4xzHYhxAwBLSAadGhb1TX-mn0Y-AaqUxO47Q/?imgmax=800" width="827" height="222"></a><br><strong>For CRM On Premise</strong><br>For CRM on premise, follow the following article for step by step instructions.<br><a title="https://msdn.microsoft.com/en-us/library/gg328249.aspx" href="https://msdn.microsoft.com/en-us/library/gg328249.aspx" target="_blank">https://msdn.microsoft.com/en-us/library/gg328249.aspx</a><br> <h2>Setting up the CRM Service Endpoint</h2>Here are the steps<br> <ol> <li>Start the plugin registration tool. It is available in the <strong>\SDK\Tools</strong> location of the SDK. I am using SDK v8.0.1. <li>Click on <strong>Register>>Register New Service Endpoint<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghDbArLGqitvoWKE7geSrL7nR4poxBcLSKKNPAgelfAcnzFUzOLYsOMkh-qDXCh4fKH5ITNonAnCaU_uLUA260dCofpT4T9LQlcnhN4Ct0baQmrO2cLPo1r5LwZsVeVPVBdC0BUasLI78/s1600-h/2016-06-20_10-29-127.png"><img title="2016-06-20_10-29-12" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_10-29-12" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJiATqhJjM0VnSVJz3qDYXYC6AS5_Yw_lCRDs_yd7C2FAjzVUkjVcI_V245xw3tFWkeGsvxuEVemZuz2HK10cPCCw0kcsyJhrU2bHfdeUl8bT0aw-eJq_Tl8_VHcsI0eAoh1vc7su5S5Y/?imgmax=800" width="656" height="219"></a></strong> <li>It will open the the following page. Enter the Values as required and press “ Save & Configure ACS”.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzAigGgetXD-P1rZaht5E08HRSALss_Hq9oxhaZrube9iT-wTdO9BEIO-rqzHRMMq53uNVc4mBahfigXME9KMcikVqi4KnMBpMn2-UOQWvYKLy3Go7ulyOkHLzG968-O3Kl3VFS_gTFAs/s1600-h/2016-06-20_10-31-465.png"><img title="2016-06-20_10-31-46" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_10-31-46" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijVRs_6nwVlL0s3no2bG-MF5xkjUaonIsrUQw0hSmDZXJoizUfpmwUE1w4M-dghjMjdt8T_8cjpb5Zy0t2ksoAR0ZJ1JphDn9xeS0e3XThsQWy6Jlp4ia2V3dm-AIfxPbSL2-ANC9ezOw/?imgmax=800" width="589" height="471"></a><br><strong>Solution Name</strong> is the Service Bus namespace we created in the beginning of this blog.<br><br><strong>Path </strong>is the path of your listener project. For example, when you run the listener project for a one-way listener for this blog, the service endpoint URL will look like <a href="https://mscrmshopbus.servicebus.windows.net/RemoteService">https://mscrmshopbus.servicebus.windows.net/<strong><span style="color: red">RemoteService</span></strong></a> </li></ol>. The red part of the URL represents the path. <br><br><strong>Contract </strong>is the type of contract we are using for the service endpoint. For the difference types of contracts check the last blog.<br> <li>The registration tool will display the following screen. Enter the information below and press “Configure ACS”. Management Key is the default key when you create a Service Bus namespace. The certificate file and issuer name comes from the <strong>“Get the Certificate file and Issuer name for CRM” </strong>section of the blog.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYlpNrgBiAkmkQIhYhwLFnNto_gZJXKjS5c675Kaos3hqU0mOeNj2bfq3STxnXx-nYgQYI7W21rDGPNwhyphenhyphenNK2tzf3RlWXLYOve-EMv5HPaArbPkNGCJZtzjR0UzR94ymLH55YHXTMNdjw/s1600-h/2016-06-20_10-55-544.png"><img title="2016-06-20_10-55-54" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_10-55-54" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBbzzwO9zR6K8uYryRWJb2p7QoEIjFaltc0UG0ijRefum7BZHK0AmGW4xdB61JLAovVeHN2Cz6phclDcsD2fwJoF48WVDq7a-apXkzGkiSXlME8BNSuNe54TARCxJsmyuIXdFjURyfsWU/?imgmax=800" width="620" height="531"></a> <li>Press “Yes” on the following screen.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgThhOpZIxNPuq3rKzesRJfTdhGFRPRsu94SqHqadhpwnuJl0ZnEgluWH2edEahFu3xbwTY_nUkgmPDzytx97yhZim3WvnDnUB7hat4E1oj_IgyVfIryGzNzLAj8QDsN_bjN-oqbfIxMc/s1600-h/2016-06-15_22-39-573.png"><img title="2016-06-15_22-39-57" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-15_22-39-57" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwQ_1knHtTagqMzcmOfuXGYNTRJ_0WdXoOq_jE0k9aWvP_ENGo9NfpopgIy8IxsueD6XccQJAHo-jezichSOOIJ-Lb6esPnUXo9OBMqwlu9BNs2pYbUAs5HUhT0jHZd_ysbqpUkLbbtuI/?imgmax=800" width="520" height="320"></a> <li>It will create the management service, rulegroup and sample rules for the service endpoint. Press “Close”.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-5JQZogGe1O9XzrM8Ihanul1LGYDQJy97SlU5IRhOWkrXnSA9ivQms5af4vKQP5wyMHbTKlRRWnQ4tMNxkUK-ZQYJl__QYrRs-nvk64cF077PL6IQDCE3GWSFtl0-gO0XBfUyD0hWO3A/s1600-h/2016-06-20_11-04-024.png"><img title="2016-06-20_11-04-02" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_11-04-02" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinhuE9dtsE_FKovrSph7A-IxXqZ6GLGilkJjyHykan-wzzLhc7LtHZSNLbfgy0pHqIrQatEH2MfGFMcaHbjyKrPZ_IW7Pb9oQ_TByJ7B6L9EyOcRuuRS0NyfhAJJbwt3QvEnJBBbZTqc0/?imgmax=800" width="694" height="657"></a> <li>Press <strong>“Save & Verify Authentication”</strong>.It will test the authentication and save the configuration of the service endpoint. Press Close to close the screen.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdjOdRrtREqALCQawn4w9aIXpPRrKaOCioEmZCONNLaUdSdEix6GsFblrXhWr1cgVxG97br3nG5x543q1B9xzAjXju3Ow0fVbIOklCT4mvQOl22OMsxSc2BsNBa7ntF5ZZSVX0CPQ0p4M/s1600-h/2016-06-20_11-08-404.png"><img title="2016-06-20_11-08-40" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_11-08-40" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwhyqLPnX20Kf0i44Ok98n8uSoG_0sqP0gP39k7HxuYd_fp-kDv938lt-P_yfWSQiw4lC_U8WKIqanewSoydRbxO0AC-Yul5lTpYY61ZSuQ3QdM5Cj0C5uY54mdmXTErs769RalgbsajU/?imgmax=800" width="503" height="327"></a> <li>Press “Save” to close the service endpoint registration screen. <li>Add a new step to the service endpoint as shown in the screenshot below. It is exactly the same as registering the step for a plugin assembly.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvf3yK7Z2n1Fwwb9-bXHckciSg2C29wFZE5f0lJSzRo7eOU81TlEaKlnoxOl4oR7yljKs-ey0dJOIJHyrYt415LxejGpueYNHPjDx6czX7UByoRhutXL2sNr3pkw5RhJUMGuRU0grtsa4/s1600-h/2016-06-20_11-11-563.png"><img title="2016-06-20_11-11-56" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_11-11-56" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-uUqAtYLQUmniWp7AabSCzqZPqswrR6cFxjptZOgUFYXnkCbHmSml0sxUrFl57_ONyVl3J5UQLPTUJO_vL7d8fbnZ6xwKvVKrlFn8IC6-0su6eQR6gRwquclNzUVeYzYi-5NTcEJs94o/?imgmax=800" width="403" height="368"></a><br> <li>For this blog, I am creating a step for on creation of a new account. Choose the step values as required or copy the values as shown in the screenshot.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIzLgCcs7ukzZa6_fzVXT5pyUcxIygDhkYZo3Y6k-VT3T9LQj7MNQSA8RG2gIu7b_ShdhrdmAnFp6jvYPNzepFe4ZFa3139qdF9JsBvZx6uWWJH9nGSYWLwjdAP2vYpOHwqxpIbBJqtFs/s1600-h/2016-06-20_11-15-155.png"><img title="2016-06-20_11-15-15" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_11-15-15" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzVaWXp5yQU2RCaJzfurQGRJoIj-O6Tl_jIgsTc2ugt2btw8VRFPRWZ2lwPE6ki0AGmOlsEU37Q30rG5CJGfQwtNGjy0U5yn66XsK0OnCV4gVJbDejVfgMRpVo-GZRDnbHiG9HHWRRzts/?imgmax=800" width="669" height="438"></a> <br> <h2>Setting up a listener application</h2> <ol> <li>For this blog, I am using the Azure sample code that comes with the CRM SDK. Open the “OnewayListener” project from the location <strong>\SDK\SampleCode\CS\Azure\OneWayListener.</strong> <li>Resolve the missing references. The 2 highlighted DLLs are available in the Azure SDK.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhczkKdU6d3TUTHweGLE4hN4i2BR3W99GgKqIN8p8zw9zIL739_YRBPDMsS-UDwjdqk1pzJ_WKS3MV4h2fG5zqCPDE6Vg36zDr5KtTMNE9cqi84SfEm_5tOJi7YZ2dzYLe3prWWUGjjmv0/s1600-h/2016-06-20_11-25-395.png"><img title="2016-06-20_11-25-39" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_11-25-39" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir0g1O5la17vjv0t81eL5z9hZfg6GHLb_dPGIepq3reShfhpigWihBMMWMB-H33J0hqj2F2PrL0daCxGY-pyopaJfeIyIqbZtNQa_Q3tfYA7DCt-PpIYSUI1OsgtEBw8PCaCSzDpo3QaA/?imgmax=800" width="362" height="267"></a> <li>Run the sample code. It will prompt for the following information.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1hf1-3J3CxiDxNPFWM2hrpxwSTqKeCcWufhLY6p2RsKKTBI7pmAL0SUxXUfp-tpJZAA3uGirGtGZLffLlTAQ79Mq8aWYbqK-fYDFHHu0ZWAWP_y0g0rV0lQ0kLmibGXq3u1UYXn8KEA8/s1600-h/2016-06-20_11-29-274.png"><img title="2016-06-20_11-29-27" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_11-29-27" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxgZ_ijw4yEemuN6V3LblNL9U2iM0qlpsebpcOVGP6gZ6cMleW5qsTQbCzAAzAe5OmhkNaDm9DgxzGFT51hyphenhyphenyDiYQfet8iWwjS8LF9-E2RGtUfADNlNL4OSuiKGzHicL7mJYWar71bePM/?imgmax=800" width="706" height="131"></a><br><strong>Service Namespace</strong> is the Service Bus namespace.<br><strong>Issuer name</strong> is the “Default Issuer” on the Service Bus connection information as shown in the step 5 of “Setting up a service bus namespace”. It is not the issuer name in CRM Online.<br><strong>Issuer Secret</strong> is the “Default Key” on the Service Bus connection information. <li>If everything is working properly it will display the service address as shown in the screenshot of step 3. </li></ol> <h2>Testing the integration</h2> <ol> <li>The listener application should be up and running. <li>Login to CRM and create a new account. If everything is working properly, it will display the data context in the listener application.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4HM9PhrpiMgbt2tA6nBNmFOeMmGyao9oUdCNMewLDrjhN__-0WjfWzlBvdi-TYzTtu8SQ34FIW2qIyY91W059bLe1H8uW0aDuA1tfGDvHK8m7ghZ6QicHc3MSCLs6jLqlY_X2SztAfmk/s1600-h/2016-06-20_13-41-254.png"><img title="2016-06-20_13-41-25" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_13-41-25" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0rRM7rHJ4yeuawIFCOhVk_Osb0r45UwWSon1LtekfWOR7kxQl_RYoBhdBn-91jcRcZpS2XN1Pv_odI_OlRhq4faG6wG2Qd-rH1EyorvA3vTHfuUqsGfXM7Ys1M3UF5tnPTek-dqBTjBE/?imgmax=800" width="779" height="545"></a> <li>To check the status of the jobs you can go to the “System Jobs” view.<br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXheBAEsho4NIfy1kRZXTkI_JadeeUXAYq4bw3mcOxD9O8eA7z5OM6UdbUurXd2YzTL494IyXI8WlgLh6J1rY0U6Xk3mH56Ss3Gq1VxLC_VBVXU15eKpk4fNaU_HgA-9VkUQSsDVvbMN8/s1600-h/2016-06-20_13-44-564.png"><img title="2016-06-20_13-44-56" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_13-44-56" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJMeaSMcpSk5kAQGoJ4YNV9cphbFEiLIikWH92ZatfeTaCHn9M8Gh51kw9lPraOCRO8ov0VQnFETSndbDXvUHvnFN6yTAsVnfMxylcbNYgbgKEMwmsx48Kos3rlGbQ3bMWJ3a2ROd2x1A/?imgmax=800" width="787" height="336"></a> <li>If the listener application is not available, the status of the job will change to “Waiting for Retry”. It will keep trying to post the message and ultimately change to “failed” if it is not successful after X number of tries. The screenshot below display the details of the job with the status “waiting for retry”.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq8TokQM5m9PHqf9etAvNcdWlptHPIAnoOVnge5T_w7h-xX4xZSRs4Yf5KmJoVMstg0Qpbj7Wmjo-ew-Sg1LN_z2SZYpPpVwGTHY-Q4xbnuwKBFdNDz3u0NORgUQurrMeQfKgek2xYNOQ/s1600-h/2016-06-20_13-53-145.png"><img title="2016-06-20_13-53-14" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2016-06-20_13-53-14" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZnVFR-12GMutOdHYabw7e2B54GVBziUnYg1BRXd5xuOETeybDKyp4mpfO1tqS6nVPXH1nye1kx4GlhJjyvpilu61aV2A5vRK-XWypVN3NSOzTHggJUwPNL0rDZdcnA8ma2crnvSwKyj4/?imgmax=800" width="787" height="525"></a> </li></ol> </li>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com7tag:blogger.com,1999:blog-4535447606986422873.post-82132153542306599232016-06-20T18:44:00.003-07:002016-06-21T22:04:37.744-07:00CRM and Azure Service Bus Integration Part 1I am writing a series of blog posts to look at different ways to integrate CRM and Service Bus. Most of the contents/code I will cover in this series is available on the MSDN site and in the CRM SDK. There is a lot of information on the internet regarding CRM and Service Bus integration but it is scattered everywhere. I am trying to create a beginners guide for the integration.<br />
<h2>
Prerequisite</h2>
You have to have knowledge of CRM <a href="https://msdn.microsoft.com/en-us/library/gg328490.aspx"><strong>Plugins</strong></a> and <a href="https://msdn.microsoft.com/en-au/library/gg309745.aspx"><strong>Workflow Assemblies</strong></a> to understand integration discussed in this blog. The blog will refer to IpluginExecutionContext, which will be <span style="color: black;">posted </span>to the Service Bus as a part of the integration. In short, the IpluginExecutionContext defines the contextual information passed to a plugin at runtime. It contains the information about the runtime environment that the plug-in is executing in, information related to the execution pipeline, and entity business information.<br />
<h2>
Common Integration Scenario</h2>
The most common scenario for this integration is to post the CRM data to Service Bus, to be used by the line of business (LOB) applications. The integration uses the data context available in Plugins and custom workflow assemblies, that will be <span style="color: black;">posted </span>to the Service Bus and Microsoft Azure Service Bus “CRM aware” solutions can listen and read the data from Service Bus and integrate with the other LOB applications.<br />
<h2>
How does it work</h2>
Dynamics CRM provides the functionality to create the service end points that connect CRM and Azure Service Bus. These service endpoints are the contracts between CRM and Service Bus that defines the handling and security of the messages. Registering a service endpoint in CRM is exactly like registering a new plugin assembly. Once the service endpoints are registered, you have to register the plugin ‘step’/steps in the event execution pipeline. <br />
Once these steps are initiated (when a record is created or updated etc.) by the user, workflow or custom application, the service endpoint notification service notifies the Asynchronous service to post the data context to Service Bus, based on your registered step. Each post is performed by the system job of the Asynchronous service and the status of each job can be checked using the <strong>System Jobs</strong> view in CRM. If the listener or endpoint is not available then the message won’t be posted to the bus. The Asynchronous bus will keep trying to post these messages to Service Bus<br />
The following diagram from Microsoft describes the physical elements of the integration<br />
<img src="https://i-msdn.sec.s-msft.com/dynimg/IC755477.jpeg" /><br />
The sequence of events are as follows:<br />
<ol>
<li> A listener application is registered on a Microsoft Azure Service Bus solution endpoint and begins actively listening for the Microsoft Dynamics CRM remote execution context on Service Bus.<br />
<li> A user performs some operation in Microsoft Dynamics CRM that triggers the execution of the registered OOB plug-in or a custom Azure-aware plug-in. The plug-in initiates a post, through an asynchronous service system job of the current request data context to Service Bus.<br />
<li> The claims posted by Microsoft Dynamics CRM are authenticated. Service Bus then relays the remote execution context to the listener. The listener processes the context information and performs some business-related tasks with that information. Service Bus notifies the asynchronous service of a successful post and sets the related system job to a completed status.</li>
</li>
</li>
</ol>
<h2>
Contract Types</h2>
The service endpoints support the following types of contracts. Most of the definitions in this section come from Microsoft’s documentation.<br />
<ul>
<li><strong>Queue </strong><br />A queue contract provides a message queue in the cloud. With a queue contract, a listener doesn’t have to be actively listening for messages on the endpoint. For queues, there is a destructive read and a non-destructive read. A destructive read reads an available message from the queue and the message is removed. A non-destructive read doesn’t remove a message from the queue. It does not require an active listener.
<li><strong>One way</strong><br />Requires an active listener on the endpoint, otherwise the post to Service Bus fails.
<li><strong>Two way</strong><br />Similar to a one way listener except it can return a string to the plugin or workflow assembly.
<li><strong>REST</strong><br />Similar to two way listener but on REST endpoints.
<li><strong>Topic</strong><br />Similar to queue except one or more listener can subscribe to receive a message
<li><strong>Event Hub</strong><br />This contract applies to Azure’s Event Hub Solution</li>
</li>
</li>
</li>
</li>
</li>
</ul>
<h2>
</h2>
<h2>
Security</h2>
Service Bus uses <strong>Shared Access Signature (SAS)</strong> or <strong>Microsoft Azure Active Directory Control Service (ACS)</strong> for authentication and authorization.<br />
The support for SAS authorisation is added in CRM Online 2016 Update 1 and CRM 2016 Service Pack 1 (on-premises), Before that, CRM only supported ACS for authentication and authorisation. For further information please check the following link<br />
<a href="https://azure.microsoft.com/en-us/documentation/articles/service-bus-authentication-and-authorization/" title="https://azure.microsoft.com/en-us/documentation/articles/service-bus-authentication-and-authorization/">https://azure.microsoft.com/en-us/documentation/articles/service-bus-authentication-and-authorization/</a><br />
It looks like SAS is the preferred method to work with Service Bus. <br />
Use the SDK Plugin registration tool to configure Microsoft Azure Service Bus issuer, scope, and rules, which allow a listener application to read the Microsoft Dynamics CRM messages posted to the Microsoft Azure Service Bus.<br />
For ACS configuration use the registration tool from SDK v8.1, and for SAS configuration SDK v8.1 or later.<br />
For a CRM Service bus integration walkthrough for one way service contract, check my next blog <a href="http://mscrmshop.blogspot.com.au/2016/06/crm-and-azure-service-bus-integration_20.html" target="_blank">CRM and Azure Service Bus Integration Part 2</a>.<br />
<br />
<b>Note: I am no expert on CRM and Service Bus integration. I am learning myself. Please feel free to correct me if I am writing anything wrong.</b>Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com3tag:blogger.com,1999:blog-4535447606986422873.post-170707104635250072016-06-06T22:49:00.000-07:002016-06-06T23:23:45.406-07:00Auditing Security Roles in CRMIf you are a CRM professional, you would know about the auditing feature of CRM. There are hundreds of blogs that tell you how to enable/disable auditing in CRM. In general, we don’t think about auditing the security roles. How many times have you heard from the customer that they had access to feature<strong> x</strong> yesterday, but they can’t do it now? You have no clue if someone has updated the security role or removed access to a specific role.<br />
Auditing of security roles can provide the answers to all those questions. You can enable the the auditing of the security roles entity by selecting the audit checkbox as shown in the following screenshot.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-YwBSkjulyWZALB3sAqIMz7VpzOPKwBAQUtJvucwgvo0UZcRiQ1fNDXCxUfGncRj7ww_nlHLNQSGOsXFe0bLsxCWOjRCkBnCfIJRxc1F2yWiD18iDsEs_2ufmzKQHkVHlFwF0epnaJXw/s1600-h/2016-06-07_15-32-36%25255B5%25255D.png"><img alt="2016-06-07_15-32-36" border="0" height="542" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2q9G_egtbbTXhaDaTE3TTwf6cZlTqii786IMx_cafpHBWgeuNCEOBLJAer1LZXNqzKyb9sPJE5HyHVEHSBI1rJMAZLafE6zYzFy7oPPtN8m8DPJZKd3kitKW4u-J6XUJpU8vjoAZSmDQ/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-07_15-32-36" width="814" /></a><br />
You can also enable the auditing for the <strong>Field Security Profile </strong>and <strong>Field Permission </strong>entities.<br />
Now auditing is enabled and you can tell when a new security role is created. If a permission is added or updated in the security role, It will tell you when you assign this security role or remove the security role from the the user or the team record. The following screenshot displays the some of the events associated with security role auditing.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFfJggiWs2-beQHPl-x2KzzWQ-fCQEqiAWdu9uOPL6urp0KLAf0fSYeyxBUk-n0DvE6evXnObawmLbxC70xyzA9tivcuePCBSjTZCz4CA4_a9gAlJNn-_DtpH8FyUTlvwfUv5UGTwOfbQ/s1600-h/2016-06-07_15-39-00%25255B4%25255D.png"><img alt="2016-06-07_15-39-00" border="0" height="466" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0iQbFsep6q27WvFCz9M0kIWryc3peNGyWyY8RWCPJ6GREuvoWaoHt30Wqglj_uOMDxQeJRJ7jmVGH5c9z297f3tmQDXiZpZUS44tQ6Mg2J_Zva-_TgdESlBR4RlOLDYw9npnPOujnT5o/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-07_15-39-00" width="821" /></a><br />
In the screenshot above, we can see:<br />
<ul>
<li>A <strong>”Create”</strong> event when a new security role is created.
<li>A <strong>”Add Privileges to Role”</strong> event when new privileges are added to the security role.
<li>A <strong>”Replace Privileges to Role”</strong> event when the privileges are updated to the security role.
<li>A <strong>”Associate Entities”</strong> event when the security role is assigned to a user/team.
<li>A <strong>”Disassociate Entities”</strong> event when the security role is removed from a user/team.</li>
</li>
</li>
</li>
</li>
</ul>
This is very valuable information for the system administrator.Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com0tag:blogger.com,1999:blog-4535447606986422873.post-81329813499799529322016-06-05T20:35:00.000-07:002016-06-06T23:28:38.865-07:00CRM and PowerAppsIn my last blog, I wrote about <a href="http://mscrmshop.blogspot.com.au/2016/05/crm-and-microsoft-flow.html">CRM and Microsoft Flow</a>. While researching for building and registering a custom API for Microsoft Flow, I came across another preview product named Microsoft PowerApps.<br />
<h2>
What is Microsoft PowerApps?</h2>
Microsoft PowerApps is a preview product that enable the users to build custom business mobile/web apps and share those apps with colleagues in no time. The user does not need coding skills to build PowerApps. If you have basic Microsoft Excel skills then you can build an app. Like Microsoft Flow, PowerApps also allows users to connect to cloud apps like SharePoint, CRM Online, Twitter, Google Drive, OneDrive, Office 365 and Custom APIs etc. Microsoft PowerApps and Microsoft Flow work very well together. Both have the same set of prebuilt connections. You can even use Microsoft Flow within PowerApps.<br />
Check the following link to know more about PowerApps.<br />
<a href="https://powerapps.microsoft.com/" title="https://powerapps.microsoft.com">https://powerapps.microsoft.com</a><br />
<h2>
Creating a sample app using CRM Online connection</h2>
PowerApps allow you create an app using: <br />
<ul>
<li>Existing data sources like CRM Online, Salesforce and Twitter etc.
<li>Pre-built templates
<li>A start from scratch</li>
</li>
</li>
</ul>
For this blog, I am creating a PowerApp using a CRMOnline Connection. Here are the steps.<br />
<ol>
<li>Signup for <a href="https://powerapps.microsoft.com/en-us/tutorials/signup-for-powerapps/">PowerApps</a> and install the PowerApps <a href="https://www.microsoft.com/en-us/store/apps/powerapps/9nblggh5z8f3">app</a>.
<li>In PowerApps, Select <span style="font-size: small;"><strong>New >> </strong>“<strong>Create an app from your data</strong>” >> <strong>Dynamics CRMOnline</strong></span>, as shown in the screenshot below.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCaH05Jo_lRk7jMnqrWZwRh6b57kj7ty3DgmYdcy1b8RSUYwt9XaBhyvYG1e95JCDLypp-zCweqnx07ShOLXIeWx1EovzsRsE-fKLOq4YZeCL6UdXxk86BD5zjmCMJt6kX3Si9d36yLGQ/s1600-h/2016-06-01_13-07-4113.png"><strong></strong></a><strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrPeqAt6_W0F22T84oVMah20mYj6V-es3OnhyKm9L0efBk3zeYfeZucQTaAQIGoCqP-IYxEybzoJyiLOjhcwnQDMzJs6lsIKMmQBcmqgLBc7yIdG9H_xyefCSbzmsHjXuQQkcp9LaSiQ8/s1600-h/2016-06-01_13-07-4114.png"><img alt="2016-06-01_13-07-41" border="0" height="475" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitxD88Klj05gcM_JOz6qxjqiyTJfPPU6kePRvdOK8F-aUkCHG6AniJMyfPf5sTL2SS5NfiJEW2YvwaPECF_V2mxvxSUV3ky8qqdycLwbfpjM5gzKVTxyvKlgjA_EOWPwHaGOxXGHldzYw/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-01_13-07-41" width="691" /></a></strong>
<li>Create a new connection to your CRM Online organisation. In my case, I already have connections, as shown in the screenshot. Click on <strong><span style="font-size: small;">HPE (or the dataset for your organisation)</span>.</strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7O7dq9ejDR-rspe_pl9yJ0XfMsZGpd2oW3jSQOyvMUgkzLBb-Zyay31r77cdWwilmYBE7pkKPh_zyXlHwseGVqmEBM5s_iaOeIM7KDsgKbSrCqyYX8UQ9B13h87_sv4hVoLLoXRwzgWY/s1600-h/2016-06-01_13-08-5913.png"><strong><img alt="2016-06-01_13-08-59" border="0" height="331" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYtQT-9txjVOwQ_KXNKdY6seJpV13jEtm_3Yl_zay68NndoY6TAMvA77Qh10NraNSHBz6FVlT046ZgINslPuQIBcM4EbBXHFEjsu7t0YnPpVqE32GvNBG_guHwWmtbUSSNPdcB9bSABr8/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-01_13-08-59" width="690" /></strong></a><br />
<li>Select <strong><span style="font-size: small;">Contacts</span> </strong>from the dropdown<strong> </strong>and click <strong><span style="font-size: small;">Connect,</span> </strong>as shown in the screenshot<strong>.</strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMLoSgcIzfV7ncyQ-nuOSYgHO7dOOz9r4AN2PoFqOITfFA4qAuO8beTc7KKBSi0ufSV8I1QKILiXY0L1eKcCWiJaZ6shn1BRw5FogaqummL0mSZUn4bgZc9oznjYBkcmz5NdzScaJiOrk/s1600-h/2016-06-01_13-11-245.png"><strong><img alt="2016-06-01_13-11-24" border="0" height="382" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW_-lgNWoGCp2RgwxbL0SqSRQz9d1bq_X9bELfM1s-MhXBzujofqZQ9vKtwOckwoDqdj9wX14U6gRalkWZfAke1x3hJx-R9J-HPHqZpXb6wW5crGdJfk_8DM7L7j88RxayCQigdJPASyo/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-01_13-11-24" width="693" /></strong></a><br />
<li>PowerApps will create an app. The app will have 3 Screens: <ul>
<li>BrowseScreen1(Home Page with a list of the contacts and a search box)
<li>DetailScreen1 (Displays the details of the selected item on BrowseScreen1)
<li>EditScreen1(Opens the selected record/new record in edit mode)</li>
</li>
</li>
</ul>
<li>On BrowseScreen1, select the gallery as shown in the screenshot and change the items property to as shown below. It will allow the user to search for a name in Full name in CRM and sort the list based on the last name.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTWtPZiGZLkYVlwXiAjgHk_ywwLcoaT7X7gSD0iyR2Tr_LDCtJocIp7iqslxEK4IRdFpav8MDQIb0NxDk1QTC4kUP0Wykw1vXq00y6n9sdVQrFBrqGZRTJVEq-P9XV4KCM7roM1gY18Q0/s1600-h/2016-06-03_16-53-554.png"><img alt="2016-06-03_16-53-55" border="0" height="484" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhARfD9Mtt7KUhkR3R5i2asoeFSe__JSjXRjkjml4PQ093mfqbjUnt74cXGaap6DqPdHTfLYW9PE9E_xV3dijLa2jVSTHvFWFPt2RGc_p-jQ43-hJZtfTqBpLk_LbuzlbAbyTD4rr6AirM/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-03_16-53-55" width="707" /></a>
<li>Now, select the fields in the first item of the gallery and choose the CRM field you would like to display in that control. Please have a look at the screenshot below.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNDHw3CkX-ahNfj1yMdvHoedhhpCkddynK2WYP3rzdy_aEEd70zdkFf0dc8hw5Rv8H0NP7DbzJRL7fm_MXDaNcYyp3yh_zxGxqFYfBz51XxaIIPkLieYERFDf8HL8HZ85ZoVigNzhOk4A/s1600-h/2016-06-01_13-19-464.png"><img alt="2016-06-01_13-19-46" border="0" height="449" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFfhDKfAs2qfVEOGfj_Wj-GmVk7Re2HieGdtX9u6UR-wl-FH1G_ayS9RYM26JYID0X_iAP-KqPlIRjWDDdqbG_IonJ75azAlrs9efwYx7ec5mP7XkIWnSshzsprCg00HHya0seS5XYgKA/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-01_13-19-46" width="717" /></a>
<li>Select DetailScreen1. Select any field on the Details screen. It will display all the fields on the screen in the options pane as shown in the screenshot. Click on the purple eye in the options pane to add or remove the fields on the form.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGOeaVYquYpZdcH2GIXPD83-DSw_8HeworVQVnX97RHDW5s1UUfEE-pQFfEBLzUKQAQt7RPmZk42WexTWvar8DKGDHRUcKyeuhYlVvo9PE4ViyoKF42NNB0lI6vDPauqZusiZcHcDZBnA/s1600-h/2016-06-03_22-52-535.png"><img alt="2016-06-03_22-52-53" border="0" height="545" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIKAvXnSR_tUxWN5IwIUVF9sE9rcGyuRDGlk2Rz2TPOvQQmCIt318gLXFpVpME0MGji98xEQC9PPQtAQAMZBTa-SG0IF8hCXUkLQYKywXg6uQKw3Psb3vuCbyiPtY_-GRMVlwkmv6Bjp0/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-03_22-52-53" width="721" /></a>
<li>Select EditScreen1. Use the options pane to add and remove the fields on EditScreen1 as explained in step 8 above.
<li>For this app, I wanted to add a camera feature. Click on <strong><span style="font-size: small;">New Screen</span>. </strong>Rename the screen to CameraScreen1.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu9jqilWL5fjfQpEJDUuIs12h9HOyM2oHlPy4pbg6x25uK0Z5vNUhgYl0WDuGHdL73BalFpoZ1tmNWgc7pdLoRf72QRvv_xlKXcZWben6C-jaZ6000H56C-FREvtB8wYHXvaySxEZHbIs/s1600-h/2016-06-06_11-24-23%25255B4%25255D.png"><img alt="2016-06-06_11-24-23" border="0" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXe7Aq_mjV9-Pg4NbK6RQaoQ9IjU5Lkt5ZYFMlpDr5rBl-uwSvz_10sZlFQWib_byB6JdNPH3RUWIexUpcySvyC-Yl-Ug5O_8cTH8zE5S1UPzdHJU9w9BXrbfAk1Gv35ylKrbXdCkYpQk/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_11-24-23" width="322" /></a><br />
<li>Add the camera control to CameraScreen1, as shown in the screenshot. Add the camera control to the screen, as shown in the screenshot.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtPFVN9VQKyZAiEGOz4V2Y7MGgqL4fdd1AHHd1joZ2VFLjIY_uUwIFZ5fHKJ7bEzOyM8lNjnMa1F8LrhdfN-jRwaWxbyEF_4QnlkX-xm375uMDxE-gSybIhtpWrNTAjOWrK-VciupxVkg/s1600-h/2016-06-06_11-50-02%25255B4%25255D.png"><img alt="2016-06-06_11-50-02" border="0" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKCgEMhabA0HRNJq51FU9wtYlNOXxLgQd8rpHF_ES7NCSSNBu_voouIL1sRi0CbVijwnTdNdt90KQB04QZMEIHrL7WRjE6olCyqxC-rWlO5YupFdX-GmCrYD6OMt4QG1hTiJXHwh-8waI/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_11-50-02" width="614" /></a>
<li>Rename the camera control to MyCamera.
<li>Set the <strong><span style="font-size: small;">OnSelect</span></strong> property of MyCamera to <strong><span style="font-size: small;">Back()</span></strong>.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjibPur76nCazvaEWQ50qZWffokIcq0-wS8I76hYw0qNTESbjoBEvswHWTei9nJGGQKIK2KuN2Nspw41iBsA-v2LVWAdYABdUGSPzkO9pI8yZ7iNhVIc3gY8nCaSeZcd0TOxppQX70leBg/s1600-h/2016-06-06_11-53-56%25255B4%25255D.png"><img alt="2016-06-06_11-53-56" border="0" height="51" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAIgdaEGMjDH-Pxdi58m6d97-zuunFsmwDh-ZJJ4r7hkKjmtQrw3hz7Bg5m2mv6mA_kvh_IGzd07I9GRml38oBI2rht3kKOEImfzycykr4HbPJJgdpki0I-8nOEb8_2AzaX4kXT-kT8sY/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_11-53-56" width="450" /></a><br />
<li>Select EditScreen1 and select the entityimage field from the options pane.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir58PZtRyBs2d8-bQi6-sNeQAAJN5LkVGTBJZjBwIplkJXd7ZtoAF4oxpvWVm8HmhdVo1JcuLtd3nFXkNOt42VdoArFGWRku1S9yALURGQGuvnXXdNl_cKzaMpbXXN8n9DZJ5ro9oyo0o/s1600-h/2016-06-06_12-01-08%25255B4%25255D.png"><img alt="2016-06-06_12-01-08" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB9XD7bXQK5ViLR6aCicNiRzi4r3tsGkDHuSrXURg6SsKXQ_so2wPeq29CxD-YirZvfQChHUA6He_Hh7ZlbbVKrJJn_AJzl888R86JLt_v2vhi943sUyfDILALf1K1qHvHX8PpezwfLSk/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_12-01-08" width="371" /></a>
<li>Select the menu represented by 3 dots to go to the Advanced options.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3udUc0hEI0q871X8fZCqcQkNzLhisoz6vC0uIK_c5MJYJAhP7k-8VRwStGcIK52L_xBdQ-xgja62TxonVIQyG2Ef1v1vkIURYCs6uaY4LoQdYd8a2ZHKnmqgIHl2yv2n1fj-yJCJMSmE/s1600-h/2016-06-06_11-08-00%25255B14%25255D.png"><img alt="2016-06-06_11-08-00" border="0" height="85" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijEKZJ43EZryh6H9m3N_550q90ncq7sSM6qehtrwSS9KgRMw85qVeilKqQ4ubwWSJq51TKwaVQw4deb0rI2QPJTcjkUH6V7x9UpRYth4_BjG61HHLUyydnuIEkQbHVM5ZP4EB4NDgpPL8/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_11-08-00" width="317" /></a>
<li>Change the ImageX.Image property to <span style="color: #222222;"><strong><span style="font-size: small;">If((photos=true), MyCamera.Photo,Parent.Default),</span> </strong>as shown in the screenshot.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBGXt5tlNeT-wrNAMArzV8Gxk4XlUTvlti6tmpD-cnL5C7YGS3ITZUnuajxFomccGHiQuh20E3cFae-Pa3zRiE5z4eakCMF9WdxP2_xHtgyk7U7MszA2PeFO4leTrRWXLuR6IUGZvotdg/s1600-h/2016-06-06_12-04-28%25255B5%25255D.png"><img alt="2016-06-06_12-04-28" border="0" height="479" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuuAiXxTv-hBe9GYq18iP1DlTb0ugUaF6vq3O_TWBPLV_4fMuvAr0LZX6exDE0tQngNSYoVuhsRmZ4nw26gORdmRWAqJmbG3q3YfdhWBAHEsgaudE3za08-CxG4e0UL-a8sTR7RqLjSe8/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_12-04-28" width="380" /></a><br />This will the set the image property of the control to MyCamera.Photo when the value of the <strong><span style="font-size: small;">photos</span> </strong>variable is true, else leave the value to default.</span>
<li><span style="color: #222222;">Also set the visibility property of the entityimage control to <strong><span style="font-size: small;">If((photos=true),true,false).</span></strong><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigHqRf2QcBNDa1pFLnQAzAwN2nBNSHsYolZKrSAHqEwNK9VgQMchKwSKgnNr8ygDJW7e2nVZtN4DT8I2lvhyvTVOgDq1u4SJJbwXPTeWRikOcEC-5_Eph_vGEHx6plB8qxAMbtLNULHuk/s1600-h/2016-06-06_12-09-55%25255B4%25255D.png"><img alt="2016-06-06_12-09-55" border="0" height="56" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYqpJxvPLzfEOMFRoZHo-2hzC3u2kocY8xoO-rswpyKpB6nO5Mcmb8VVKTTUk-TqEarisms0LY4jKVPCGNy7Nzfnp96fAfsqoxyv0KpIeSzmHbRG_schZ0i0wxuWRdPVwb5-kGyluEndk/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_12-09-55" width="511" /></a><br />It will display the entity image only when the value of <strong><span style="font-size: small;">photos</span> </strong>variable is true.</span>
<li><span style="color: #222222;">Now add the camera icon next to the save button on EditScreen1 as shown.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-AaS2HkApZP6Bci-4JIowXEKIoYtYk8uOnOzIEU9hLQr2Vm2XdTEJS3N8uciVUfYkMviypzt714ZmGMEo2yxR-xjAWUCBuliwKOXAPEQ1kOK5kzG3VAqMutA0Potzegh753R_SXdTJ1M/s1600-h/2016-06-06_12-14-44%25255B5%25255D.png"><img alt="2016-06-06_12-14-44" border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKnmvtC6EKNZjaih7wDpCW1JE-rgMzXZBX8e7V6TGZ_z2mGZ34Uer1ri0mCHLFjMGmLME6tkKKY1qho8fg1knmab54E70lPJG6k-0ykzboiQM-zXlt3nBG3BpTHmM254UjQvkZWks-8g8/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_12-14-44" width="629" /></a></span>
<li><span style="color: #222222;">Set the <strong><span style="font-size: small;">OnSelect</span> </strong>property of the icon to<strong> <span style="font-size: small;">Navigate(CameraScreen1,ScreenTransition.Cover);UpdateContext({photos:true}).</span> W</strong>hen the user clicks on the camera icon it will take the user to the camera screen and set the value of the photo’s variable to true. The picture will be displayed in the entityimage field added in step 14.</span>
<li>Select DetailScreen1. Change the <strong><span style="font-size: small;">OnSelect</span> </strong>property of the edit button to <strong><span style="font-size: small;">Navigate(EditScreen1, ScreenTransition.None,{photos:false}).</span> </strong>On select of the edit button, the screen will navigate to EditScreen1 and set the value of the photo’s variable to false. This means EditScreen1 will not display the entityimage control unless the camera button is clicked.
<li><span style="color: #222222;">Save your app. It will add your app to PowerApps and be available to run on your phone and computer.</span></li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</ol>
<h2>
Testing the App</h2>
<ul>
<li>To test this app on iPhone or android, you will need to install the Powerapps app on your phone.
<li>When you start the app, it will display the list of contacts. The user can search for a contact by typing the name in the search box. Click the right arrow to go to the details screen.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCylQGmXjAiaR_flNhI8yhHDK1qclNpETVJC2yyBG_lRtZpbltabu5XOnOrBVt8CrAjI5jy2QxRR4bzOpShafLhHerQWgHUtpkWfO_urIMi_uoSE5g8YSMqNQXJM6dpTbBjjMJBIdajnw/s1600-h/2016-06-06_13-05-04%25255B5%25255D.png"><img alt="2016-06-06_13-05-04" border="0" height="466" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjceEUUKJGSWSp8rVhonERqdBUPo1dBNELq8Gi4ONedhg3VmQGiZqN-xZQmECHHnkUwiyxA44xjTdvEJDSH0XLgYMe7c0sb_n5bfYKh7iSum0EBvIIP4UMMnURQ-i0ceSiOpNMoswfip0/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_13-05-04" width="366" /></a>
<li>Click on the edit icon to edit the record.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-fTtR0Wq-10vRvF9tL301D1ZgsPyj63L4Y3wKGIQXAA7y8SJLk7rrPLlasW-URYTabAghIbXa5RJTmuwmk5cGm5T8hntzJ4ceqQG_sUHzxX6ZL1rqh6LuVZHNxWNI24axNnsY3AJ5wAg/s1600-h/2016-06-06_13-09-27%25255B4%25255D.png"><img alt="2016-06-06_13-09-27" border="0" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVgzD3j55MH7n3ewfEnGFujh6W5Fkn6r2x-NbxyjPNvI00TH7FyL2lXYfxlR9z2uttwiYwPyIjUaMsTw7mwLcuEKlibS-aMsvS97X8h-pBl4R5-Zsx5TpMrGb5Kf3N0tL498xyWIceWq8/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_13-09-27" width="371" /></a>
<li>The user can edit the details by changing the values on the edit screen. Click on the camera to add a picture.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz7ewp55eNzrU6bskZy6Ha-D5Q9Dftsi-ZBQWsfnd3L86Cpyg8vTCC7jbjsqBmBliFXUN-8FiRuo95AEKEE5_iQDuQ_FB3zdCRl63-HzrTTbhRiHxJqEITwJvnnHLfA2p4CloDf2KGfo0/s1600-h/2016-06-06_13-11-10%25255B4%25255D.png"><img alt="2016-06-06_13-11-10" border="0" height="425" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5bhl2R9mAYrUGl465cXw-hrSxcheo2pFEbfyp0fZojVUtbTmp17Jc2o_th4DJHe1p8G9LOdy_yghx80dh0USmHtgzygU-DZuDJbclJTIMWWJv5cePHHq2FYPRfWeBktrl0EK1NFIDNFY/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_13-11-10" width="377" /></a>
<li>Click anywhere on the camera to take the picture.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPvBjfKxsc9wNtuYy1iXlkursVNA1HinBJPK9oVKqzRON6rjECHnKJ7qG0iNo7XG15IQ7zizjpeZqzJEvj-cZAhjHBH2bnrtlwp4QR0Sy6awo0NHEK9yaZxAoROQPWAePVlKbiuMeOflg/s1600-h/2016-06-06_13-12-54%25255B4%25255D.png"><img alt="2016-06-06_13-12-54" border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTYznnNxfcm7hju6iLB-jKiqr3CIBBea7pgSUT9jnyvHmv7OUjaV0qFC_0r6qXXr3gn3hvJ4x4EW0oTTqDq3CyuQd5CKSEIZVVWY-boJ7XPaq4XrTCYzgSc40CpihLTCLrCkXwI8ZF8XE/?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_13-12-54" width="287" /></a>
<li>The app will take you back to the editscreen1 and display the picture as shown in the screenshot.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUxdbcfi9IFJpdOr6tL2Ut9uaTCrLx36yzAKpKTCZXYAIQMYnXhqDpw03sjYU633GOrn-VKQ9A9ogHy4FQxmC8_rGsFp3ec7eXxgqnsYBF5BdCYDZ0ZC2EcJZWu5kx6ife5rJkkZC64iU/s1600-h/2016-06-06_13-15-48%25255B6%25255D.png"><img alt="2016-06-06_13-15-48" border="0" height="622" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0Lu1pcgdu0aeizB_XCHUOVDyfNF3iQGBEM0jr6SfWTvB1jLsjGnI_7h-GW95TLmELHLvToMB6exs8ix9qsQ1ApdFRuvu6hDiv3nNWWMjZdqpEcGHoHg-ZF7yZcZNmnclIeg2YJalIhv0/?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-06-06_13-15-48" width="357" /></a>
<li>The app will save the record in CRM. Open the record in CRM and check if the image is updated.</li>
</li>
</li>
</li>
</li>
</li>
</li>
</ul>
<h2>
A few things that did not work for me</h2>
I am very new to Powerapps. There are a few things I have noticed that does not work well.<br />
<ul>
<li>For the CRM Online connection, If the record has a lookup field, the record will return the guid and object type, but not the name field of the lookup record.
<li>Could not figure out how to display the CRM entity image in the app
<li>The Add Picture control does not display the camera roll on iPhone. It will always display the iCloud option to choose a picture.</li>
</li>
</li>
</ul>
<br />
<br /><br /><br />
<span style="color: #222222;"> </span><br />
Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com13tag:blogger.com,1999:blog-4535447606986422873.post-12785104831439180102016-05-29T21:23:00.000-07:002016-05-30T20:47:39.664-07:00CRM and Microsoft FlowThis blog is about the new Microsoft Product named Microsoft Flow. A few days ago my colleague told me about Microsoft Flow and my initial reaction was wow, that is cool. <br />
<h2>
What is Microsoft Flow?</h2>
It is preview product that helps you setup automated workflows between different apps. It can create records, sync files and get notifications etc.. There are a lot of templates available. It supports a wide collection of applications like CRM online, SharePoint Online, Office 365, OneDrive, Twitter, Facebook, Dropbox and even Salesforce and many more.<br />
Check the following link for more information and templates. <br />
<a href="https://flow.microsoft.com/en-us/" title="https://flow.microsoft.com/en-us/">https://flow.microsoft.com/en-us/</a><br />
<h2>
Setting up a CRM and Twitter integration workflow using Microsoft Flow</h2>
As a CRM guy, I wanted to test some of the CRM templates. There are 7 sample templates available for CRM. I tried the <b>"Create Dynamics Leads based on tweets”</b> template. <br />
Here are all the steps.<br />
<li>Go to <a href="https://flow.microsoft.com/en-us/" title="https://flow.microsoft.com/en-us/">https://flow.microsoft.com/en-us/</a>
<li>Search for CRM templates and choose <strong>Create Dynamics Leads based on tweets</strong>.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi01ND_H2gR5kq-SfJkQd33Dn1tmH8b4zzAUKXSIaGpjcNlbtDirE5sfZzLRFJTTjKfBBEALI9tZS0JA8PdfACBwx60Iz9X6FhVSnBn5rwNAVXG_5yonFrHopoOM2Lx9M_pXGAADd1uxtk/s1600-h/2016-05-30_10-47-11%25255B5%25255D.png"><img alt="2016-05-30_10-47-11" border="0" height="368" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisH_utbqaBK-91ICK-D7V3pSHUtwuEoQfiGuNIKrockym2GM6tz7QIufLvew6xlQGg_dSKesF0nNanyV7HN6xx05KPl2uf0XeO1qAo9z36sbDKLtVxUnFYXNbiD6wQ_cJ-qv4dKyP0rM4/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_10-47-11" width="395" /></a>
<li>The template will display the permission(login) screen for Twitter and CRM and add the connection details and click <strong>Continue.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUjdJHVGZb_0DeQjTN4ZVISjyKE_sdb8_JVvb_MbKg71GEv_EtcZjTbNZ4RlHaUqDpNwMIx-xltOlBplcy42J4CX2YwoC8eduBrkxW4CgGAGwlGwspm8G-KuAmrhgI6ZcwjIkVksLhaFY/s1600-h/2016-05-30_11-02-26%25255B4%25255D.png"><img alt="2016-05-30_11-02-26" border="0" height="313" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3TA6gua6DER5u8rM1QEzNMKCGlqlNg5CJBprhFfutzclG8UQdKEqaoi1_VTCiU1DMl7gc_bIiK17KXGvm0FZ6oBs6Yr5gVfb07x8AhqAYalGNwNo3Y0lZofq6iGRdy8A4WHmjrrDfpi0/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_11-02-26" width="507" /></a></strong>
<li>The template will display the details of the workflow. It has 3 main parts as shown in the screenshot.<b><br /></b><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWFY4X8TvYIsR52sfg01IWXMNkWcXWhzNV216IqqJ6EIrjJNQECVYk3ZzCxYQNSD1FbSGuBFZ8OX1J_yVyA-SX8z8TmL1BMqUnA7GAc4o8cVpJSozJH8SasUMvadGNkgyzO4yXyHVIRbQ/s1600-h/2016-05-30_11-06-04%25255B4%25255D.png"><img alt="2016-05-30_11-06-04" border="0" height="357" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7yAe6gtiArri-ECP7ZzThuBVHdmDm4Ua7cJc98kzbvZHa0pVaSF1XBsJjonMf-R5bFqMZirpGvS4iDK-cI3VlJHiRjFQeheS3D-3gFNPiF8EQkC7NR5k5ju65lml32G5_14hbrMMjgcc/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_11-06-04" width="522" /></a>
<li>In the first part, add the query text to look for in new tweets.I have used CreateCRMLead.<b><br /></b><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5e2gvQx9JvQdyDevarJNF5Q57tXD96YMJ2QvDboGdEUDcHXSPicUcnnvPRYJ0U_6Bra5uUf2HKo6UXnXFbweCOcLvLIHuT0R7H0EmBEpxIQ57BqEYdsgC5Yj7J31EGpeJZwLYQV_FeQ0/s1600-h/2016-05-30_13-37-05%25255B4%25255D.png"><img alt="2016-05-30_13-37-05" border="0" height="538" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7-1JYyU3vY6dqBXr9Q7rqz3YsbLNanCkIY9MI9VGt6o9guyMrdJcJhN7RdKm0ohQgXTv9kOd9ssI-qk04zUr248E-k7FrQ9PdSaVAd8PJNcCU-ur4A6eBaD4i93GsFrRdRSCN0cpFXhM/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_13-37-05" width="538" /></a>
<li><strong></strong>We don’t have to change anything in the second step. The <strong>Get User </strong>steps is shown in the following screenshot.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZLKTDDlWoXTexmHMqXxh28wItkqr6kGc-TlVotxbwbaAwpgdqns3Qg5aZS2L4iiV24X5GuC7gjk3yJoVyHSl5KMq76X6KW13hF4FdaOvHhOzHHkyDyg4IldsD6Hi6IUtkulLSIRirT94/s1600-h/2016-05-30_11-07-08%25255B5%25255D.png"><img alt="2016-05-30_11-07-08" border="0" height="631" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_S5x38fopO1LOMW_nUViczOqEN4FYJ5z2vhUeFFuborwbbf_snliX5J3LBDn0tQu0tuPDY7Xu9pgr6GyuBuUoKWIrvlGpb-mMyEry79hvnudodm4lZ3VyX0aQMe-BdnpsAG_u0chrxeE/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_11-07-08" width="538" /></a>
<li>In the next step, change the organisation name to your organisation name and click <strong>Create Flow<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimUxikbOJJl4nUqsmbsUgzPqQBctv3UJqq_B58oENAaqMN3N5hrxYttyztjlOk-I02tJVYlcfhOufrpkqvxQmqNz9SUhQBjFhQXvEa7vuenuIC19ojVIBP7rXtFK2Qpq3t6AFA1aMJEKQ/s1600-h/2016-05-30_11-08-34%25255B14%25255D.png"><img alt="2016-05-30_11-08-34" border="0" height="581" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdX3IrwPlx1jVVS0PXPBRU0CGSgNupeoZ7G_rBRlJ4c8hBl3zTJKJzzu97GGZcOhpfIah1isvtwy9mVhO413iKdoD5bUO_3VgqpVCV8ZSQ69A5h2Pi8JNuH82a3UrsAq_KeRlbc_bfgqs/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_11-08-34" width="610" /></a></strong>
<li>The wizard will display the Done button on next screen.<b><br /></b><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVghz8Tgr2Sr0BhncpkiGlk9ZDxaTVVso4AanIcVDmtjDV0oxY9bG1-13coXYyEa_Qd8Y3lDD7CWRUEfJ0bxGwA4bPcCjowO6NhAz-I_Y9CmN6ydVDGuGDPuDGjAPqclvu479shywB7mQ/s1600-h/2016-05-30_11-09-22%25255B9%25255D.png"><img alt="2016-05-30_11-09-22" border="0" height="63" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip8zn8sQvKt16bKtydMvk8CvErhLjSQQRnaqvcBQ8mqBncLl2KNsil95YRCqC0y-ROGX6vMQJygHO2znjfZLuRfoe8fr9W1qUEvrTQJ6F13cfn5jz3s7R88qtyRUMdR1E2_2blW1tKmoo/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_11-09-22" width="640" /></a>
<li>You can see your workflow under “My Workflows” as shown in the screenshot.<b><br /></b><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwtL1WndRCQfjViGcY3N3fjxjsvBFgjN-P-isvupG_6gU991v5LadFSAx8cvXGi0rFzYyzCd-8E2WzGDJ7CG4jbqjhqAdl23ejkmeYKTTlcTm6Z3CPywqGN8uv9HTm_K4slcrp3q48asQ/s1600-h/2016-05-30_11-09-46%25255B4%25255D.png"><img alt="2016-05-30_11-09-46" border="0" height="123" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqabFKKGBf2_768NBWY3VZJxOcFvpN3-ss4hLTOJutcwK0FM-HmzKsGoVTN5e0XGATlvSVBTpme0c8apACoTMuqEWq7LkDof1ji43Wn_xsxF0Rv5bFn7dB4V93pcLtXk49YKOXc14ST1k/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_11-09-46" width="648" /></a> <br /> <h2>
Testing the workflow</h2>
<li>Logon to your twitter account and tweet with the word CreateCRMLead (or whatever query text you used above) in it.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS2dL7U2y5pvDOJLXpRP7UOYblQ7OKNnruwieZsQngJ-UQMWfq7dAYMPT8Nvqj8sOdOADMk4YJrmURncZQtlIP5DEJr11CwgZfy1xJ_ULPf01PWIY3qlbXhFoNZ7wupnmoaXpEbtBm9fA/s1600-h/2016-05-30_11-35-33%25255B5%25255D.png"><img alt="2016-05-30_11-35-33" border="0" height="67" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHyzKag743xvy6uSrs4fu50AbjB1KmCUs4J3Wg4KqkwKCgZ_DoHUOVvZee7XUNfnkIh6CLY9rYbY73tq_in1M0ukpSYGCGEfP5-Wq0f9xAoFqqx-3_teto_iCiCx18VyTHOWYgC5Boa7U/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_11-35-33" width="330" /></a>
<li>Check in the CRM after a few seconds, there will be a new lead as shown in the screenshot.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI6Jt0rvOR3ZJiA3ZWQPHCKcIyoBRSTqRGaK-0yAHvtFkUuWW8_6V-WMPIax4NX5eC6kztKdKR7dL62fLkYERi3-HBqszlz3kReMFxOpzeB1qa__I8t7jADuzq43sH2wbB_KfJDnstFbM/s1600-h/2016-05-30_11-38-44%25255B4%25255D.png"><img alt="2016-05-30_11-38-44" border="0" height="309" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinELknwbJiPtFIBzP0tOtoe5Hp_-yncTT3PGeU6hzFovVKkAei3ykkv35nEOyEThdt0cb7DenaIpgG00PYJQymu76c_MumBHFtbvcmoFLzBrjw9eAiOpgvKmn3TIkhWy5B5puQ83agOFA/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_11-38-44" width="660" /></a><br />It will also add some more information in the description field of the lead.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoOHVXY7fUmcFmvdBz2WnorjFgHwBuhaSiywYeQ2pWA4CjvSMJubmdIJKM7MeYES_fMncGFbSV_vIaUyOPve7tSNlkCqa10_679zFgCMKJXeZuRbYW9mwMaS2_lx_O5Ix5ybr2RdN1JwE/s1600-h/2016-05-30_11-39-10%25255B3%25255D.png"><img alt="2016-05-30_11-39-10" border="0" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNdjKCj7S9pY1-8mIq9uqsNytA-MNbHR5VaWElMubbDQ44C1zvUDdwuXETrtgzciEmWBmk__H3x79Cqf42sbuUT1kZKoJHEdn2fzXoClRVfMIwicc3vA1OtLa3QOPYIj_aK5YG7p8AKb4/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_11-39-10" width="458" /></a><br /><br /><br /> <h2>
Monitoring the workflow</h2>
You can check the how your workflow is performing from the Microsoft Flow site as shown in the screenshot by clicking on “I” next to the workflow.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbtJuucBrIao3OP6kvI2ydY1SW8bpmrhWZuUHVZXQCo3ggNLY4g_XkeTssN3-hOckTq_Daw3AxoqXQ0pX8YPQQ4FCkYJnE4JeMXvf6CejnkqtonnIUJ6uGjYE7AxxiDEzyZh_2gJlEGJs/s1600-h/2016-05-30_14-08-14%25255B4%25255D.png"><img alt="2016-05-30_14-08-14" border="0" height="177" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLCB5lVrInTlgzxUXjKv32gbpKK9e5ax-yfziqjOeaF18yACgT1aEgFR44xgmASdc8_FI_HGCxlc1HZ8PTecJq_Z5BfAdg2NifYPePJ5_ukEtgsUkZ3Tt1A5u2FYbtw4iEoD2BlL9_ws4/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2016-05-30_14-08-14" width="753" /></a> </li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com0tag:blogger.com,1999:blog-4535447606986422873.post-17153655330940413552016-05-26T18:52:00.000-07:002016-05-26T19:11:16.795-07:00Email Signatures in CRM2016<p>CRM2016 Update 1 has introduced email signatures in CRM2016. It is very important if you are using CRM web clients. In the past, CRM users used to copy paste their signatures into CRM emails or used email templates for signatures. <p>Now you have an option to create one or more personal email signatures. <ol> <li>Go to personal options as shown in the screenshot.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmF0oF0qtRmHo4iWRYuBmNPvJa-MPv3YB-Apn8Q6zvRhG4zMK9qq8dbG7zzh11sapcqRXFQM93toUVLOT1Vj48ffR1R5yeH7_qklXzME_RQJ6sXC_hZY359x4PlxHd_9El631HP2mdQMI/s1600-h/2016-05-26_16-21-12_thumb2%25255B7%25255D.png"><img title="2016-05-26_16-21-12_thumb2" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="2016-05-26_16-21-12_thumb2" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvoHvsNxd0BZDsGKeVtGISxVhnjhXa2mAbbPlXcQz1dsUD5VvkiRuursDcIxcqNsU_3eLXF2vkAl0UQdDpAiawKgDzz-6PY9U6aSYX9IXxMtMlorpPcYeHkSbzMa1Rtl32JCJ3wEXgUX8/?imgmax=800" width="483" height="269"></a><br> <li>Navigate to the<strong> Email Signatures</strong> tab and press New.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrQfr22h8Ysl_HGaxKoc2KxU0Xixvn8Qrag_H-p8q1ZER-f4QWfyPay6054H03Y_YXjYACBDwOvP-tpKjtx0Me8cGaVhef1TxiOOaA-7yqpRfdhapjJPcIAUbI3cZUlxN384vypKu0feQ/s1600-h/2016-05-26_16-23-37_thumb3%25255B8%25255D.png"><img title="2016-05-26_16-23-37_thumb3" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="2016-05-26_16-23-37_thumb3" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwNnGvSKCWdpb6UgQWzya-tXmt-7a5hFt0w4t9AuRMz9ad1uhYVRExTtoQSXHmtxjvSKf_pyNxtbdn_MLY1Nx-bs8ow0D2BL6bCutCG-IgXs2RltidCHTDX-l_RP8ihyphenhyphenhYFOzokI6unmQ/?imgmax=800" width="658" height="253"></a><br> <li>Enter your email signature and press save.<br><br><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz2Eg3qcRIOQTwmXpqpgtuK-B4uSoM1bNIztsjBYsAzgn1jlcvrVdRWBnWMSe7njvUz_MjngpV7tZAvGwxKBK812JH2nDirNMt5GWsgeYLAhmGI6hyexGJs9S_HG7CqWLHWk6TSCRsWz4/s1600-h/2016-05-26_16-25-52_thumb5%25255B8%25255D.png"><img title="2016-05-26_16-25-52_thumb5" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="2016-05-26_16-25-52_thumb5" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO93kaLBpu21Tf-1ZkHqwGjcKgOd6fonv3p9RrcWU6l7TZ_M44EaVBI3cQx-ZVoU3bl26QcVSW6Ax4XxT9BkiOGaqL2CYg1gyTxdipoDW7ZTkBl_FkHT7_gm3gZ5kTSSLY6vAwXWE81ss/?imgmax=800" width="658" height="523"></a> <li>You have an option to set the email signature as the default by clicking on the <strong>Set as Default </strong>button. </li></ol> <h2>Testing the email signatures</h2> <p>Create a new email activity and your default email signature will appear automatically. <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1_o30FkfX4gRgTIGYDMIAcicMqbaQIWZ5_lmj8CPEm7mA1g_Dfi_hElgl6WdgojkRJ8OUcfhb2UQWmG7PIfv7sswSu1DZNnKZFIe0vEIzvbQpHd_p2Vo3cjvq25g7_ww4738KBp1BAyM/s1600-h/2016-05-26_16-36-22_thumb5%25255B8%25255D.png"><img title="2016-05-26_16-36-22_thumb5" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="2016-05-26_16-36-22_thumb5" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCCgYkKQotUtuNjchA4Gt9lJBjcgptknZN5zCWEFPLjfHj3sjEMEzmLF2jkN5o0GieTVc4PHnZQmaNQ8upmNPuni8CwHuWoQ9Q2t0o09CYMdV8-FjHdztIdZ9Z2Enenlrw3HfhJL156uI/?imgmax=800" width="691" height="666"></a> <p>There is also a button available ‘Insert Signature’, which adds the signature manually or replaces the default signature. These buttons are highlighted in yellow in the above screenshot. <p><strong>Note:</strong> <strong>The embedded images in the email signature will not appear in the email unless they are hosted on the internet.</strong> <p>So here you go. Now you have email signatures in CRM2016. Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com5tag:blogger.com,1999:blog-4535447606986422873.post-44116029326998543712016-05-25T19:28:00.000-07:002016-05-25T23:13:14.244-07:00Response Routing Rules in Voice of the Customer’s surveys in CRM2016In this blog, we will explore the response routings functionality of the CRM VOC surveys. It is a very powerful feature. The response routings rules are equivalent to the business rules in CRM. <br />
Response routing rule has 3 parts:<br />
<ol>
<li>General Tab (contains the name of the rule and name of the survey)
<li>Conditions Tab ( contains the conditions to be met on the survey)
<li>Actions (contains the actions to be taken when the conditions are met)<br />Actions can be of 2 types</li>
</li>
</li>
</ol>
<ul>
<ul>
<li><strong>Client: </strong>These actions will be triggered on the survey itself on run time. for example hiding or showing a question.
<li><strong>Server: </strong>These action will be triggered out side a survey. for example creating a follow up or complaint etc..</li>
</li>
</ul>
</ul>
Routing rules can be used to show or hide the questions, skip to a question and end the survey etc. based on the responses of the user.<br />
For this blog, I have created a sample survey with the following 3 questions.<br />
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<img height="233" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmRka6LxHihobvqmCHJIYr7zKrPvPjK8jY2xNges-pYeYDqf0aeR7j6vrLMP1xKOZl4KOFKmUGbKCFsoFlyra7hyphenhyphen5tku0CqAPebT6WK6E2zASFZAAbZj3jXhVIAV2z9HiLW9bcyC9ziCg/s1600/image001-723014.png" width="832" /></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
</div>
<br />
I have set the visibility field of the 3rd question to “Do not display”.If you preview this survey, it will look like the following screen shot.<br />
<img height="279" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT2VA9Qjg8EQhxC-1M0dHW01FWzeUYj8Ka2xSwjjcimWgtdxyJ3MM_cSuv3i9zlAw7yLk6tgeALjhmU_tueycpR3z6zoY-M3TlnstYuju5N4pv0jF6iuM9_Z3Fgk0k8td4lxSKumuTavc/s1600/image002-724003.png" width="833" /><br />
<br />
<h2>
Requirement</h2>
What I want to do is that if the users selects the rating of less than 3 for the second question, the survey should display the 3rd question to the user and also create a follow up task.<br />
<br />
<h2>
Solution</h2>
We will create a new response routing rule to fulfil the requirement.<br />
<ol>
<li>Navigate to the the survey and select <strong>Response Routing</strong> from the drop down menu as shown in the screen shot below<br /><br /><img height="309" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiB6fQC4aitQ6tq6QSZ7mZPDVA180YNKuvCOmLG12qy0zQqSHN4FtAUWuttw-QXcP4NZ9OCW5hZA-sVbes9xZNdm1rmtirISSzkuWXMoBwn8d0MSh63brGu0PWi7YS6r9rMVQAAfMP6dis/s1600/image003-724837.png" width="782" /><br />
<li>The system will display the list of Response routings associated with the survey.
<li>The system will display the “New Response Routings” form.
<li>Enter the name for the routing rule and press same
<li>Navigate t the “Conditions” Tab and a new condition. <br /><br /><img height="201" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbzPnLFkhzL-5sHN5gLixTlpbCwRd46cp2XCE6_jvvcGAX6caYZNYoZGZkiDX59sqaiVm7O7F9xv56AHsR9hyvoo8tOLrZt5qFjnDu0JNszqXOB9GCbh7A1WZXobpLuGigzqSRd4FVEbM/s1600/image004-725708.png" width="779" /><br /><br />
<li>The system will display the condition form as shown in the screen shot below<br /><br /><img height="329" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPQEVbev_AXR1N0k1T8ADqZYEbWGy-ehfZIxU2D04yPm2OSmqi4TtSJiFkFzUj-xR5LAuYXGVk78PC9z8HfmHDw3_BE9yqVRCjWfsMT95QPEo5ohV7WibBgJR7n3W-2memAzHzs3BoqwQ/s1600/image005-726595.png" width="776" /><br /><br />The condition in the above screen should is checking if the rating selected in the question 2 is less than 3. <br /><span style="background-color: white; color: red;">Note: The options for “Operator” and “Comparison Value” will change based on the type of question selected. Save the condition.</span>
<li><span style="color: black;">Navigate to the <strong>Actions</strong> tab and add a new action.<br /><br /><img height="87" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYHcbU0l1w_G9jekSBxCDPAkzdFAlJj364WCLn-WNvkapnfl5pTcgjXGGEfx-z0_4g4Qlhgvnnh72qNb_AN2QwR8dOKFIXyOvMI0WpPU3abUwErsSFm5cvx4iw-g0kQkVz6hr9fm3viZM/s1600/image006-727383.png" width="776" /></span>
<li>The first action will be triggered on the client side. Select <strong>Client </strong>from the scope. The action form will look like the following screen.<br /><br /><img height="591" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKvgA44dhlQ1fFvSThZrNoYfPPSFmgEmAJzd_iKfIr8uredlyhIRL8V8sj0eAZjfHDo2AoUdhTElkqEL1bbqt4GU75X85GuLq40jB1Eyn5MEf3btihqT6gbn5FWTle0GUbWfPs8vz3Pzo/s1600/image007-728172.png" width="580" /><br /><br />The <strong>Client </strong>tab displaying the actions details. In short, it is saying to display the question 3.
<li>The second action will be triggered on the server side.The action form will look like the following screen.<br /><br /><img height="541" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7l4mzHCs4FsrWRBSaHVU3b10pz-OIcJd89rIM5WcZFNBk8kmgEfmTUBRU370fPruQwwIqKPGHniVN1sR0TwWGbON9z5YyuV2F_lrIYvXem8MNuU4Xa3cJ78coiIfGgc2_Ks1RrWjOZok/s1600/image008-729050.png" width="776" /><br /><br />The <strong>Server </strong>tab displaying the actions details. The action will create a <strong>response outcome</strong> record of type <strong>follow up </strong>add it to <Amreek Singh> queue.
<li>Make sure the response routing rule is activated and test the action.</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</ol>
<br />
<h2>
Test Results</h2>
<h3>
Client Side Results</h3>
The following screen shot display the survey screen before responding to the 2nd question.<br />
<br />
<img height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmGC3F5BicLfMsctFJPRFLf7gB9Nsr9HwYwF73bovqAQrIpUsBClFxq7UAaMeHbDysDtcS8UizGvf8LzR1sdYsAvzni7wUJrMCSZ4eMX6AvCENxetRFSTqy-M2xySnP75C7jP1wIvGfes/s1600/image009-729803.png" width="833" /><br />
The following screen shot display the survey screen after the rating of 2 is selected for the 2nd question.<br />
<img height="440" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvuaQOurT1VS7jTyps5vP4UY3J0dUUZM_njTgYtX-PLTTwaPteP-KZO4I55ebMRZ6W_hmW4q87jcEF5s7I6AVB7amIb_2cbnJeFjmsiTRhVlGRWgoVHLiRcMWJE4lO_Z_mAXfeD7NYd2U/s1600/image010-730547.png" width="833" /><br />
It is displaying the question 3 as setup in the client action.<br />
<h3>
Server Side Results</h3>
The following screen shot displays the response outcome record created by the server side action.<br />
<img height="499" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhXyvouj983rjnHmQIefS-40YgA3Jie9C6iQkYyUWmCgBuPCfSZC_rZvu4yOL2wqikcfq-JBN5_WJaaZDqyIl6uxCk0FAVoznfZTbuJtMaPuAN9xuPfs-q7DQYAdTZRzPC_w81GKTg13I/s1600/image011-731503.png" width="830" />Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com1tag:blogger.com,1999:blog-4535447606986422873.post-27020737051614624152016-04-10T17:36:00.001-07:002016-04-10T17:36:46.569-07:00Key values in CRM Lookup fields<div class="WordSection1">
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;">I have been working with CRM for nearly 9 years but I have never been aware of the “Key Values” available in the lookup control. Generally, when we retrieve the lookup control in JavaScript, we use code similar to the following :<o:p></o:p></span></div>
<pre class="preetyprint">
<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_nI3rG02vgVg7Cqy4EodxEzyAmLoiCt67j29_qFsuwCaOHAfJ2ZiBwoFlCwO8QXXzNOkEEE_l0EiyVKXCXi-oWSHzvMmuRrmaKNV6JVj-UUsehSlgZKFWI-jRi65AjnT77UWaTSKrPBDj/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;"> lookupFieldObject = Xrm.Page.data.entity.attributes.get('parentaccountid');
if (lookupFieldObject.getValue() != null) {
entityId = lookupFieldObject.getValue()[0].id;
entityName = lookupFieldObject.getValue()[0].entityType;
entityLabel = lookupFieldObject.getValue()[0].name;
}
</code></pre>
</pre>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;"> </span><span style="color: black; font-size: 18pt;">What are the key values for lookup control?<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;">If you select the lookup entity on a form, the lookup control also contains a collection of key values that have other fields from the lookup entity. The screenshot below displays the key values available for an account lookup, when I select a parent account from a contact form.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;"><a href="file:///C:/Users/sinamree/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles10EB370/2016-04-08_15-36-11[5].png"><span style="color: black; text-decoration: none;"></span></a><span style="color: black; text-decoration: none;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8TiYR5ZEezL4u66yxSTGdObOh2DGuFCsS60IfjTw6Mh5yQO-J8syGtsVgrkI6XGrW0kKbi7-8U2QdVBDciZXjQYz9pPI4fpcZZv8C7xnN9Tj2Td5nKMRERqKAc5oQbbdzjaO1TU4X1UQ/s1600/image001-707322.png"><img alt="" border="0" id="BLOGGER_PHOTO_ID_6272082936127833698" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8TiYR5ZEezL4u66yxSTGdObOh2DGuFCsS60IfjTw6Mh5yQO-J8syGtsVgrkI6XGrW0kKbi7-8U2QdVBDciZXjQYz9pPI4fpcZZv8C7xnN9Tj2Td5nKMRERqKAc5oQbbdzjaO1TU4X1UQ/s640/image001-707322.png" /></a></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;">The screenshot displays the collection of other account attributes such as abn, address1state, address1_city, primarycontactid, telephone 1, etc. I did not know that these values were also available for a lookup control. Sometimes we need to retrieve the other attributes of the lookup entity and these key values can be used to retrieve them, instead of making an additional call.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black; font-size: 18pt;">Where are these values coming from?<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;">After doing a bit of research, we have found that these attributes/values are coming from the lookup view of the entity.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;">Here is the lookup view of the account entity in my system.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;"><a href="file:///C:/Users/sinamree/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles10EB370/2016-04-08_15-56-18[3].png"><span style="color: black; text-decoration: none;"></span></a><span style="color: black; text-decoration: none;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYyqmChlkTDF6dGOyH3hatHM7WLpTPnlzojy89ouL9gkv9NwdwnPZit3Y6bxLMDpiUvz3SRhbMYS2CtAyAjkkeluQPdwsIk2beTXgrfovTEDjzEzH6Wf9bNa8PDVTbPTbxOtZztknPIfs/s1600/image002-708817.png"><img alt="" border="0" id="BLOGGER_PHOTO_ID_6272082944367721602" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYyqmChlkTDF6dGOyH3hatHM7WLpTPnlzojy89ouL9gkv9NwdwnPZit3Y6bxLMDpiUvz3SRhbMYS2CtAyAjkkeluQPdwsIk2beTXgrfovTEDjzEzH6Wf9bNa8PDVTbPTbxOtZztknPIfs/s640/image002-708817.png" /></a></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;">These are the same fields as shown in the Key Values collection in the screen shot above.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black; font-size: 18pt;">Gotchas<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="color: black;">Now to the bad news. These key values are not available all the time. These values are only available if you select the value manually from the form. These values won’t be available if the lookup value is set via code or a workflow. My colleague, Mr. Davey has an explanation, that these values get cached when we select the lookup control on the form. That sounds like a good explanation. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: black;"><o:p> </o:p></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com3tag:blogger.com,1999:blog-4535447606986422873.post-39353849585464249992016-04-05T20:38:00.002-07:002016-04-13T17:09:30.128-07:00A bit more about SDK “Merge” message in CRM plugins<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
One of our clients is using auto numbering on contact records. A few days ago, they reported to have duplicates in the system. So I started the investigation, I could not believe that this could happen in our solution. But what I had found out was that those duplicates were generated as a part of the "Merge" functionality available in CRM. Every time users "Merge" the customer and choose the subordinate's customer number to come across, it will override the master record's customer number with the subordinate record's number.<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
So we decided to write a plugin that will stop the users from overriding the master record's customer number. <o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
The <b>context.InputParameters</b> collection of the merge message contains 3 of the following objects</div>
<ol>
<li><div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
Target ( entity reference of the master record)</div>
</li>
<li><div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
SubordinateId ( guid of the subordinate record)</div>
</li>
<li><div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
UpdateContent ( temporary entity that contains the attribute that will be passed to the master record). <o:p></o:p></div>
</li>
</ol>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
The following example does not use the SubordinateId object. We are only using Target and UpdateContent entity. Like any other plugin entity, the "UpdateContent" entity only contains attributes that will be updated in the master record.<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="font-size: 18pt;">Code<o:p></o:p></span></div>
<pre class="prettyprint">
<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_nI3rG02vgVg7Cqy4EodxEzyAmLoiCt67j29_qFsuwCaOHAfJ2ZiBwoFlCwO8QXXzNOkEEE_l0EiyVKXCXi-oWSHzvMmuRrmaKNV6JVj-UUsehSlgZKFWI-jRi65AjnT77UWaTSKrPBDj/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;"> protected void ExecutePreCustomerMerge(LocalPluginContext localContext)
{
if (localContext == null)
{
throw new ArgumentNullException("localContext");
}
IPluginExecutionContext context = localContext.PluginExecutionContext;
ITracingService trace = localContext.TracingService;
IOrganizationService service = localContext.OrganizationService;
// if the sdk message is merge
if (context.MessageName.Equals("merge", StringComparison.InvariantCultureIgnoreCase))
{
//get the merged entity
Entity updateContentData = context.InputParameters["UpdateContent"] as Entity;
//if the merged record is null then do nothing
if (updateContentData == null) { return; }
//get the customer number of merged record
string mergedCustNumber = updateContentData.GetAttributeValue<string>("custNumber");
if (mergedCustNumber == null) return;
else
{
// if the merged CustNumber is not null retrieve the CustNumber of the master record to display in the message
// get the master entity reference
EntityReference targetReference = (EntityReference)context.InputParameters["Target"];
//trace.Trace("entity reference " + targetReference.LogicalName.ToString());
//retrieve the CustNumber number of the master entity
Entity target = service.Retrieve(targetReference.LogicalName, targetReference.Id, new ColumnSet("custNumber"));
string masterCustNumber = target.GetAttributeValue<string>("custNumber");
throw new InvalidPluginExecutionException("You cannot update the CustNumber of the Master record. Master CustNumber :" + masterCustNumber + " and New CustNumber :" + mergedCustNumber);
}
}
}
</code></pre></pre>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<span style="font-size: 18pt;">Some Other Observations<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
When I tested this plugin in CRM2013 roll up 2, I did not receive the message thrown using InvalidPuginExecutionException. Instead, I received the following message:<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<a href="file:///C:/Users/sinamree/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles51386D82/2016-04-06_11-04-06[7].png"><span style="color: #669966; text-decoration: none;"></span></a><span style="color: #669966; text-decoration: none;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGlmH-CxISse4jQOtYmVtzN2gSQvKTxSDE7imD1UcjpLllI6b9_jpippczsc6AOV4bQcaOlOj5u8dsOKJlffrTnRhgzYbf2ozrL7LQXSreZ8uNnipa3Nu89Bgboql6n4Zz8MIZTgidQfo/s1600/image001-793812.png"><img alt="" border="0" id="BLOGGER_PHOTO_ID_6270251076816308946" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGlmH-CxISse4jQOtYmVtzN2gSQvKTxSDE7imD1UcjpLllI6b9_jpippczsc6AOV4bQcaOlOj5u8dsOKJlffrTnRhgzYbf2ozrL7LQXSreZ8uNnipa3Nu89Bgboql6n4Zz8MIZTgidQfo/s320/image001-793812.png" /></a></span><o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
I think it is a bug in CRM2013, that is now fixed in CRM2013 SP1.<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
When I tested the same plugin on CRM2013 SP1 UR3, It displays the proper message, as thrown by the InvalidPuginExecutionException.<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<a href="file:///C:/Users/sinamree/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles51386D82/2016-04-06_11-09-45[5].png"><span style="color: #669966; text-decoration: none;"></span></a><span style="color: #669966; text-decoration: none;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM7FuqyxQkVdb6UPBxleUWM_PbhaR92E53WFYwRY6ShuYh4Mvx5GKXrWFifbfI0mN1HyOB6ETqKOUoFekhWj12_rm1VoXIIBVnStYRIaATLhfYiqB3pk5G5iFptvRFgufPb6KT2W7sx9U/s1600/image002-796512.png"><img alt="" border="0" id="BLOGGER_PHOTO_ID_6270251088631582818" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM7FuqyxQkVdb6UPBxleUWM_PbhaR92E53WFYwRY6ShuYh4Mvx5GKXrWFifbfI0mN1HyOB6ETqKOUoFekhWj12_rm1VoXIIBVnStYRIaATLhfYiqB3pk5G5iFptvRFgufPb6KT2W7sx9U/s320/image002-796512.png" /></a></span><o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm;">
<br /></div>
<div class="MsoNormal">
<br /></div>
Anonymoushttp://www.blogger.com/profile/04193418105246403607noreply@blogger.com6