tag:blogger.com,1999:blog-87055303319526624332024-03-28T02:14:50.781-07:00CRM WORLDMicrosoft Dynamics CRMAbhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-8705530331952662433.post-47130630568350352852018-12-10T02:31:00.002-08:002018-12-10T02:35:44.647-08:00Append search column(s) in Quick Find View - Microsoft Dynamics 365<div dir="ltr" style="text-align: left;" trbidi="on">
In Microsoft Dynamics 365, Quick find allows you to search record(s) on an entity. You can configure view and find columns in quick find view. You can add columns from the entity on which the the quick view is created.You can not add search columns of other related entities. If the requirement is to show matching contacts based on related entity search, then OOTB view customization will not allow you to do this.<br />
<br />
In given ER diagram "Contact"and "Subscription" have N:N relationship through an intersection entity "ContactSubscription".<br />
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdkB1WSKmzm17igzQY_zdWXMhMHXj9YxA_k5-Ksf0fGYZ47YryDWKIRFnnLrqC1RORnlp-FokbfczVkYeXe700GG7ATUAWYKGI4852AyUP__7BJdjh4AYQCFla_L1XTfwk4ECgD_adQPU/s1600/Er.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="216" data-original-width="660" height="204" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdkB1WSKmzm17igzQY_zdWXMhMHXj9YxA_k5-Ksf0fGYZ47YryDWKIRFnnLrqC1RORnlp-FokbfczVkYeXe700GG7ATUAWYKGI4852AyUP__7BJdjh4AYQCFla_L1XTfwk4ECgD_adQPU/s640/Er.png" width="640" /></a></div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br />
<div>
<u>Records in Contact, Subscription and ContactSubscription entity</u></div>
<div>
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; font-family: Georgia, serif; table-layout: fixed; width: 561px;"><colgroup><col class="xl68" style="font-size: 10pt; width: 91pt;" width="121"></col><col class="xl68" style="font-size: 10pt; width: 92pt;" width="122"></col><col class="xl68" span="2" style="font-size: 10pt; width: 85pt;" width="113"></col><col class="xl68" style="font-size: 10pt; width: 69pt;" width="92"></col></colgroup><tbody>
<tr height="19" style="height: 14.25pt;"><td class="xl66" colspan="3" height="19" style="background: rgb(155, 194, 230); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: none; border-top: none; font-size: 10pt; height: 14.25pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; text-align: center; vertical-align: bottom; white-space: nowrap; width: 268pt;" width="356">Contact Entity</td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap; width: 85pt;" width="113"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap; width: 69pt;" width="92"></td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl69" height="17" style="background: yellow; border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl70" style="background: rgb(198, 224, 180); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Record1</td><td class="xl70" style="background: rgb(198, 224, 180); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Record2</td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl71" height="17" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">FirstName</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Abhishek</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Alex</td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl71" height="17" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">LastName</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Kumar</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Goldwin</td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl71" height="17" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Mobile</td><td align="right" class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">99220</td><td align="right" class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">32322</td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl71" height="17" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Email</td><td class="xl72" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; color: #0563c1; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; text-decoration-line: underline; vertical-align: bottom; white-space: nowrap;"><a href="mailto:ab@d.com" style="color: #954f72; font-family: Calibri, sans-serif; font-size: 11pt;" target="_parent"><span style="font-family: "georgia" , serif; font-size: 10pt;">ab@d.com</span></a></td><td class="xl72" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; color: #0563c1; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; text-decoration-line: underline; vertical-align: bottom; white-space: nowrap;"><a href="mailto:al@d.com" style="color: #954f72; font-family: Calibri, sans-serif; font-size: 11pt;" target="_parent"><span style="font-family: "georgia" , serif; font-size: 10pt;">al@d.com</span></a></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl68" height="17" style="border: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td></tr>
<tr height="19" style="height: 14.25pt;"><td class="xl73" colspan="5" height="19" style="background: rgb(155, 194, 230); border: 0.5pt solid windowtext; font-size: 10pt; height: 14.25pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; text-align: center; vertical-align: bottom; white-space: nowrap;">Subscription Entity</td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl69" height="17" style="background: yellow; border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl70" style="background: rgb(198, 224, 180); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Record1</td><td class="xl70" style="background: rgb(198, 224, 180); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Record2</td><td class="xl70" style="background: rgb(198, 224, 180); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Record3</td><td class="xl70" style="background: rgb(198, 224, 180); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Record4</td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl71" height="17" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">SubscriptionType</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Paid</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Paid</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Paid</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Free</td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl71" height="17" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Name</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">NetFlix</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">HBO GO</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Prime</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">HotStar</td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl68" height="17" style="border: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl68" style="border: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td></tr>
<tr height="19" style="height: 14.25pt;"><td class="xl73" colspan="5" height="19" style="background: rgb(155, 194, 230); border: 0.5pt solid windowtext; font-size: 10pt; height: 14.25pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; text-align: center; vertical-align: bottom; white-space: nowrap;">ContactSubscription Entity</td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl69" height="17" style="background: yellow; border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;"></td><td class="xl70" style="background: rgb(198, 224, 180); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Record1</td><td class="xl70" style="background: rgb(198, 224, 180); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Record2</td><td class="xl70" style="background: rgb(198, 224, 180); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Record3</td><td class="xl70" style="background: rgb(198, 224, 180); border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Record4</td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl71" height="17" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Contact</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Abhishek Kumar</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Abhishek Kumar</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Abhishek Kumar</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Alex Goldwin</td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl71" height="17" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Subscription</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">NetFlix</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">HBO GO</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">Prime</td><td class="xl71" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">NetFlix</td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl71" height="17" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">StartDate</td><td align="right" class="xl75" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">1-Jan-18</td><td align="right" class="xl75" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">1-Jan-18</td><td align="right" class="xl75" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">1-Jan-18</td><td align="right" class="xl75" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">1-Jan-18</td></tr>
<tr height="17" style="height: 12.75pt;"><td class="xl71" height="17" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: 0.5pt solid windowtext; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; height: 12.75pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">EndDate</td><td align="right" class="xl75" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">31-Dec-19</td><td align="right" class="xl75" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">31-Dec-19</td><td align="right" class="xl75" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">31-Dec-19</td><td align="right" class="xl75" style="border-bottom: 0.5pt solid windowtext; border-image: initial; border-left: none; border-right: 0.5pt solid windowtext; border-top: none; font-size: 10pt; padding-left: 1px; padding-right: 1px; padding-top: 1px; vertical-align: bottom; white-space: nowrap;">31-Dec-19</td></tr>
</tbody></table>
</div>
<div>
<div>
<br /></div>
<div>
In above table structure "Abhishek" have three subscriptions "NetFlix", "HBO GO" and "Prime" and "Alex" has one subscription "NetFlix".<br />
<br />
In quick view we would not include subscription on contact grid search. If we do a search on keyword "NetFlix". We would not get any record.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTWBRxWWjMb99StV4075GPJupuiC8LahKjzIVzb-yL_gKqxo2inLQ-T4_q8Yz3h8lm678Lygnvx6hTsmbiIBzn7BjGFJmg9WQ3LhgIORT4yncA-FZcQvE9MdbaqxzNyAAhVR9O15HZVnA/s1600/netflixpostdisable.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="133" data-original-width="1291" height="64" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTWBRxWWjMb99StV4075GPJupuiC8LahKjzIVzb-yL_gKqxo2inLQ-T4_q8Yz3h8lm678Lygnvx6hTsmbiIBzn7BjGFJmg9WQ3LhgIORT4yncA-FZcQvE9MdbaqxzNyAAhVR9O15HZVnA/s640/netflixpostdisable.JPG" width="640" /></a></div>
<br /></div>
<div>
<br /></div>
<div>
The requirement is to search/show all the contacts based on there active subscriptions. E.g. for "NetFlix" it should show two records "Abhishek" and "Alex", for "HBO GO" and "Prime" it should show one contact "Abhishek".<br />
<br />
Before we go on implementation its better to know that how CRM executes the Quickfind view? Internally CRM creates a query expression contains view and search columns with isquickfindfields property set true in filter condition. If you convert Queryexpression to FetchExpression the XML would look like as given below. You can extract Queryexpression by profiling Plugin on ReteriveMultiple step.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhF2sUHZSPMPYpoDM66JGg8ghMAS4OkQC0tKfvvTLZLvEtJudzOYHsc-plNd0hlvPQfMji1MNv1D8jNREM1x3JYKl8-GHD_zOCsTCkcWh0_A0ujIWi-DGqdX0dS9dL0jdpEzd7vRPVmKE/s1600/quickfindfetch.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="286" data-original-width="605" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhF2sUHZSPMPYpoDM66JGg8ghMAS4OkQC0tKfvvTLZLvEtJudzOYHsc-plNd0hlvPQfMji1MNv1D8jNREM1x3JYKl8-GHD_zOCsTCkcWh0_A0ujIWi-DGqdX0dS9dL0jdpEzd7vRPVmKE/s640/quickfindfetch.png" width="640" /></a></div>
<br /></div>
<div>
If we add conditions by manipulating the request in RetrieveMultiple Plugin, that would accomplish the requirement. Given below the code snippet.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9-2DblTj0LzTAzIsMtX0MiR4YOJMkJcqixEeKGZfRdqe4fkOKjj1PCCgMRuAV4b9f60iCn4NwRCyTzfHpji_6PNIODYhtwsBKPs7o89te5N5rC1N0tqgeo5rgCkLKGO5Fwcka8cDGCtM/s1600/Code.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="534" data-original-width="1047" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9-2DblTj0LzTAzIsMtX0MiR4YOJMkJcqixEeKGZfRdqe4fkOKjj1PCCgMRuAV4b9f60iCn4NwRCyTzfHpji_6PNIODYhtwsBKPs7o89te5N5rC1N0tqgeo5rgCkLKGO5Fwcka8cDGCtM/s640/Code.png" width="640" /></a></div>
<br />
<br />
In above code we have first extracted the contacts that have subscription provided in search string.<br />
FetchExpression fexp = new FetchExpression("FetchXML query to get contact(s) on subscription(s)");<br />
EntityCollection ecollection = service.RetrieveMultiple(fexp);<br />
<br />
The resultant is then added to the search condition isquickfindfields criteria, which will return contacts matched with provided contactid.<br />
<br />
foreach (Entity ent in ecollection.Entities)<br />
{<br />
ConditionExpression cexpression = new ConditionExpression();<br />
cexpression.AttributeName = "contactid";<br />
cexpression.Operator = ConditionOperator.Equal;<br />
cexpression.Values.Add(ent.Id);<br />
filterexpression.AddCondition(cexpression);<br />
}<br />
<br />
Plugin Registration</div>
<div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3TBpPO_lnhoO2k8UI0Lx4L9TN5ep981XYcE7hWx4Dq_na9RZVtdp8I9wuW0PzP39T0aLRdssx0cDAuNWZZrrkVRq9N3pfjpVNT5YWKO1Az6xCHCPm6mazymASzpOACQSI5APQbakeQV0/s1600/PluginRegistration.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="186" data-original-width="762" height="155" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3TBpPO_lnhoO2k8UI0Lx4L9TN5ep981XYcE7hWx4Dq_na9RZVtdp8I9wuW0PzP39T0aLRdssx0cDAuNWZZrrkVRq9N3pfjpVNT5YWKO1Az6xCHCPm6mazymASzpOACQSI5APQbakeQV0/s640/PluginRegistration.png" width="640" /></a></div>
<br /></div>
<div>
Quick find Search for "NetFlix" subscription.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj98E0Nh9Lo_Z9clXCzbh-Z-6cNDZ9gqJwlF14Y35r0jPlfd5TdJic8hUAYLqNcSqf34NhvqsTcYVJWK-TXGAl3jNY2KZqq80hFKe9SgybKRaWUHFV7Z17Vb0K1DM_38hW2N7v-HBbMzcM/s1600/netflix.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="169" data-original-width="1284" height="82" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj98E0Nh9Lo_Z9clXCzbh-Z-6cNDZ9gqJwlF14Y35r0jPlfd5TdJic8hUAYLqNcSqf34NhvqsTcYVJWK-TXGAl3jNY2KZqq80hFKe9SgybKRaWUHFV7Z17Vb0K1DM_38hW2N7v-HBbMzcM/s640/netflix.JPG" width="640" /></a></div>
<br />
Quick find Search for "Prime" subscription.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcs1o7k6yw7Cj6utZUNC3hLP5_kWymMBDSniQgnNeonQk4YDMfjJtT-MucoyMkHex5e4Y-lKFQjncOCJpw8l75IIrhtOkMfkYJVeSE7N-_qHRVqGJ9tCCocdVsDZHw_DtTVsD5ZFES8B0/s1600/Prime.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="138" data-original-width="1282" height="64" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcs1o7k6yw7Cj6utZUNC3hLP5_kWymMBDSniQgnNeonQk4YDMfjJtT-MucoyMkHex5e4Y-lKFQjncOCJpw8l75IIrhtOkMfkYJVeSE7N-_qHRVqGJ9tCCocdVsDZHw_DtTVsD5ZFES8B0/s640/Prime.JPG" width="640" /></a></div>
<br />
<br /></div>
</div>
</div>
</div>
</div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com0tag:blogger.com,1999:blog-8705530331952662433.post-7317130209709887832017-09-14T00:14:00.001-07:002017-09-15T01:18:47.224-07:00Solution Packager Tool - XrmToolKit<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;">I have built a tool that provides an user interface and would help developers in setting up the arguments for Solution Packager. All you need to specify desired parameters for respective Pack or Extract Operation. This utility also has an interactive command window dedicated to Solution Packager.</span><br />
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKG8MOEaKrIcHXAClFtFMGQV3KBnC4e3_ipapqMo1ZXKaTo0ZqJTUU0RwnMtZAiNqumVqB64LO8m-EU2U6bCCQVZtmGe2epoyz1NQ_HWOf8svfReCSQ6wTq7pRtejqwSw8-UJFL_OD2GQ/s1600/Window.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><img border="0" data-original-height="758" data-original-width="1426" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKG8MOEaKrIcHXAClFtFMGQV3KBnC4e3_ipapqMo1ZXKaTo0ZqJTUU0RwnMtZAiNqumVqB64LO8m-EU2U6bCCQVZtmGe2epoyz1NQ_HWOf8svfReCSQ6wTq7pRtejqwSw8-UJFL_OD2GQ/s640/Window.png" width="640" /></span></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">This tool works with native Solution Packager executable provided by Microsoft Corporation, and needs to be specified in this tool. </span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">You are most welcomed to write your feedback and issues on this post or you can email me on abhishek_255@hotmail.</span></div>
</div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com8tag:blogger.com,1999:blog-8705530331952662433.post-50473298969162535992016-12-12T08:17:00.000-08:002016-12-12T08:17:21.490-08:00Tricky lost focus event call in supported way dynamics crm<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">I had an issue where I need to access CRM text field value on command click. Everything works perfectly well if user clicks on the form after text input (on change event is being called in this case). However things does not work when user hit the command button directly.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">I found a solution that perfectly works well in my case. I have done three things</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">A. I have created a global variable in javascript to hold the state of object when the command button gets clicked.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">B. On click of command button I have updated state in global variable and call Xrm.Page.data.save() method.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">C. Create a javascript function and call it on form's save event. On save check who has initated the save click i.e. command button or by some other source.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><b><u>Complete Code- </u></b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">var IsCommandClicked= false;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">function onSave(context) {</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> if (IsCommandClicked== true) {</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> IsCommandClicked= false;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> var saveEvent = context.getEventArgs();</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> saveEvent.preventDefault();</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> }</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">}</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">function Command Click() {</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> IsCommandClicked= true;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> Xrm.Page.data.save();</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">}</span></div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com0tag:blogger.com,1999:blog-8705530331952662433.post-81957168761110052532016-06-04T11:36:00.000-07:002016-06-04T11:36:54.326-07:00Clone a Solution - Microsoft Dynamics CRM 2016<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Microsoft Dynamics CRM 2016 introduces a new feature Solution Cloning "Clone a Solution" - It creates a copy of solution with new version in which all patches released from base solution are merged.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">You can only clone an unmanaged solution. If you clone an unmanaged base solution, it will create a new solution with higher version(Major & Minor) than base solution. And all the patches released from base solution will be merged into the cloned solution.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">A cloned solution can be exported both Managed and Unmanaged</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u><br /></u></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u>Import cloned solution in target system:</u></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Import feature of clone solution is a bit different from normal solution, when you import a clone solution you will see a message - "This solution package contains an update for a solution that is already installed"</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Current Version: 1.0.0.0</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Version contained in the update: 1.1.0.0</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdyss227wLkp8ZoYqMzCn6xQYiyTFNFzlag34N7evfjUa8-rvV2TGhSRNkJO227XpxR0C813aWqDxt96Tk1nZ8pvZn4iSDvr7uKBsANtQoDy8SSOXtKhFdbjZmYeKFrONmBTklcE4-4to/s1600/iexplore_2016-06-04_16-13-49.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdyss227wLkp8ZoYqMzCn6xQYiyTFNFzlag34N7evfjUa8-rvV2TGhSRNkJO227XpxR0C813aWqDxt96Tk1nZ8pvZn4iSDvr7uKBsANtQoDy8SSOXtKhFdbjZmYeKFrONmBTklcE4-4to/s1600/iexplore_2016-06-04_16-13-49.png" /></span></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Click on Next</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbDy-KJHCYVHT9oq3ReAPB8kOsfnBEqPeDP8STuHfuGU0oGRsCt_AjMRz_XsZ9RViT5mja6s_MRpmOjZU0S3zVS_t5BWX8BHHVMUX304Mob0UV4Y84W-iITVXpfhMM8-zEdgIFmIHD73I/s1600/iexplore_2016-06-04_16-13-59.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbDy-KJHCYVHT9oq3ReAPB8kOsfnBEqPeDP8STuHfuGU0oGRsCt_AjMRz_XsZ9RViT5mja6s_MRpmOjZU0S3zVS_t5BWX8BHHVMUX304Mob0UV4Y84W-iITVXpfhMM8-zEdgIFmIHD73I/s1600/iexplore_2016-06-04_16-13-59.png" /></span></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Here you get option "Stage for Upgrade". If you select this option a holding solution will be created. It means you will see both base solution and upgraded solution. But the upgrade will not take place, to apply upgrade you need to click on "Apply Solution Upgrade" on Solution explorer form.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Maintain Customizations: Selecting this option will maintain any unmanaged customizations performed on components but also implies that some of the updates included in this solution will not take effect. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Example: Suppose you have customized a field in default system solution and change its length from 50 to 100. If in case the cloned solution contains the same field with length 150. In this case maintain customization will retain the unmanaged customization i.e. field length will remain 100.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Overwrite Customizations: Selecting this option will overwrite any unmanaged customizations previously performed on components included in this solution. All updates included in this solution will take effect. From above example- In this case the field length will be updated to 150.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Clone a Patch: <a href="http://consultantabhishek.blogspot.in/2016/06/clone-patch-in-microsoft-dynamics-crm.html">Refer Post</a></span></div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com11tag:blogger.com,1999:blog-8705530331952662433.post-21844750428361332762016-06-02T01:28:00.002-07:002016-06-02T18:52:46.828-07:00Solution - Clone a Patch in Microsoft Dynamics CRM 2016<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;">To perform and release customization in CRM from one system to another, usually we create "Solution", once done with customization(s) we export it either managed or unmanaged and deploy it to production.</span><br />
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;">Suppose a scenario where we have created a Solution (Solution-A), in that we have done some changes [added a new field say "new_field" length 50 for a entity] and deployed it to production.</span><br />
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
</div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Due to some reason now the requirement is to change the field length from 50 to 100. In earlier version to achieve it, either we directly update the field length in production or create a new solution (Solution-B) with all the changes and deploy it on production. </span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;">To overcome this situation Microsoft Dynamics CRM 2016 introduces new feature "Clone a Patch". In which you can release fixes for the solution(s). In this scenario we can create Patch "Clone Patch" for Solution-A.</span><br />
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
</div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;">Benefits:</span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
</div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;">A. You can only create a patch Solution from a base Solution.</span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;">B. Patch solution can not be further patched.</span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;">C. There could be N no of patches from base Solution.</span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;">D. You can not install a patch if base solution is not available.</span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;">E. Patch solution version must have higher build and revision numbers and same major and minor version than base solution version.</span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;">F. <span data-mce-style="color: #2a2a2a; line-height: 18px;" style="color: #2a2a2a; line-height: 18px;">Patches are only supported in CRM organizations of version 8.0 or later.</span></span></div>
<div data-mce-style="text-align: left;" style="background-color: white; font-size: 16px;">
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><span data-mce-style="color: #2a2a2a; line-height: 18px;" style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif; line-height: 18px;">G. You can not update base solution, if it is patched.</span></span><br />
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><span data-mce-style="color: #2a2a2a; line-height: 18px;" style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif; line-height: 18px;"><br /></span></span>
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><span data-mce-style="color: #2a2a2a; line-height: 18px;" style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif; line-height: 18px;">Delete a Patch or Base Solution:</span></span><br />
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><span data-mce-style="color: #2a2a2a; line-height: 18px;" style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif; line-height: 18px;"><br /></span></span>
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><span data-mce-style="color: #2a2a2a; line-height: 18px;" style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif; line-height: 18px;">In the above example we have created two solutions (Solution-A and Solution-B). B is the patch for A and higher in version. To delete a base solution (Solution-A) </span></span><br />
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><span data-mce-style="color: #2a2a2a; line-height: 18px;" style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif; line-height: 18px;"><br /></span></span>
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><span data-mce-style="color: #2a2a2a; line-height: 18px;" style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif; line-height: 18px;">Unmanaged : Then Solution-B must be deleted first then Solution-A</span></span><br />
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><span data-mce-style="color: #2a2a2a; line-height: 18px;" style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif; line-height: 18px;"><br /></span></span>
<span data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif;" style="font-family: "arial" , "helvetica" , sans-serif;"><span data-mce-style="color: #2a2a2a; line-height: 18px;" style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif; line-height: 18px;">Managed: Solution-A can be deleted directly, Microsoft dynamics will remove all the patches in order from higher to lower version.</span></span></div>
</div>
</div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com2tag:blogger.com,1999:blog-8705530331952662433.post-78809682227987296792016-04-21T09:31:00.001-07:002016-04-21T18:55:04.616-07:00Impersonate or Assign user in Microsoft Dynamics CRM<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Impersonation is someone else working on your behalf to accomplish your task. In most integration scenarios with external applications non-interactive user account is used to impersonate an interactive user. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Non-interactive account only works when "Act on behalf" privilege is assigned. Also it will execute within the security role boundary of Interactive user. So an interactive user have access to case entity create - user or team level and on other hand non-interactive have access at Organization level. Then only user and team level access will be granted to non-interactive. Impersonation is best where an operation shall execute in the interactive user security role context.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">The above approach does not guarantee that an operation will always get complete, suppose a scenario where case-create role revoked from the interactive user, then non-interactive user acting on behalf of interactive user will not be able to perform create operation.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">If the requirement is that always a case get created in dynamics CRM, then we can configure non-interactive user account and grant organization level access to create a case and assign etc, once case get created it can be assigned to any interactive user. The difference you see here is created by user will non-interactive & owner will be interactive when you assign. On the other hand if you impersonate then created by and owner both will be interactive.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
</div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com0tag:blogger.com,1999:blog-8705530331952662433.post-56443834279121136972016-04-17T02:35:00.003-07:002016-04-18T21:38:33.122-07:00Plugin Error to Entity Microsoft Dynamics CRM<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="height: 0px; text-align: left;">
</div>
<div style="text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Plugin(s) are used to apply custom business logic within organization service's event execution pipeline. In event of any exception the execution of plugin code terminates along with core operation. If you have enabled the exception logging of plugin exception (Settings>>Administration>>System Setting>>Customization>>Enable logging to Plugin Trace log >> Exception), plugin exception will be logged in Plugin Trace log.</span></div>
<div style="text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"></span><br />
<div style="text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Plugin Trace Log is a centralized view for all the plugin exceptions. Tracing of plugin exception to custom entity is not possible without customization and configuration. In this post we will see an approach to log plugin exception(s) to custom entity.</span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">
</span>
<br />
<div style="text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">
</span>
<br />
<div style="text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Requirement is to write a plugin on contact create, that plugin will validate "First Name", if first name is left blank then contact should not get created and plugin will throw error and terminates the core operation. And this specific plugin error needs to logged into "ContactPluginError" entity.</span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">
</span>
<div style="text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh852x0EtObhK4I0xtAGQmG_NMc1xB1rKB8D1I69Km3U4Wq8OB5hAcirn2ROI4lklqEA6bEXIF3dZIpsQLjtDGXI7H3PN0ufCWew0liLinRptGOqwjtZ4MKNh-WmZuq6tmvZ_IDREFgx2k/s1600/architecture.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh852x0EtObhK4I0xtAGQmG_NMc1xB1rKB8D1I69Km3U4Wq8OB5hAcirn2ROI4lklqEA6bEXIF3dZIpsQLjtDGXI7H3PN0ufCWew0liLinRptGOqwjtZ4MKNh-WmZuq6tmvZ_IDREFgx2k/s1600/architecture.png" /></a></div>
<div style="text-align: left;">
<br /></div>
</span><br />
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">In above process flow chat, a recursive workflow will be running in background that will be triggered in every X minutes, it will create a custom entity record recursively, on that custom entity there will be a post operation registered plugin which will read & delete error detail from Plug-in trace log and move it to custom entity.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u><b>A. Enable Plug-in exception tracing</b></u></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u><br /></u></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Plugin errors will be logged to Plug-in trace log when enabled from system settings. </span></div>
<div>
<u><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></u></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQqAEiKcmze5EGjc_Sm4MJ4F-5AHmlKnxJCcV1_nCqIZZoUOUPAsYNbtdzv3C3gu0IWN4Y_Bbdl0e9y9TGqAItyZNHpe0WfM-SXssy35ZG3nP-H7bJzcaTBf8SLc3ajFLhSsoinsoZ7aE/s1600/setting.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="279" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQqAEiKcmze5EGjc_Sm4MJ4F-5AHmlKnxJCcV1_nCqIZZoUOUPAsYNbtdzv3C3gu0IWN4Y_Bbdl0e9y9TGqAItyZNHpe0WfM-SXssy35ZG3nP-H7bJzcaTBf8SLc3ajFLhSsoinsoZ7aE/s640/setting.png" width="640" /></a></div>
<div>
<u><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></u></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<u><b><span style="font-family: "arial" , "helvetica" , sans-serif;">B. Custom Entity "</span><span style="font-family: "arial" , "helvetica" , sans-serif;">ContactPluginError</span><span style="font-family: "arial" , "helvetica" , sans-serif;">"</span></b></u></div>
<div>
<u><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></u></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Create custom entity to log plug-in error. This entity will appear in Setting area.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlcYUWdtxH68e1Xq1FVJ1meSQk2JI2PPXxFe0jdpQwvtEpU8RD-RcNtzi6ukfom-MJc3mrDoHSkD4Q4cGBEcO4GxdLXWJ4v7_2zJYcy83Q7kOHymBRGitfHGbY_l-EE6niYy81oxAK4tg/s1600/contactpluginerror_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlcYUWdtxH68e1Xq1FVJ1meSQk2JI2PPXxFe0jdpQwvtEpU8RD-RcNtzi6ukfom-MJc3mrDoHSkD4Q4cGBEcO4GxdLXWJ4v7_2zJYcy83Q7kOHymBRGitfHGbY_l-EE6niYy81oxAK4tg/s640/contactpluginerror_1.png" width="640" /></a></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Add fields to store exception details.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDiVxtXoMJ4JM4ouqenqQivZHHfAxqg9o_I0F9wG1p7qMwiHIGwIfPQ4zvQfNiStCTdIQdYTPhgldb0Yj8k4Ct9m8YlM6hMDkGjTeZ3Q_moam9HaCLCfo-R-Sq19qeTLyGq_uQHLkGjlM/s1600/contactpluginerror_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="81" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDiVxtXoMJ4JM4ouqenqQivZHHfAxqg9o_I0F9wG1p7qMwiHIGwIfPQ4zvQfNiStCTdIQdYTPhgldb0Yj8k4Ct9m8YlM6hMDkGjTeZ3Q_moam9HaCLCfo-R-Sq19qeTLyGq_uQHLkGjlM/s640/contactpluginerror_2.png" width="640" /></a></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Customize "ContactPluginError" form to display error details.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmhHGmgZ71q9XOCZ7YogTrLZp0_e4yhaY8NT0emKyROrdMuSd13UmsU2hSuOx7627etIB2ujOLX5lpGaTngWrpUb9ealL0kVL1SEVQrwOh4aAhCEyKvAGDbliq6ZbuwezUEgvMvGJFUbk/s1600/contactpluginerror_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="445" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmhHGmgZ71q9XOCZ7YogTrLZp0_e4yhaY8NT0emKyROrdMuSd13UmsU2hSuOx7627etIB2ujOLX5lpGaTngWrpUb9ealL0kVL1SEVQrwOh4aAhCEyKvAGDbliq6ZbuwezUEgvMvGJFUbk/s640/contactpluginerror_3.png" width="640" /></a></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Save and Publish customizations.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<u><b><span style="font-family: "arial" , "helvetica" , sans-serif;">C. Custom Entity "</span><span style="font-family: "arial" , "helvetica" , sans-serif;">RecursiveMovePluginError</span><span style="font-family: "arial" , "helvetica" , sans-serif;">"</span></b></u></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">RecursiveMovePluginError entity will be created by workflow, this entity will have a plugin registered on create which will read data from plugin trace log entity and move it to custom entity.</span><span style="font-family: "arial" , "helvetica" , sans-serif;"> </span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgubhl1knwaAzXjRL4adep7dLFTL1lIW47ru3SbQksv5a80KtNmXzZqBwRCszhPbPLesgV6cvnVOOGtIbeX_uy4JMYWoszetZHzoW6RWuSLosmWse0T7_PGvGIwiJxUFEPn-Z0hHR2sj98/s1600/rec_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgubhl1knwaAzXjRL4adep7dLFTL1lIW47ru3SbQksv5a80KtNmXzZqBwRCszhPbPLesgV6cvnVOOGtIbeX_uy4JMYWoszetZHzoW6RWuSLosmWse0T7_PGvGIwiJxUFEPn-Z0hHR2sj98/s640/rec_1.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Add a field to store the type (plugin name) whose error log needs to moved from plugin trace log to </span><span style="font-family: "arial" , "helvetica" , sans-serif;">ContactPluginError entity.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgOCPhep1Mn4ZkF2s4YhqPKhT3SDn7K9zwcwElImdGnEI5xE1yWNZtY9cVdxsDG-G5qUUFvwYk8VE-rADibX_CJIqh88QIGm9Bkwomk2tzDRML64nVUkDKeMt9B3hwsynOeRqu31LMWwU/s1600/rec_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgOCPhep1Mn4ZkF2s4YhqPKhT3SDn7K9zwcwElImdGnEI5xE1yWNZtY9cVdxsDG-G5qUUFvwYk8VE-rADibX_CJIqh88QIGm9Bkwomk2tzDRML64nVUkDKeMt9B3hwsynOeRqu31LMWwU/s640/rec_2.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Customize </span><span style="font-family: "arial" , "helvetica" , sans-serif;">RecursiveMovePluginError form and add field type.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJAjwD3YlTfvBBa9XX0krOHmI9PH0uzLL241BVZ7lHhdJVIc5vMeTUCa9JNalBUK8MuHsxKxQPHRgvksZmdTwefwG498JglhtoQAiH5-pZIAzq9XPbu7IZeNif18pzDHx997XkwnhIpc8/s1600/rec_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="315" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJAjwD3YlTfvBBa9XX0krOHmI9PH0uzLL241BVZ7lHhdJVIc5vMeTUCa9JNalBUK8MuHsxKxQPHRgvksZmdTwefwG498JglhtoQAiH5-pZIAzq9XPbu7IZeNif18pzDHx997XkwnhIpc8/s640/rec_3.png" width="640" /></a></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Save and Publish Customization.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u><b>D. Create Workflow</b></u></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Create background on demand workflow, that needs to be first triggered manually, once triggered it will automatically executes every 2 </span><span style="font-family: "arial" , "helvetica" , sans-serif;">minutes and create </span><span style="font-family: "arial" , "helvetica" , sans-serif;">RecursiveMovePluginError entity record.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipTF9qfmXOoYqS1F271tPuFizefeKUHtHyTAqq3-0vMr5RFlhMCY23P6QOTl0vM-5xdz_uBIZ6zd1F23xZgZAb5n1ncClBGVjGCWxn6VbM3Vj3-4WVa2GCyMppzK5_EBdyrDf5HxNSNYM/s1600/wf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="376" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipTF9qfmXOoYqS1F271tPuFizefeKUHtHyTAqq3-0vMr5RFlhMCY23P6QOTl0vM-5xdz_uBIZ6zd1F23xZgZAb5n1ncClBGVjGCWxn6VbM3Vj3-4WVa2GCyMppzK5_EBdyrDf5HxNSNYM/s640/wf.png" width="640" /></a></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Set below properties on Create step of </span><span style="font-family: "arial" , "helvetica" , sans-serif;">RecursiveMovePluginError</span><span style="font-family: "arial" , "helvetica" , sans-serif;"> record.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPb5P6_ib7CtaDhCsr_vl8YrMRM3UcUmNR_wrVmBCr2Ns2wLZpv1gjBsuYUNNXdW9obn_jiGEbGWmjLA2UpSmFSIn5OAtTzwmy2lab1U-Qr5uGy3gQ0zw_IjpxTaKkL4DFLdHakz8UFj4/s1600/wf_prop.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="181" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPb5P6_ib7CtaDhCsr_vl8YrMRM3UcUmNR_wrVmBCr2Ns2wLZpv1gjBsuYUNNXdW9obn_jiGEbGWmjLA2UpSmFSIn5OAtTzwmy2lab1U-Qr5uGy3gQ0zw_IjpxTaKkL4DFLdHakz8UFj4/s640/wf_prop.png" width="640" /></a></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Save and activate the workflow.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<u style="font-family: Arial, Helvetica, sans-serif;"><b>D. Plugin</b></u></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u><br /></u></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Create and register "TracePlugin" plugin that will be move exception from Plugin trace log to custom entity.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"></span><br />
<div class="separator" style="clear: both; font-size: small; text-align: center;">
</div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">
</span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSyEOUOIA0ozxk9Ig382jFml4Eh9LAERXv8m6PdA3JmyV_NUOX0B9FrDCpCDgVyGIn4_EVqg0e7NWz1eH8ivx0lnNvsfVNHo0p6Ljm48uduchT0pW4vNLkweh-hrxbSDdsARZ5Rc3Rxeo/s1600/plguin_code.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="543" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSyEOUOIA0ozxk9Ig382jFml4Eh9LAERXv8m6PdA3JmyV_NUOX0B9FrDCpCDgVyGIn4_EVqg0e7NWz1eH8ivx0lnNvsfVNHo0p6Ljm48uduchT0pW4vNLkweh-hrxbSDdsARZ5Rc3Rxeo/s640/plguin_code.png" width="640" /></a></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">
</span>
<br />
<div style="font-size: small;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">
Register plugin Post operation - Async<br />
</span><br />
<div style="font-size: small;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">
<div class="separator" style="clear: both; font-size: small; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUMVEkF9t8FhYn5iAEfiZWK9jpRB2l5nrCyvTNs6VvEl961Ajfbj1sRhb1p5AUWuXD-NoyPagZ_mp4le9Gj6xTWwdvAr288CJEDzYsSrPZyA_CJ4kSxquyoqQeLatihAO75lo3iltRTjo/s1600/plguin_reg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUMVEkF9t8FhYn5iAEfiZWK9jpRB2l5nrCyvTNs6VvEl961Ajfbj1sRhb1p5AUWuXD-NoyPagZ_mp4le9Gj6xTWwdvAr288CJEDzYsSrPZyA_CJ4kSxquyoqQeLatihAO75lo3iltRTjo/s640/plguin_reg.png" width="593" /></a></div>
<div style="font-size: small;">
<br /></div>
<div>
<u><b>E. Execute and Trigger Process</b></u></div>
<div>
<br /></div>
<div>
Create Contact record without first name, an exception will the thrown by plugin</div>
<div style="font-size: small;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhtZkMAFUAsR0ChLHkbUk7ie8CbgbfOG4V7C8-7Lceb6pg371E7JbtEv7HCWRJwcNF0WRI8P1F_ZW2dKGDjphnhG7P0hGhQAKQaL3KD64yVJl0Rp-1geY5m9VI-D54AjRi217oyOKstdA/s1600/contact_woutfs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="344" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhtZkMAFUAsR0ChLHkbUk7ie8CbgbfOG4V7C8-7Lceb6pg371E7JbtEv7HCWRJwcNF0WRI8P1F_ZW2dKGDjphnhG7P0hGhQAKQaL3KD64yVJl0Rp-1geY5m9VI-D54AjRi217oyOKstdA/s640/contact_woutfs.png" width="640" /></a></div>
<div style="font-size: small;">
</div>
<div>
System plug-in trace log will be having an entry for this plugin error.</div>
<div style="font-size: small;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRR2nStj6WO-DhOhVwSYSYSeB5dNpKPHDDYcRYtCCXDLDAZ3YXuKeWaZjgkqDAYV8XlFKR4BVjhVqzuv0XLb_5mF2gjgBYizhXxKrOcqtX58dbz4G1pikaw1n0FowKSQ5NIVSDDgZytXc/s1600/plugintracelog.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="112" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRR2nStj6WO-DhOhVwSYSYSeB5dNpKPHDDYcRYtCCXDLDAZ3YXuKeWaZjgkqDAYV8XlFKR4BVjhVqzuv0XLb_5mF2gjgBYizhXxKrOcqtX58dbz4G1pikaw1n0FowKSQ5NIVSDDgZytXc/s640/plugintracelog.png" width="640" /></a></div>
<div style="font-size: small;">
<br /></div>
<div>
<br /></div>
<div>
Configure and Trigger workflow job to move errors to ContactPluginError entity. Create a record for RecursiveMovePluginError and specify plugin type that needs to be monitored and moved.</div>
</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><div style="font-size: small;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP1TwddJEnQQBg783eskj8YAr61oVNwphhJxfOFR5CLBPsBW6UUtwrPAr3jie0zvwtI9R4QqMZd6ZdDdosE3vHRDLQHZqOxA1RXtMEPp_obfEWwTQ4d2r90SxrT51JDjnmrxuKFBYd0e8/s1600/type_to_monitor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP1TwddJEnQQBg783eskj8YAr61oVNwphhJxfOFR5CLBPsBW6UUtwrPAr3jie0zvwtI9R4QqMZd6ZdDdosE3vHRDLQHZqOxA1RXtMEPp_obfEWwTQ4d2r90SxrT51JDjnmrxuKFBYd0e8/s640/type_to_monitor.png" width="640" /></a></div>
<div style="font-size: small;">
<br /></div>
<div>
Trigger workflow</div>
<div style="font-size: small;">
<br /></div>
<div style="font-size: small;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFnha89J769i_c91nk1orRykWk31xKmpBZrvLHKstFMTpe3EgjeWig8bjmTXXlVjxTKBvgy-DDkGxnlEiy_UHs81LAKcofoDP6dxleMLOVX000DiV8kYAKHv38Zc4eWEboNjaVZ6r-7as/s1600/trigger_wf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="435" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFnha89J769i_c91nk1orRykWk31xKmpBZrvLHKstFMTpe3EgjeWig8bjmTXXlVjxTKBvgy-DDkGxnlEiy_UHs81LAKcofoDP6dxleMLOVX000DiV8kYAKHv38Zc4eWEboNjaVZ6r-7as/s640/trigger_wf.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now all the plugin error thrown by plugin type "ContactDataValidation.FirstNamePlugin" will be moved from plugin trace log to custom entity "ContactPluginError".</div>
</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs2ZFIKsec0V31kh5V1pDwhEKu4KXS3Rxy4k3LvQ5Mh3K0pLhFUQA6UhbbrIyR-VBXN7IqIh3bDzb53Phy3OmLBhnHSDK7n2xbrzef6HBxyVmVx5UCxJU8vKOPruKDje4HYmBUK9tQWTo/s1600/error_incustom.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="337" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs2ZFIKsec0V31kh5V1pDwhEKu4KXS3Rxy4k3LvQ5Mh3K0pLhFUQA6UhbbrIyR-VBXN7IqIh3bDzb53Phy3OmLBhnHSDK7n2xbrzef6HBxyVmVx5UCxJU8vKOPruKDje4HYmBUK9tQWTo/s640/error_incustom.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="font-size: small;">
<br /></div>
<div style="font-size: small;">
<br /></div>
<div>
<b>Summary:</b></div>
<div>
<br />
"Plugintracelog" entity does not expose "Create" message to register any plugin. Therefore when any record is created in "Plugintracelog" entity there is no way to directly fire any plugin and perform any action on that.</div>
<div>
<br /></div>
<div>
Recursive workflows are auto triggered, so whenever a new record "RecursiveMovePluginError " is created, registered plugin "TracePlugin" on "RecursiveMovePluginError" entity create message will also execute, its task is to read all the matched types "ContactDataValidation" plugin logs and move it to custom entity "ContactPluginError". Since I have configured workflow with a timeout condition of 2 minutes, so 2 minutes delay is expected in move operation from "PluginTracelog" entity to "ContactPluginError" entity.</div>
</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><div>
<br /></div>
<div>
<br /></div>
<div>
<b>For Reference:</b></div>
<div>
<br /></div>
<div>
Solution File:<br />
<br />
<iframe frameborder="0" height="120" scrolling="no" src="https://onedrive.live.com/embed?cid=C72F8EE22A062598&resid=C72F8EE22A062598%2112824&authkey=ADEbUD30unxJuD8" width="98"></iframe><br />
<br />
<iframe frameborder="0" height="120" scrolling="no" src="https://onedrive.live.com/embed?cid=C72F8EE22A062598&resid=C72F8EE22A062598%2112823&authkey=AIfxtKRbID6JVGI" width="98"></iframe></div>
<div>
<br /></div>
<div>
Plugin Code:</div>
<div>
<br />
<iframe frameborder="0" height="120" scrolling="no" src="https://onedrive.live.com/embed?cid=C72F8EE22A062598&resid=C72F8EE22A062598%2112825&authkey=ADjlRaafGnqeT3k" width="98"></iframe></div>
<div>
<br /></div>
</span></div>
<div>
<span style="color: #1f497d; font-family: "calibri" , "sans-serif"; font-size: 11.0pt;"><a href="https://community.dynamics.com/crm">MS CRM Community</a></span><br />
<div style="height: 0px; text-align: left;">
<br /></div>
<div style="height: 0px; text-align: left;">
<br /></div>
<div style="height: 0px; text-align: left;">
<br /></div>
<div style="height: 0px; text-align: left;">
<br /></div>
</div>
</div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com2tag:blogger.com,1999:blog-8705530331952662433.post-64334757970713873052016-03-30T01:14:00.000-07:002016-04-07T13:14:43.512-07:00Web API for Microsoft Dynamics CRM Online or internet facing deployments<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>What is Web API?</b></span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Web API is implementation of OData (Open Data Protocol) which is an OASIS standard that defines the best practice for building for building and consuming RESTful APIs.</span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<b style="font-family: arial, helvetica, sans-serif;">Web API Authentication</b></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">- Javascript Web Resources: You don't need to specify authentication pattern if call is made from the CRM application.</span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">- CRM On-Premise: When you use the Web API for on-premises deployments you must include the user’s network credentials.</span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">- CRM Online or IFD: When you use the Web API for CRM Online or an on-premises Internet-facing deployment (IFD) you must use OAuth.</span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Steps to register your IFD or CUSTOM CRM application in Azure Active Directory </b></span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Step 1: Login to Windows Azure portal</span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: arial, helvetica, sans-serif;">Step 2: Select your organization and click on applications</span></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtYv_RqeEd_DILqWugQgQg5B66Ok0JmgYz675TrUfMmQtdr9DLF7rpthgKfWt6sc2MdHzWzv8ZQuuPf5ZoQj6p41Q6pVZ1v92-EL5HXNo3XFkbjcELJp3ad7ocnl5E5-BWMr3odUHllOA/s1600/image002.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtYv_RqeEd_DILqWugQgQg5B66Ok0JmgYz675TrUfMmQtdr9DLF7rpthgKfWt6sc2MdHzWzv8ZQuuPf5ZoQj6p41Q6pVZ1v92-EL5HXNo3XFkbjcELJp3ad7ocnl5E5-BWMr3odUHllOA/s1600/image002.jpg" /></a></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small; font-weight: normal;"><br /></span></h1>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">It will list down all the application configured in selected organization.</span></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
<span style="font-family: "segoe ui semibold" , sans-serif; font-size: 12.5pt;"> </span></h1>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-G8LvRAfvaxEyb-uW267byePsxKZj1TWC2rEWYeL3zMyQEoxeqX5SfBKroxSQq_5X4WmGe8A-oKmNmsVV67iyyMn6GwfCw73QxsGCgn1t07_ygqsvyOZB_v8dhFRLMNzHezAuzH11CXQ/s1600/image003.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-G8LvRAfvaxEyb-uW267byePsxKZj1TWC2rEWYeL3zMyQEoxeqX5SfBKroxSQq_5X4WmGe8A-oKmNmsVV67iyyMn6GwfCw73QxsGCgn1t07_ygqsvyOZB_v8dhFRLMNzHezAuzH11CXQ/s1600/image003.jpg" /></a></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
</h1>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Step 3: To Add your CRM application click on Add button.</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMAufzcT0JicB8o28aWZYNGn-gholM5YHQnskjur_VouLC7CL0V7jIVqTvFtYg8Xx-pivx1Q2yWFNrwDfKjm1k81lhi045aPxjc7EyZeBWIPA26gqIkSt1jep1LluBRfhcZI5yJaMkUkM/s1600/image004.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMAufzcT0JicB8o28aWZYNGn-gholM5YHQnskjur_VouLC7CL0V7jIVqTvFtYg8Xx-pivx1Q2yWFNrwDfKjm1k81lhi045aPxjc7EyZeBWIPA26gqIkSt1jep1LluBRfhcZI5yJaMkUkM/s1600/image004.jpg" /></a></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<br /></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Step 4: Add an application my organization is developing</span></div>
</div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Step 5: Enter name of your application</span></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
</h1>
<h1 style="background: white; margin: 0in 0in 9pt;">
<span class="lwcollapsibleareatitle"><span style="font-family: "segoe ui semibold" , sans-serif; font-size: 12.5pt;"> </span><span style="font-family: "segoe ui semibold" , sans-serif; font-size: 12.5pt;"> </span><span style="font-family: "segoe ui semibold" , sans-serif; font-size: 12.5pt;"><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBx2G3EiGZeSXBiw6hRglvgBbsnUvCgLjekf9HW_wLq6MqbeO1tkiHF95EJFobGiFTGc08mbR2QF6_T1twY6uVGcyn_q6Auz6oI6WO7tjT8pq9DMR2c_rp5-XJz6rvYlrUPwAsJv5r4M4/s1600/image005.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBx2G3EiGZeSXBiw6hRglvgBbsnUvCgLjekf9HW_wLq6MqbeO1tkiHF95EJFobGiFTGc08mbR2QF6_T1twY6uVGcyn_q6Auz6oI6WO7tjT8pq9DMR2c_rp5-XJz6rvYlrUPwAsJv5r4M4/s1600/image005.jpg" /></a></div>
</span></span></h1>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />*Note: Web application or WEB API is selected for web application and for desktop, console it should be native client application. Since our sample is native client application, hence selected “Native” option</span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Step 6: Click Next and add redirect URI</span></div>
<div>
<span class="lwcollapsibleareatitle"><span style="font-family: "segoe ui semibold" , sans-serif; font-size: 10pt;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdkO6wwHq-gumfKPLtM1FoNkkYcgViWskz1oifTolen8CGCWp4rYdMF3IB4COzYBKj9r-8PiWpJWwfewGOT4T49jYdKlv9EtFh-N90Okub-QkGeNl28DDABn8A0qADZblbqbKzb1A_hS4/s1600/image006.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdkO6wwHq-gumfKPLtM1FoNkkYcgViWskz1oifTolen8CGCWp4rYdMF3IB4COzYBKj9r-8PiWpJWwfewGOT4T49jYdKlv9EtFh-N90Okub-QkGeNl28DDABn8A0qADZblbqbKzb1A_hS4/s1600/image006.png" /></a></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
</h1>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small; font-weight: normal;"><span class="lwcollapsibleareatitle"><br /></span></span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Step 7: Once application is added, we need to configure it</span></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small; font-weight: normal;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdUrVe3_Tddy3sy95tYvNIhOi5-uNTQKzAqFEPEDbHquIoxlVSJCh1Iox37TwHkk6sz7Eg5vQG8seHoG2oEA9wtDK_xMTnc9zVTxb9BVltqBy8iJQhLQsiURWhyphenhyphen913GO05e2So-iqy5zE/s1600/image007.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdUrVe3_Tddy3sy95tYvNIhOi5-uNTQKzAqFEPEDbHquIoxlVSJCh1Iox37TwHkk6sz7Eg5vQG8seHoG2oEA9wtDK_xMTnc9zVTxb9BVltqBy8iJQhLQsiURWhyphenhyphen913GO05e2So-iqy5zE/s1600/image007.png" /></a></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
</h1>
<div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />Step 8: Add Microsoft dynamics crm permission to this application</span></div>
<span class="lwcollapsibleareatitle"><span style="font-family: "segoe ui semibold" , sans-serif; font-size: 10pt;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfeuwbjJzIybX2_wtLLjxP871w3AShV7wuxaNuys_PHmEefW5JV41QFSUu6tgjoCaQlJpkjyv6fX0-DzAaviTRWBgjjCgydE0UbC2NnjRZmTFmTbKGCq-Y1RhFKbX_htrDZyOrKKHuHMY/s1600/image008.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfeuwbjJzIybX2_wtLLjxP871w3AShV7wuxaNuys_PHmEefW5JV41QFSUu6tgjoCaQlJpkjyv6fX0-DzAaviTRWBgjjCgydE0UbC2NnjRZmTFmTbKGCq-Y1RhFKbX_htrDZyOrKKHuHMY/s1600/image008.jpg" /></a></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1XMkb5wXm9JNku6n_22VM9OWINA2qUdzjDjQjaBJ2NLEEWCyUwkZl7-Rr610yUAIzMpfMdnzH8yZbzFAoDCNaZ-2hzG3Q5JfmEZmOj8GvbmCzW_GrgEG2Shz5yf0ticni7myAyV4KPTw/s1600/image009.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1XMkb5wXm9JNku6n_22VM9OWINA2qUdzjDjQjaBJ2NLEEWCyUwkZl7-Rr610yUAIzMpfMdnzH8yZbzFAoDCNaZ-2hzG3Q5JfmEZmOj8GvbmCzW_GrgEG2Shz5yf0ticni7myAyV4KPTw/s1600/image009.jpg" /></a></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
</h1>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />Step 9: Assign Delegate Permission to Microsoft Dynamics CRM</span></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
</h1>
<h1 style="background: white; margin: 0in 0in 9pt;">
<span class="lwcollapsibleareatitle"><span style="font-family: "segoe ui semibold" , sans-serif; font-size: 12.5pt;"> </span></span></h1>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjalYYJXgFpGt8Mp9ITB14EhsL6-hOduOhI0Qo-5gWMUlwIxxC26mzZyJqvKOcpXGsCKB1OxOrMzsJLWICX1HvY5-2KD98nZlVz5Zov3ZwmeLQFKiGzr2s7QQjO_QxRH1j_W3jIBL-CmLs/s1600/image010.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjalYYJXgFpGt8Mp9ITB14EhsL6-hOduOhI0Qo-5gWMUlwIxxC26mzZyJqvKOcpXGsCKB1OxOrMzsJLWICX1HvY5-2KD98nZlVz5Zov3ZwmeLQFKiGzr2s7QQjO_QxRH1j_W3jIBL-CmLs/s1600/image010.jpg" /></a></div>
<div>
<span style="background-color: white; font-family: "arial" , "helvetica" , sans-serif;"><br /><br />Step 10: Save the Changes</span></div>
<div>
<span class="lwcollapsibleareatitle" style="font-weight: normal;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivnW7SWRgxam6NL7McPF1LuHrYM7N7crCpoKJKKE8e52OCWYKUYy-YlWvlvDQaq4B-6BQ-d65i3HSY3nTZ1-UIj-k-MzYr4LSo9C2FoTF5_yaGEVvPXHenX3WNVRdwjadSQGFJyysHs5s/s1600/image011.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivnW7SWRgxam6NL7McPF1LuHrYM7N7crCpoKJKKE8e52OCWYKUYy-YlWvlvDQaq4B-6BQ-d65i3HSY3nTZ1-UIj-k-MzYr4LSo9C2FoTF5_yaGEVvPXHenX3WNVRdwjadSQGFJyysHs5s/s1600/image011.jpg" /></a></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
</h1>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />Step 11: Copy Client ID, that we will use in native client application</span></div>
<div>
<span style="font-family: "segoe ui semibold" , sans-serif; font-size: 10pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglY6C7GJQt5Ba5jH2pRIo_QzEnEjgWhh6WyMgnh1BNqV9aKJLWorQMbjo_L-k_U6oivDFSVed_y9GaCKdE7fQpypH2gU4v19hemIdPVx9tWJEI4epVucihHS782B0Ysq4adyNxDmOZcyI/s1600/image012.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglY6C7GJQt5Ba5jH2pRIo_QzEnEjgWhh6WyMgnh1BNqV9aKJLWorQMbjo_L-k_U6oivDFSVed_y9GaCKdE7fQpypH2gU4v19hemIdPVx9tWJEI4epVucihHS782B0Ysq4adyNxDmOZcyI/s1600/image012.jpg" /></a></div>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />Console Application: This sample demonstration will use OAuth authentication to connect CRM Services and your application MyCRM registered in Azure active directory.</span></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
<span class="lwcollapsibleareatitle" style="font-weight: normal;"><span style="font-family: "arial" , "helvetica" , sans-serif;"> </span></span></h1>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">static</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">void</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> Main(</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">[] args)</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">// TODO Substitute your correct CRM root service address, </span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> resource = </span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"https://XXXX.api.crm.dynamics.com/"</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">;</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">// TODO Substitute your app registration values that can be obtained after you</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">// register the app in Active Directory on the Microsoft Azure portal.</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> clientId = </span><span style="background: yellow; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"db329e3d-4d6d-4ef2-9195-bfad1daed689"</span><span style="background: yellow; font-family: "consolas"; font-size: 9.5pt;">;</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> redirectUrl = </span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"https://birlasoft22.api.crm.dynamics.com/"</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">;</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">// Authenticate the registered application with Azure Active Directory.</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">AuthenticationContext</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> authContext =</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">AuthenticationContext</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"https://login.windows.net/common"</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">, </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">false</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">);</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">AuthenticationResult</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> result = authContext.AcquireToken(resource, clientId, </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Uri</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">(redirectUrl));</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> RunAsync(result).Wait();</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">static</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">async</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Task</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> RunAsync(</span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">AuthenticationResult</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> result)</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">using</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> (</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">var</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> client = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">HttpClient</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">())</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> client.BaseAddress = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Uri</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"https://XXXX.api.crm.dynamics.com/"</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">);</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> client.Timeout = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">TimeSpan</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">(0, 2, 0); </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">// 2 minutes</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> client.DefaultRequestHeaders.Authorization =</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">AuthenticationHeaderValue</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"Bearer"</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">, result.AccessToken);</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">HttpResponseMessage</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> response = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">await</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> client.GetAsync(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"api/data/v8.0/accounts"</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">);</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">if</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> (response.IsSuccessStatusCode)</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> s = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">await</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> response.Content.ReadAsStringAsync();</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Console</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">.Write(s);</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Console</span><span style="background: white; font-family: "consolas"; font-size: 9.5pt;">.ReadKey();</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="background: white; font-family: "consolas"; font-size: 9.5pt;"> }</span></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> }</span></h1>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Make sure to add nuGet package “Active Directory Authentication Library” in your project.<br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5ZKcQB9Q739NA8FxGYQQM6MoYh9VoVoS8L_7WlXC6wZ4eJmsc8pKYJ1xnr-xEDbXj3PFBi93VGSVG0K0wVVTF_Jj04dtjmbDfAStHYTmCPVdjPDZnywaxceGGF2nfQUMEQcgNZV2QHkM/s1600/image013.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5ZKcQB9Q739NA8FxGYQQM6MoYh9VoVoS8L_7WlXC6wZ4eJmsc8pKYJ1xnr-xEDbXj3PFBi93VGSVG0K0wVVTF_Jj04dtjmbDfAStHYTmCPVdjPDZnywaxceGGF2nfQUMEQcgNZV2QHkM/s1600/image013.jpg" /></a></div>
<div>
<span class="lwcollapsibleareatitle"><span style="font-family: "segoe ui semibold" , "sans-serif"; font-size: 14pt; font-weight: normal;"><br /></span></span></div>
<div>
<span class="lwcollapsibleareatitle" style="background-color: white; font-family: "arial" , "helvetica" , sans-serif;"><br />Output</span><span class="lwcollapsibleareatitle" style="background-color: white; font-family: "arial" , "helvetica" , sans-serif;">: Since we have not passed credentials in code, login window opens, here enter your credentials.<br /><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOvzVKGVZkmPG4JzdHy3KBphJiHglQtQJePK3qFi8oKCBKkbRZ68ULDDPuNprvZUNfKtW5KHyshNnzROYKuLmjen8ZjFQRsVankDQ2NKze2nWDnHc6GpzQI1Xd7PK126QLOazfH_kjp-c/s1600/image014.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOvzVKGVZkmPG4JzdHy3KBphJiHglQtQJePK3qFi8oKCBKkbRZ68ULDDPuNprvZUNfKtW5KHyshNnzROYKuLmjen8ZjFQRsVankDQ2NKze2nWDnHc6GpzQI1Xd7PK126QLOazfH_kjp-c/s1600/image014.png" /></a></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
</h1>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />Once you sign-in JSON response will be returned.</span></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
<span class="lwcollapsibleareatitle"><span style="font-family: "segoe ui semibold" , sans-serif; font-size: 12.5pt;"> </span></span></h1>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii9V3k_iRdCdgZiZqSOQA8Rw89TC2CDq5Kfke_Db1g7nsksAvopKzN4-pQ0iPWgzzOFVCvIQwkyPXGWDve83Glo2iadqTEFAXVN5GxZNIFB-kkRODYQZQLX2RgqLIE37PvINjI4GaDKRQ/s1600/image015.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii9V3k_iRdCdgZiZqSOQA8Rw89TC2CDq5Kfke_Db1g7nsksAvopKzN4-pQ0iPWgzzOFVCvIQwkyPXGWDve83Glo2iadqTEFAXVN5GxZNIFB-kkRODYQZQLX2RgqLIE37PvINjI4GaDKRQ/s1600/image015.jpg" /></a></div>
<h1 style="background: white; margin: 0in 0in 9pt;">
</h1>
<div style="background: white; margin: 0in 0in 9pt; text-align: left;">
<span class="lwcollapsibleareatitle"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12.5pt;"><b>Helpful Links:</b></span></span></div>
<div style="text-align: left;">
<span class="lwcollapsibleareatitle" style="font-size: 16.6667px;"><span style="font-family: Arial, Helvetica, sans-serif;"><b>https://azure.microsoft.com/en-us/documentation/articles/mobile-services-windows-store-dotnet-adal-sso-authentication/</b></span></span></div>
<div style="text-align: left;">
<span class="lwcollapsibleareatitle" style="font-size: 16.6667px;"><span style="font-family: Arial, Helvetica, sans-serif;"><b>https://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-get-started/</b></span></span></div>
<div style="text-align: left;">
<span class="lwcollapsibleareatitle" style="font-size: 16.6667px;"><span style="font-family: Arial, Helvetica, sans-serif;"><b>https://msdn.microsoft.com/en-us/library/gg327838.aspx</b></span></span></div>
<div style="text-align: left;">
<span class="lwcollapsibleareatitle" style="font-size: 16.6667px;"><span style="font-family: Arial, Helvetica, sans-serif;"><b>https://msdn.microsoft.com/en-us/library/mt595798.aspx</b></span></span></div>
<div style="text-align: left;">
<span class="lwcollapsibleareatitle" style="font-size: 16.6667px;"><span style="font-family: "segoe ui semibold" , sans-serif;"><b><span style="font-family: Arial, Helvetica, sans-serif;">https://msdn.microsoft.com/en-us/library/mt595799.asp</span><span style="font-family: segoe ui semibold, sans-serif;">x</span></b></span></span></div>
</div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com8tag:blogger.com,1999:blog-8705530331952662433.post-21997560133793290072016-03-20T03:26:00.000-07:002016-03-20T04:21:48.919-07:00Round Robin Assignment Microsoft Dynamics CRM<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><b>What is
Round Robin?</b><br /><br /><o:p></o:p></span></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif; line-height: 115%;">It is
rotation of tasks through a group. A task could be a lead, case etc. Round Robin term frequently used when to assign tasks to team members. Leads
and cases are commonly assigned through “Round Robin” </span><span style="font-family: "arial" , "helvetica" , sans-serif; line-height: 18.4px;">implementation,</span><span style="font-family: "arial" , "helvetica" , sans-serif; line-height: 115%;"> but it can used for other entities too.</span><br />
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;">In this blog, I have discussed Round Robin </span><span style="line-height: 18.4px;">assignment</span><span style="line-height: 115%;"> for leads in Microsoft Dynamics CRM, but the concept is same for other </span><span style="line-height: 18.4px;">entities too</span><span style="line-height: 115%;">.</span></span></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;"><br /></span></span></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;">In this
example, we assign newly generated lead to a member of specific team (SalesTeam), instead of doing it manually </span></span><span style="font-family: "arial" , "helvetica" , sans-serif; line-height: 18.4px;">we have done it through round robin</span><span style="font-family: "arial" , "helvetica" , sans-serif; line-height: 115%;">. Here "SalesTeam" can have variable members, and team size can change </span><span style="font-family: "arial" , "helvetica" , sans-serif; line-height: 18.4px;">any time</span><span style="font-family: "arial" , "helvetica" , sans-serif; line-height: 115%;"> (member(s) can be added or deleted).</span></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;"><br /></span></span></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;">All this is achieved through a custom entity "counter", workflow and custom activity.</span></span></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;"><br /></span></span></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;"><b>Custom Entity:</b> "counter" entity will have integer value in a field "currentcounter" and 1:N relationship between "counter" and "lead" entity. This "currentcounter" will be pointer to a member of "SalesTeam" to whom new lead should get assigned. When "currentcounter" values reaches to threshold i.e. Count of Member of "SalesTeam", it will get reset. </span></span></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;"><br /></span></span></div>
<div class="MsoNormal">
<b style="font-family: Arial, Helvetica, sans-serif; line-height: 18.4px;">Custom </b><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;"><b>Activity: </b>It provides a user(member) entity record which belongs to "SalesTeam" based on "currentcounter" value of "counter" entity and also provides next "</span></span><span style="font-family: "arial" , "helvetica" , sans-serif; line-height: 18.4px;">currentcounter"</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;"> value calculated based on no of members in team ("SalesTeam").</span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Workflow:</b> </span><span style="font-family: "arial" , "helvetica" , sans-serif;">Assign lead to a user </span><span style="font-family: "arial" , "helvetica" , sans-serif;">and update "currentcounter" value in "counter" entity by the value returned from custom activity.</span></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184; width: 727px;">
<tbody>
<tr>
<td style="background: #DBE5F1; border: solid windowtext 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 59.4pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Lead<o:p></o:p></span></b></div>
</td>
<td style="background: #DBE5F1; border-left: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.5in;" valign="top" width="144"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Sales
Team Member<o:p></o:p></span></b></div>
</td>
<td style="background: #DBE5F1; border-left: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">CurentCounter<o:p></o:p></span></b></div>
</td>
<td style="background: #DBE5F1; border-left: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 301.5pt;" valign="top" width="402"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Remarks<o:p></o:p></span></b></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 59.4pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.5in;" valign="top" width="144"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">1<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 301.5pt;" valign="top" width="402"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">“counter” and “lead” has 1:N
relationship, a record has added in “counter” entity with “currentcounter” value
set as 1, which is pointer to first member of “SalesTeam”<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 59.4pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Lead1<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.5in;" valign="top" width="144"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">USER1<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">2<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 301.5pt;" valign="top" width="402"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Condition: CountofMembers(SalesTeam)!=currentcounter
Action: INCREMENT currentcounter by 1<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 59.4pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Lead2<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.5in;" valign="top" width="144"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">USER2<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">3<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 301.5pt;" valign="top" width="402"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Condition: CountofMembers(SalesTeam)==currentcounter
Action: RESET currentcounter to 1<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 59.4pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Lead3<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.5in;" valign="top" width="144"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">USER3<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">1<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 301.5pt;" valign="top" width="402"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Condition: CountofMembers(SalesTeam)!=currentcounter
Action: INCREMENT currentcounter by 1<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 59.4pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Lead4<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.5in;" valign="top" width="144"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">USER1<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">2<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 301.5pt;" valign="top" width="402"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Condition: CountofMembers(SalesTeam)!=currentcounter
Action: INCREMENT currentcounter by 1<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 59.4pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Lead5<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.5in;" valign="top" width="144"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">USER2<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">3<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 301.5pt;" valign="top" width="402"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><i><span style="font-family: "arial" , "helvetica" , sans-serif;">One more member added to team (user4)<o:p></o:p></span></i></b></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Condition: CountofMembers(SalesTeam)!=currentcounter
Action: INCREMENT currentcounter by 1<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 59.4pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Lead6<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.5in;" valign="top" width="144"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">USER3<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">4<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 301.5pt;" valign="top" width="402"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Condition: CountofMembers(SalesTeam)==currentcounter
Action: RESET currentcounter to 1<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 59.4pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Lead7<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.5in;" valign="top" width="144"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">USER4<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">1<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 301.5pt;" valign="top" width="402"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Condition: CountofMembers(SalesTeam)!=currentcounter
Action: INCREMENT currentcounter by 1<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 59.4pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Lead8<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.5in;" valign="top" width="144"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">USER1<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">2<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 301.5pt;" valign="top" width="402"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><i><span style="font-family: "arial" , "helvetica" , sans-serif;">Two members are deleted from team (User2
and User3) <o:p></o:p></span></i></b></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Condition: CountofMembers(SalesTeam)==currentcounter
Action: RESET currentcounter to 1<b><i><o:p></o:p></i></b></span></div>
</td>
</tr>
</tbody></table>
<br />
<div>
<br /></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Initially system will have one record inserted for counter entity and have value "1" for "currentcounter" field. Based on team size the "currentcounter" value will be updated.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>*Note: Team name "SalesTeam" is hard coded and case sensitive in this example. In case you are implementing it for a different team, change its name accordingly.</b></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b><br /></b></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><u><b>Implementation Round Robin</b></u></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u><b><br /></b></u></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u><b>A. Customization</b></u></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u><b><br /></b></u></span></div>
<div>
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Create
Custom Entity “Counter”</span></span></div>
<div>
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjShdmPcrAPX85z6F_kb0T9D9nORlgy1k5dB_B7lJ33xNnMNbq3jafx2oVczkyn0uqahc7sgggszO-0U2jfZ2D2tqqNdqTw8dnpUIe3qNXeY2L2LQ15m1TYHtu_saGbVqTCZsBh2UMa5vY/s1600/entitycreate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjShdmPcrAPX85z6F_kb0T9D9nORlgy1k5dB_B7lJ33xNnMNbq3jafx2oVczkyn0uqahc7sgggszO-0U2jfZ2D2tqqNdqTw8dnpUIe3qNXeY2L2LQ15m1TYHtu_saGbVqTCZsBh2UMa5vY/s640/entitycreate.png" width="640" /></a></div>
<div>
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div>
<div class="MsoNormal">
<span style="font-size: 10pt; line-height: 115%; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="line-height: 115%; text-indent: -0.25in;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Add Field “currentcounter” to Custom
Entity “counter”</span></span></div>
<div class="MsoNormal">
<span style="font-size: 10pt; line-height: 115%; text-indent: -0.25in;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTry_ucqryGGvhrauLDQ4yzJMenKV3_WrO8AMGsiBnUjWwiypvSPoLT1Vup3Jqzk4bMI-BPIaz4WiRxHNHk1VRi6GO0fq7ELZSWMr_LsQOHbe_VcOMx4X-HqX_yE6m5L7vbtfCUdaYtyI/s1600/currentcounter.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="352" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTry_ucqryGGvhrauLDQ4yzJMenKV3_WrO8AMGsiBnUjWwiypvSPoLT1Vup3Jqzk4bMI-BPIaz4WiRxHNHk1VRi6GO0fq7ELZSWMr_LsQOHbe_VcOMx4X-HqX_yE6m5L7vbtfCUdaYtyI/s640/currentcounter.png" width="640" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 13.3333px; line-height: 15.3333px; text-indent: -24px;"><br /></span><span style="line-height: 15.3333px; text-indent: -24px;"><br /><span style="font-family: "arial" , "helvetica" , sans-serif;">Create 1:N relationship between “counter” and “lead” Entity</span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkjvdlkmGpYDs7cxNvulBY6UKgTp8665O6j9J-f-twm036x-6zXIGqOWbQ3Ow-Bt5fMdf4qEmYAhbR2InBBt94zQ_uT-8gIBFRZFFaZx7jFslOSQ6krhcjrkuq8YzqAQcZKQsMBGmkDnA/s1600/counterleadrelation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="486" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkjvdlkmGpYDs7cxNvulBY6UKgTp8665O6j9J-f-twm036x-6zXIGqOWbQ3Ow-Bt5fMdf4qEmYAhbR2InBBt94zQ_uT-8gIBFRZFFaZx7jFslOSQ6krhcjrkuq8YzqAQcZKQsMBGmkDnA/s640/counterleadrelation.png" width="640" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="line-height: 115%;"><span style="font-size: 10pt;">1</span><span style="font-family: "arial" , "helvetica" , sans-serif;">.<span style="font-stretch: normal; line-height: normal;"> </span></span></span><!--[endif]--><span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Customize “lead” Entity Form</span><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj_5LxNLQ8QTEyakqamyA3iuPgkT3akuo6rjbhmXvwuKyjwkDPdQjkbueVp5H-HINxq52fQZ3W_2KjanCgweH8V8wY1rFvC29qV6VrXZma1m-zdQoKNxn7glbdWOq-CyyoHpAY2EJeLIs/s1600/customizeleadform.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="430" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj_5LxNLQ8QTEyakqamyA3iuPgkT3akuo6rjbhmXvwuKyjwkDPdQjkbueVp5H-HINxq52fQZ3W_2KjanCgweH8V8wY1rFvC29qV6VrXZma1m-zdQoKNxn7glbdWOq-CyyoHpAY2EJeLIs/s640/customizeleadform.png" width="640" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Add
relational lookup to the lead entity form and change its visibility setting
from field properties.</span><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia8klCIZTNpqS4TBKoqeskt_rL0Y9ffr9UbW3I7ZWTLorDzH5YCAfM_a6R4b8MHLmaNSOqNcMXyClsftxfitTlaHgTU65sHs1WFmJ_VaAXo1kKNm81PC7rdH9coytkcH0lwsESYRqnEFA/s1600/changevisibility.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="432" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia8klCIZTNpqS4TBKoqeskt_rL0Y9ffr9UbW3I7ZWTLorDzH5YCAfM_a6R4b8MHLmaNSOqNcMXyClsftxfitTlaHgTU65sHs1WFmJ_VaAXo1kKNm81PC7rdH9coytkcH0lwsESYRqnEFA/s640/changevisibility.png" width="640" /></a></div>
<div class="MsoNormal">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;"><b>Save
</b>and <b>Publish </b>your changes, and a</span><span style="line-height: 115%;">dd
an entity record for counter entity</span></span></div>
<div class="MsoNormal">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZPk584rhijudVt0m6gVCP6jMzuk1ol4pwdMmKfwavOLmzNqXOVzD9s-COIh5Il_YCo-UHoyfytytNM2Eo8OaxRLA0X-u01c8YjfiwiJ-eF4jOmxHpghgEMt5KnF34CeVGnOxdXxYLmZw/s1600/newcounter.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZPk584rhijudVt0m6gVCP6jMzuk1ol4pwdMmKfwavOLmzNqXOVzD9s-COIh5Il_YCo-UHoyfytytNM2Eo8OaxRLA0X-u01c8YjfiwiJ-eF4jOmxHpghgEMt5KnF34CeVGnOxdXxYLmZw/s640/newcounter.png" width="640" /></a></div>
<div class="MsoNormal">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 10.0pt; line-height: 115%;"><br /></span><u style="font-family: Arial, Helvetica, sans-serif; text-indent: 0px;"><b>B. SDK - Custom </b></u><span style="font-family: "arial" , "helvetica" , sans-serif;"><b><u>Activity</u></b></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1;">
<span style="line-height: 115%;"><br /><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Create custom activity and register it in Plug-in Registration Tool.</span></span></span></div>
</div>
<div>
<br /></div>
<style>
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Microsoft Sans Serif";
panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin-top:0in;
margin-right:0in;
margin-bottom:10.0pt;
margin-left:0in;
line-height:115%;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
.MsoChpDefault
{font-family:"Calibri","sans-serif";}
.MsoPapDefault
{margin-bottom:10.0pt;
line-height:115%;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
</style>
<br />
<div class="WordSection1">
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">using</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
Microsoft.Xrm.Sdk;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">using</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
Microsoft.Xrm.Sdk.Query;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">using</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
Microsoft.Xrm.Sdk.Workflow;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">using</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
System;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">using</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
System.Activities;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">using</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
System.Collections.Generic;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">using</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
System.Linq;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">using</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
System.Text;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">using</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
System.Threading.Tasks;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">namespace</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> POC.AssignCounter</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">{</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">public</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">sealed</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">partial</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">class</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">GetUseronCounter</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> : </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">CodeActivity</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">protected</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">override</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">void</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> Execute(</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">CodeActivityContext</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> executionContext)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">try</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">IWorkflowContext</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
context = executionContext.GetExtension<</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">IWorkflowContext</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">>();</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">IOrganizationServiceFactory</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> serviceFactory =</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
executionContext.GetExtension<</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">IOrganizationServiceFactory</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">>();</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">IOrganizationService</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
service =</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> serviceFactory.CreateOrganizationService(context.UserId);</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: green; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">//Get entity from InArgument</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">Entity</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> counter = service.Retrieve(</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"new_counter"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">,</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">this</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">.InputEntity.Get(executionContext).Id, </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">new</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">ColumnSet</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">(</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"new_currentcounter"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">));</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">if</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> (counter.Contains(</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"new_currentcounter"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">))</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: green; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">//Fetch xml to get users of a team. Here one user
will be returned per page and page position will be</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: green; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">//decided on current counter value.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">string</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
xmlquery = </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"<fetch version=\"1.0\"
mapping=\"logical\" distinct=\"true\" page=\""</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> + (</span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">int</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">)counter[</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"new_currentcounter"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">] + </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"\"
count=\"1\" returntotalrecordcount=\"true\">"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> +</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"<entity
name=\"systemuser\">"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
+</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"<attribute
name=\"systemuserid\" />"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
+</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"<order
attribute=\"fullname\" descending=\"false\" />"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> +</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"<link-entity
name=\"teammembership\" from=\"systemuserid\"
to=\"systemuserid\" visible=\"false\"
intersect=\"true\">"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
+</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"<link-entity name=\"team\"
from=\"teamid\" to=\"teamid\" alias=\"aa\">"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> +</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"<filter
type=\"and\">"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
+</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"<condition
attribute=\"name\" operator=\"eq\"
value=\"SalesTeam\" />"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
+</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"</filter>"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> +</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"</link-entity>"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> +</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"</link-entity>"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> +</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"</entity>"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> +</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"</fetch>"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">FetchExpression</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> query = </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">new</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">FetchExpression</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">(xmlquery);</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">EntityCollection</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> users = service.RetrieveMultiple(query);</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: green; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">//Set out argument OutputEntity- first user
entity of resultset.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">this</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">.OutputEntity.Set(executionContext, </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">new</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">EntityReference</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">(</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"systemuser"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">, </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">new</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">Guid</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">(users[0].Attributes[</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"systemuserid"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">].ToString())));</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">int</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
newcounter = 1;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: green; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">//Counter value should not exceed to total member
count of team, in case if it exceeds </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: green; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">//that means user has been deleted from team.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">if</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> ((</span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">int</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">)counter[</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"new_currentcounter"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">] >= users.TotalRecordCount)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: green; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">//Set default value 1</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> newcounter = 1; </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> }</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">else</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: green; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">//Increment by 1 current counter value</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> newcounter = (</span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">int</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">)counter[</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"new_currentcounter"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">] + 1;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> }</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: green; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">//Set out argument OutputCounter- new counter
value, that will be further</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: green; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">//used by workflow to update counter entity.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">this</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">.OutputCounter.Set(executionContext,
newcounter);</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> } </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> }</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">catch</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> (</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">Exception</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> ex)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">throw</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">new</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">InvalidPluginExecutionException</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">(</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"GetUseronCounter
ERROR>>>>>: "</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">
+ ex.StackTrace.ToString(), ex);</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> }</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> }</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> [</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">RequiredArgument</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">]</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> [</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">Input</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">(</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"Counter"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">)]</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> [</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">ReferenceTarget</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">(</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"new_counter"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">)]</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">public</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">InArgument</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"><</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">EntityReference</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">> InputEntity { </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">get</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">; </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">set</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">; }</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> [</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">Output</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">(</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"user"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">)]</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> [</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">ReferenceTarget</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">(</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"systemuser"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">)]</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">public</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">OutArgument</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"><</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">EntityReference</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">> OutputEntity { </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">get</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">;
</span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">set</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">;
}</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> [</span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">Output</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">(</span><span style="background: white; color: #a31515; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">"NewCounter"</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">)] </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">public</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> </span><span style="background: white; color: #2b91af; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">OutArgument</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"><</span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">int</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">> OutputCounter { </span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">get</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">;
</span><span style="background: white; color: blue; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">set</span><span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">;
}</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;"> }</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt; margin-bottom: 0in;">
<span style="background: white; color: black; font-family: "microsoft sans serif" , "sans-serif"; font-size: 10.0pt;">}</span></div>
<div class="MsoNormal">
<br /></div>
</div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<u style="font-family: Arial, Helvetica, sans-serif; text-indent: -0.25in;"><b><br />C. Workflow Creation</b></u><span style="font-size: 10pt; line-height: 115%; text-indent: -0.25in;"><span style="font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: 7pt; font-stretch: normal; line-height: normal;"></span></span><!--[endif]--><span style="line-height: 115%;"><br /><span style="font-family: "arial" , "helvetica" , sans-serif;">Create a synchronous workflow </span><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWH3XO224JNDrHPCaJ81E5eyKwJM6dW8N4SQECH1iRsBQS7Fje42hJFVWkcs6p3h72ARUCZDnufMDTHmLkVjGkWOdh3TjLoxjkrO2mB-ItKx13MQrIEl7J2pzgfl1ZaBmRV11_txhwDY8/s1600/workflow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="350" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWH3XO224JNDrHPCaJ81E5eyKwJM6dW8N4SQECH1iRsBQS7Fje42hJFVWkcs6p3h72ARUCZDnufMDTHmLkVjGkWOdh3TjLoxjkrO2mB-ItKx13MQrIEl7J2pzgfl1ZaBmRV11_txhwDY8/s640/workflow.png" width="640" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 115%;"> When a new lead is created in system, this real time workflow will get triggered. And all the steps defined will execute in order.</span><br /><br /><b style="font-style: italic; line-height: 115%;">Step 1</b><span style="line-height: 115%;">:
Set a counter value for newly created lead. A lead can be created from web forms or through SDK calls. We don't want user to select counter entity every time whenever a new lead is created in system. Also there is a relationship between counter and leads, therefore a counter record needs to be set for lead and round robin </span><span style="line-height: 18.4px;">implementation</span><span style="line-height: 115%;">.</span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgWqOSkhO8jpTx5CnPzIAN-aUqRNQyIztS-VfyFph2Dzph6AA_TaFm0YPkuep4gIRUVQ6PiRYWcdV3QjL9moyLfbe0KQHsiQY2NOWUc-oolbsBUrSiK0ttUTo0FZwRbev13kwVwiOh4qQ/s1600/assigncountertoleadstep1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="326" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgWqOSkhO8jpTx5CnPzIAN-aUqRNQyIztS-VfyFph2Dzph6AA_TaFm0YPkuep4gIRUVQ6PiRYWcdV3QjL9moyLfbe0KQHsiQY2NOWUc-oolbsBUrSiK0ttUTo0FZwRbev13kwVwiOh4qQ/s640/assigncountertoleadstep1.png" width="640" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span><b style="font-family: Arial, Helvetica, sans-serif; line-height: 18.4px; text-indent: -24px;"><i>Step 2</i></b><span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;">: Custom activity will be called, it takes the counter entity assigned to the lead.</span></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVX8244kvTxIACo3K2BPdNZ_HqK0-vKWh3wgx_kNFMhPg0oOkZMZLoP65iIED3KCNKJHLUKzfrNzlzfTeqvNV3uPR-XnmRkXv5UzVf5lQLym-g-J0HMf5cthEkmuQkuQZexfFJkZ8HKwI/s1600/step2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVX8244kvTxIACo3K2BPdNZ_HqK0-vKWh3wgx_kNFMhPg0oOkZMZLoP65iIED3KCNKJHLUKzfrNzlzfTeqvNV3uPR-XnmRkXv5UzVf5lQLym-g-J0HMf5cthEkmuQkuQZexfFJkZ8HKwI/s640/step2.png" width="640" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%;"><br /><span style="font-family: "arial" , "helvetica" , sans-serif;">The above activity will be returning two parameter, one will be the user to whom leads should be assigned and the other will the next "currentcounter" value</span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<b style="font-family: Arial, Helvetica, sans-serif; line-height: 18.4px; text-indent: -24px;"><i><br />Step 3</i></b><span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;">: Update the "counter" entity's "currentcounter" field value by the updated value returned from Step2.</span></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZaGXFeDtKUWsD9hTPKyW8b6RYID9ibDSyPb2nBIbAKndNdPoH_-3a7sVI-VA9fAMw-EITIWN9Mho95x-0EGqLXVVkHSR97qVVnych5Jc-35MQrxQAdvF07OaPVAxsmMWN7guka30OmPk/s1600/step3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="172" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZaGXFeDtKUWsD9hTPKyW8b6RYID9ibDSyPb2nBIbAKndNdPoH_-3a7sVI-VA9fAMw-EITIWN9Mho95x-0EGqLXVVkHSR97qVVnych5Jc-35MQrxQAdvF07OaPVAxsmMWN7guka30OmPk/s640/step3.png" width="640" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 18.4px; text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /><i><b>Step 4</b></i>: Assign lead to the returned system user from custom workflow activity Step 2. </span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkmLrbTddFfYPcvagnRBKD5h_zmhjKK3M1JnIZxmEhCYqklTTTXcolWL2XUgBhXB6fUHmjnZEddDu4HtTd3JdcQJUDNmeXvGkx5JeUCAKe290MQTXuz0ySZm0c2jR9ewynouYNzTUT3Kw/s1600/step4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkmLrbTddFfYPcvagnRBKD5h_zmhjKK3M1JnIZxmEhCYqklTTTXcolWL2XUgBhXB6fUHmjnZEddDu4HtTd3JdcQJUDNmeXvGkx5JeUCAKe290MQTXuz0ySZm0c2jR9ewynouYNzTUT3Kw/s640/step4.png" width="640" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="text-indent: -24px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18.4px;"><br /></span></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<i style="font-family: Arial, Helvetica, sans-serif; line-height: 18.4px; text-indent: -24px;"><b><br />Step 5</b></i><span style="font-family: "arial" , "helvetica" , sans-serif; line-height: 18.4px; text-indent: -24px;">: Stop the workflow with "Success"</span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<i style="font-family: Arial, Helvetica, sans-serif; line-height: 18.4px; text-indent: -24px;"><b><br />Step 6</b></i><span style="font-family: "arial" , "helvetica" , sans-serif; line-height: 18.4px; text-indent: -24px;">: <b>Save </b>and <b>Activate </b>workflow.</span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<u style="font-family: Arial, Helvetica, sans-serif; text-indent: 0px;"><b><br />Test - Implementation Round Robin</b></u></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%; text-indent: -0.25in;"><br /><span style="font-family: "arial" , "helvetica" , sans-serif;">Create Sales Team and add members</span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%; text-indent: -0.25in;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyWn8xZt9UniQZ1v2Of3eSeTgCkQf3rKZ91zGiTDmkpWsNHxQmWK9UCtxNNvBkVKaiMs_gwEULb9JVTyW0RIHe-TUpS71r-C88IE2cRutLDosy8onUIvaeqhwud7nab3jUD3wd9lJCmgs/s1600/salesteam.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyWn8xZt9UniQZ1v2Of3eSeTgCkQf3rKZ91zGiTDmkpWsNHxQmWK9UCtxNNvBkVKaiMs_gwEULb9JVTyW0RIHe-TUpS71r-C88IE2cRutLDosy8onUIvaeqhwud7nab3jUD3wd9lJCmgs/s640/salesteam.png" width="640" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%; text-indent: -0.25in;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /><br />Create leads in system it will be
auto assigned to Sale’s team members.</span><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixoNWG7mlprHXVimc2NZDUlxw9vr4okFJti4DaMvMTfUMmHmSFMP2u7MZvPklbAJYRIy3g7IhpkSxO0yP_1yyV892IaZixoA6uF62p1jCzNMmp8m7B9JZxHS4YjjpNYso8578xjhzT7Yw/s1600/ls.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixoNWG7mlprHXVimc2NZDUlxw9vr4okFJti4DaMvMTfUMmHmSFMP2u7MZvPklbAJYRIy3g7IhpkSxO0yP_1yyV892IaZixoA6uF62p1jCzNMmp8m7B9JZxHS4YjjpNYso8578xjhzT7Yw/s640/ls.png" width="640" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />You can add or delete members to team, round robin will assign leads to a member of team.</span></span><br />
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="line-height: 115%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
</div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com4tag:blogger.com,1999:blog-8705530331952662433.post-61643859627209395722016-03-18T04:23:00.000-07:002016-03-18T05:14:45.454-07:00Configuring Shared Mailbox Microsoft Dynamics CRM Online and Exchange Online<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "arial" , sans-serif;">Many of us have sent emails to
support team for any issue related to any product, services etc. Business
has their dedicated or shared customer support that respond to the
customer queries through emails, phone, fax etc. </span><o:p></o:p></div>
<div style="margin: 0in 0in 0.0001pt;">
<br /></div>
<br />
<div style="margin: 0in 0in 0.0001pt;">
<span style="font-family: "arial" , sans-serif;">Business asks you to design customer support for their product and services. Business will provide a support email to all there valuable customers. Customers will send queries and concerns on this support email. That will be queued in Microsoft Dynamics CRM and assigned to dedicated members of a team (round robin) for handling requests and respond to customer's email with a solution or escalate the issue further. In the entire process the employee/members can send email through their individual mailbox or by support mailbox.</span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4KVMRMdFxGKbFxJ8HWZi28Yp0S2gljkyKSaFP5EimmtiPF_h2ITT2lucEO5rFIDqks0FsgB8JLSP2j4NM3jynBSaAyH0W19jEPT7fZDRtYS3xREklnstLwcoSqXB_RQhxgpkRRyOIv3A/s1600/Drawing1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4KVMRMdFxGKbFxJ8HWZi28Yp0S2gljkyKSaFP5EimmtiPF_h2ITT2lucEO5rFIDqks0FsgB8JLSP2j4NM3jynBSaAyH0W19jEPT7fZDRtYS3xREklnstLwcoSqXB_RQhxgpkRRyOIv3A/s1600/Drawing1.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small;">Mailbox and CRM Queue</span></td></tr>
</tbody></table>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b><u>Configure Shared Mailbox</u></b></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b><br /></b></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Administrators can configure or create shared mailboxes in exchange on-line.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio4ntuYZggJqlPHgI766kNvhBl8q974ahwaPekM1bOollkceAkw2kmhHe35QwOqglpNsd6L-OJKqFq51YmWzmBDbTytLjEV5Xx_zrmPX_3cwD0Y0zFWyLuo-imuaRBGEw4rUjd6h5WGrM/s1600/sharedmailbox.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="370" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio4ntuYZggJqlPHgI766kNvhBl8q974ahwaPekM1bOollkceAkw2kmhHe35QwOqglpNsd6L-OJKqFq51YmWzmBDbTytLjEV5Xx_zrmPX_3cwD0Y0zFWyLuo-imuaRBGEw4rUjd6h5WGrM/s640/sharedmailbox.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small;">Shared Mailbox - Exchange On-line</span></td></tr>
</tbody></table>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />Enter name, email address and Members (who monitor and send email from this shared mailbox).</span><br />
<br />
<b style="font-family: Arial, Helvetica, sans-serif;"><u>Configure Queue Microsoft Dynamics CRM</u></b><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Create a queue in Microsoft Dynamics CRM.</span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSM1gQn3ywgwRvMHkRIKamtqgq7ABhGD_yGgvhmaC-YLR2f-QkNPVv0IzdAamWB4C9MZBx_GdUJsf_wNEnP9ev-Mz4NohcYuusv7fntaEV4FNRHQdFnjSkLyfGn9KrzmGGIeyMiWdfjIM/s1600/queue.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSM1gQn3ywgwRvMHkRIKamtqgq7ABhGD_yGgvhmaC-YLR2f-QkNPVv0IzdAamWB4C9MZBx_GdUJsf_wNEnP9ev-Mz4NohcYuusv7fntaEV4FNRHQdFnjSkLyfGn9KrzmGGIeyMiWdfjIM/s640/queue.png" width="460" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small;">Shared Queue Configuration</span></td></tr>
</tbody></table>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Shared mailbox and Incoming email id should be same. "Convert Incoming Email to Activities" option will convert the incoming emails to email activity in CRM system.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<b style="font-family: Arial, Helvetica, sans-serif;"><u>Configure Queue Mailbox Microsoft Dynamics CRM</u></b><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Configure queue mailbox for incoming emails</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTJMzR_vNqShBNpgFLbNumE2v9lKEUAIOK2f_Hg6uNz_8ANjb_4lpcgghzRX3yF8syu8vFXeg9IlOT_2ovbKlG1PeIlpbtgCUm9odSkvmnSR4NvAbub4yZsLe7Zp-rMr-nm5o3ITvbdAU/s1600/sharedmailbox1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="428" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTJMzR_vNqShBNpgFLbNumE2v9lKEUAIOK2f_Hg6uNz_8ANjb_4lpcgghzRX3yF8syu8vFXeg9IlOT_2ovbKlG1PeIlpbtgCUm9odSkvmnSR4NvAbub4yZsLe7Zp-rMr-nm5o3ITvbdAU/s640/sharedmailbox1.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small;">Shared Mailbox Configuration</span></td></tr>
</tbody></table>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Both Incoming and Outgoing Email synchronization method should be "Server Side".</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Click Save, Approve Email and Test and Enable Mailboxes.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u><b>Send Email To Shared Mailbox</b></u></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkrY3BjFUfEXUq_ODQ5qzBpgpbrp3QSglDSZ_1BZt1w2CT79Xp3VUPLK6ZSJuSVk6PTsC_gKE0RiHlCg6AJpM3IzTEGsgdBrhLM2m2h1r3Abl_4iJ3apImcl39THLfOzdgKbDZRP4U-1g/s1600/outlook1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkrY3BjFUfEXUq_ODQ5qzBpgpbrp3QSglDSZ_1BZt1w2CT79Xp3VUPLK6ZSJuSVk6PTsC_gKE0RiHlCg6AJpM3IzTEGsgdBrhLM2m2h1r3Abl_4iJ3apImcl39THLfOzdgKbDZRP4U-1g/s640/outlook1.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Email send to Shared Mailbox</span></td></tr>
</tbody></table>
<br />
<u style="font-family: Arial, Helvetica, sans-serif;"><b>Track Send Email In Shared Queue</b></u><br />
<u style="font-family: Arial, Helvetica, sans-serif;"><b><br /></b></u>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Email will be synchronized in Shared Queue. </span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgtqJ9wdPpwZ325sJRNpjmlCRoR6Eq8zyCxBNtJxZm7O009tLUPP8XKt7rtqzD2cnjtv9-ttyRtwRZIUEG5o49Mi1NxWBT4s1uM-HmerP_9BKQ39jN4fCapE_L7sL4WWcNO7MjPO_m5q8/s1600/Queue1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgtqJ9wdPpwZ325sJRNpjmlCRoR6Eq8zyCxBNtJxZm7O009tLUPP8XKt7rtqzD2cnjtv9-ttyRtwRZIUEG5o49Mi1NxWBT4s1uM-HmerP_9BKQ39jN4fCapE_L7sL4WWcNO7MjPO_m5q8/s640/Queue1.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small;">Receive email added as Queue item</span></td></tr>
</tbody></table>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Open email activity from shared queue, here user has can reply to that email by their email id or they can select Shared Queue email address in "From" look up field.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidhnPhoJFn2RMn5oVmxBzQ4Jd_Cykn7O_AqPkVU3alckmpY6mYPfgJA-v6FfdTcSq72x35EA2r7WebkmPvD6tuOHJPfQyvzRPYuA2gMwu69MeVBcu9yyCQMII_kiMHfCJ5Qm5MCzHL4nI/s1600/from1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="492" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidhnPhoJFn2RMn5oVmxBzQ4Jd_Cykn7O_AqPkVU3alckmpY6mYPfgJA-v6FfdTcSq72x35EA2r7WebkmPvD6tuOHJPfQyvzRPYuA2gMwu69MeVBcu9yyCQMII_kiMHfCJ5Qm5MCzHL4nI/s640/from1.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: arial, helvetica, sans-serif; font-size: small;">Reply from User Mailbox</span></td></tr>
</tbody></table>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-rZjBii0tWHAoseiXDvvsjXYik_dvhX9QDdwvsNATrv6jAFKLXAPU7iwz1oNBOtwO9lF24GdsUvR4O33klJ6k7ligT-eBA6SfSpVgt9DEgU-MVMQe6HFw5QFL36JZAmugFPd-nAOMKBU/s1600/from2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="434" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-rZjBii0tWHAoseiXDvvsjXYik_dvhX9QDdwvsNATrv6jAFKLXAPU7iwz1oNBOtwO9lF24GdsUvR4O33klJ6k7ligT-eBA6SfSpVgt9DEgU-MVMQe6HFw5QFL36JZAmugFPd-nAOMKBU/s640/from2.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small;">Reply from Shared Mailbox</span></td></tr>
</tbody></table>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Incoming emails are converted to activities in CRM system. Activities can be assigned to user(s)/member(s) either manually or through any automated process. </span><br />
<br />
<br /></div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com15tag:blogger.com,1999:blog-8705530331952662433.post-18935078750484453482016-03-17T07:30:00.000-07:002016-03-17T21:55:33.463-07:00Configuring Forward Mailbox in Microsoft Dynamics CRM and Exchange Online<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<br /></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">For incoming emails you can use either of mailbox configuration.</span><br />
<br />
<ul style="text-align: left;">
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Individual Mailbox - Each CRM user has its own incoming and outgoing server synchronization set up.</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Forward Mailbox- A centralized mailbox at exchange, CRM monitors this mailbox for incoming messages. And all CRM user's mailbox monitors this Forward mailbox.</span></li>
</ul>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Forward mailbox reduces administrative effort. To configure forward mailbox, adminstrators would require to do configuration (Create rules to send incoming emails to Centralized mailbox) both at Exchange and CRM end.</span></div>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Configuration Exchange On-line</span></b><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4Rzg4Bylh5gghtfwim5_yEhe8iWHasI4P-XLEAM3jaE2yNTmZ46lBcv15ZefKtiKCr6nNYswiAW_Gr5QcOuEjVNRKGf3EYmvbwOev7QosCVviC6hRwOYHMTEQfInIi1-FRKuQxg1Xhlg/s1600/Drawing1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif;"></span></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCZ5vVm8oX3pHomlQ6zotoqV8vleHrxZeOOfO8WCjcTZ7gRpiLYXK1rDwBSyX16THP3s0hU8j5SEo28qKzKMHoPg5550EmgaufabCwWBoquqrY7iDOFPm1K7pujFWDAq5auSYnYl71-LY/s1600/Drawing1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCZ5vVm8oX3pHomlQ6zotoqV8vleHrxZeOOfO8WCjcTZ7gRpiLYXK1rDwBSyX16THP3s0hU8j5SEo28qKzKMHoPg5550EmgaufabCwWBoquqrY7iDOFPm1K7pujFWDAq5auSYnYl71-LY/s1600/Drawing1.png" /></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">In the above diagram, Mailbox 1, Mailbox 2 and Mailbox 3 have rules on incoming emails, if rule condition matches then incoming email is forwarded as attachment to Mailbox 4.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCUArBS74CQB1WC1XlHoWuOz01o3lkEv_QgP5RiqlnkSV4cdULmAMaLgQ7UXxY9bhmzsfGiCk_Z1Q98cjHRMuMW6Wj9mhpoNTG5sx7FXXt6YSGza5f_EcvjgUzH-VZbgm5Fnu8G2S5By0/s1600/Untitled.png" style="margin-left: auto; margin-right: auto;" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Rule - Exchange Online</span></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCUArBS74CQB1WC1XlHoWuOz01o3lkEv_QgP5RiqlnkSV4cdULmAMaLgQ7UXxY9bhmzsfGiCk_Z1Q98cjHRMuMW6Wj9mhpoNTG5sx7FXXt6YSGza5f_EcvjgUzH-VZbgm5Fnu8G2S5By0/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif;"></span></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Configuration Microsoft Dynamics CRM</span></b><br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></b>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><u>Add Forward Mailbox</u></span><br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></b>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Go to Settings, Email configuration.then click mailboxes. Click Add new forward mailbox. </span><br />
<br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbvjW-Rp4QQ108Fly35kU5n7mH94byzTQ8ltN2BwyuTYwOZUoE8NdSl6N2fG4-ydt5YN7N_Mg-jY4eXHi9gJl65hP4RaPRCTmgzVK9jAJiJAcvTcRx_2qyLMIYPncsq3UrN1mI9XKsWsc/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbvjW-Rp4QQ108Fly35kU5n7mH94byzTQ8ltN2BwyuTYwOZUoE8NdSl6N2fG4-ydt5YN7N_Mg-jY4eXHi9gJl65hP4RaPRCTmgzVK9jAJiJAcvTcRx_2qyLMIYPncsq3UrN1mI9XKsWsc/s1600/Untitled.png" /></a></div>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></b>
<span style="font-family: "arial" , "helvetica" , sans-serif;">*Note: </span><br />
<br />
<ul style="text-align: left;">
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Email address will be your exchange email address (Mailbox that receives all the forwarded emails)</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Server Profile should be Microsoft Exchange Online (If exchange is hosted in office 365)</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Incoming Email should have server side synchronization. </span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Forward mailboxes does not have Outgoing email synchronization. It should be set "None"</span></li>
</ul>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Click Save, Approve Email and Test and Enable Mailboxes.</span><br />
<br />
<br />
<br />
<u style="font-family: Arial, Helvetica, sans-serif;">Update User Mailbox - Change Synchronization Method (Incoming Email)</u><br />
<u style="font-family: Arial, Helvetica, sans-serif;"><br /></u>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Open any existing user mailbox and change incoming synchronization from "</span><span style="font-family: "arial" , "helvetica" , sans-serif;">server side synchronization" to "forward mailbox".</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIup0SuXAab8oNnio7UrHsEx6XtJWANjNiG6st6sareioLqp8bNiOlHTQe42FgNznmwJzxzUUiQCy6GxFa5twGBQARppNkiTxfiF-Pn4q5i81Rz458wd_qqyyP6oAvEr4DtyY5s57NZiE/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIup0SuXAab8oNnio7UrHsEx6XtJWANjNiG6st6sareioLqp8bNiOlHTQe42FgNznmwJzxzUUiQCy6GxFa5twGBQARppNkiTxfiF-Pn4q5i81Rz458wd_qqyyP6oAvEr4DtyY5s57NZiE/s1600/Untitled.png" /></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></b>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Click Save and Test and Enable Mailboxes.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Now you are all set to receive emails from forward mailbox in MS CRM. </span><br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></b>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></b></div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com5tag:blogger.com,1999:blog-8705530331952662433.post-88210976389513971312016-03-14T04:50:00.001-07:002016-03-14T22:24:07.312-07:00Microsoft Dynamics Event Execution Pipeline<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Every action in Microsoft Dynamics CRM subscribes to an event. Every action perform on CRM client are handled by Organization web service, which is part of CRM server. There are ways to extract data from dynamics CRM. Example</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">1. Web API</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">2. Organization Data Services (Deprecated in 2016)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">3. Organization Service - SOAP endpoints</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Each of these methods are wrapper to fetch CRM data which internally linked to the CRM server organization web service. </span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFPhCIkrZhyfJrAxB4GeM3twI3pHRGtRUS3gg1S0NGy9vCtNtUumK3to1l_Kvc2spz6zBH-uwfEM2JmpkyzzkBVI11pEvv0_rk-VswgrDQFUFwtT349r2DLfOlChIRBpmksMXAJxNI_3U/s1600/webserviceendpoint.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFPhCIkrZhyfJrAxB4GeM3twI3pHRGtRUS3gg1S0NGy9vCtNtUumK3to1l_Kvc2spz6zBH-uwfEM2JmpkyzzkBVI11pEvv0_rk-VswgrDQFUFwtT349r2DLfOlChIRBpmksMXAJxNI_3U/s1600/webserviceendpoint.png" /></a></div>
<br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">When any event is raised in CRM system, Server generates Organization web service request message which is then passed to series of stages. Stage 10 Pre-Validation, stage 20 Pre-Operation and stage 40 Post-Operation are only available for the Plug-in registration.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Any WEB API HTTP request to update a property of an entity will be internally catered by Organization web service. </span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-xa5Tfr5axNOmvfTwD-oGUgPD2K9IPMbB2pdy5uLwYMV6P4TFPvPSJ-7-pdlNsRonnrgbpw6_1m9u_jwKoYYIYUz6RTZZV5V_JwTR_1EizT7y-9_9Ot3niMNPgR7pqSFZtJHuvjjEfYA/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-xa5Tfr5axNOmvfTwD-oGUgPD2K9IPMbB2pdy5uLwYMV6P4TFPvPSJ-7-pdlNsRonnrgbpw6_1m9u_jwKoYYIYUz6RTZZV5V_JwTR_1EizT7y-9_9Ot3niMNPgR7pqSFZtJHuvjjEfYA/s1600/Untitled.png" /></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">In the above flow, organization request passes from stage 10 to stage 40, each of the stage has significance and can update the organization message accordingly.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Stage 10: Pre-Validation: Use this stage when to perform any task prior to any security check. An example, transaction amount should be greater than $500. If user has entered any value in transaction amount field which is less than expected value then the whole execution process should be aborted. Also Stage 10 is not part of database transaction, any create, update or delete operation perform on any entity will not roll back in case any exception raised in stage 20, 30 and 40. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Stage 20: Pre-Operation: Use this stage when you want to perform any operation before the main operation in database transaction. An example, you want to log some </span><span style="font-family: "arial" , "helvetica" , sans-serif;">analytic</span><span style="font-family: "arial" , "helvetica" , sans-serif;"> </span><span style="font-family: "arial" , "helvetica" , sans-serif;">data in custom entity before main operation performs. However you want any exception in Main operation will also roll-back custom entity record. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Plug-in code in pre-operation runs under the security context of the user (Calling, Adminstrator, System etc). In case user does not have permission on entity, properties or entity images, then the process will be aborted and exception will thrown by system.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Stage 30: Main Operation: You cannot register Plugins in this stage, this is reserved for system core operation. Main operation executes in the context of impersonated user. In case impersonated user doesn't have sufficient privileges, the core system operation will be aborted and exception will be thrown.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">On successful execution, an organization response message will be generated and passed to the next stage.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Stage 40: Use this stage when to perfom any operation after the main operation. An example, whenever an account is created it must be assigned to some agent. So account has been created in stage 30, and response message will be having GUID value populated in ID field. You can use this id value and assign it to some agent.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">*Stage 20, 30 and 40 executes in database transaction. Any exception in either of stage will roll-back the whole transaction i.e. error in stage 40 will roll back stage 30 and stage 20 operations. However any operation performed in stage 10 will not roll back.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">The final response message is send back to the client. </span></div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com8tag:blogger.com,1999:blog-8705530331952662433.post-71783571752776152152015-11-17T01:22:00.002-08:002015-11-17T10:01:01.004-08:00Microsoft Dynamics CRM Querying Data - QueryByAttribute<div dir="ltr" style="text-align: left;" trbidi="on">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin-top:0in;
margin-right:0in;
margin-bottom:10.0pt;
margin-left:0in;
line-height:115%;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{font-family:"Calibri","sans-serif";}
.MsoPapDefault
{margin-bottom:10.0pt;
line-height:115%;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
</style>
<br />
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Same like QueryExpression, QueryByAttribute is also derived from QueryBase class and is used to fetch CRM data. </span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /><b><u>When to use QueryByAttribute?</u></b></span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b><u><br /></u></b>Let me explain QueryByAttribute logic with the help of SQL Query.</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />1. When your query is quite simple e.g (Select Name, Age, Salary from Account where Age=20 and Salary = 5000).</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />2. When you want to get data for single entity say "account", "contact" etc (Inner/Outer Joins not supported) at a time.</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />3. Does not support <span style="color: red;"><b>OR </b></span>condition, it only supports <span style="color: #274e13;"><b>AND </b></span>Condition. e.g. If you want to achieve (Select Name, Age, Salary from Account where Age=20 <b><span style="color: red;">OR </span></b> Salary = 5000) which is not possible through QueryByAttribute.</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />4. Only Equal Operator is supported e.g (Select Name, Age, Salary from Account where Age>20 AND Salary = 5000), Age<b><span style="color: red;">></span></b>20 condition is not be supported in QueryByAttribute.</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />5. It must have one AttributeValue specified e.g (Select Name, Age, Salary from Account) will throw exception, since there is no where clause specified.</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span><span style="font-family: "arial" , "helvetica" , sans-serif;">6. Supports Pagination (both backward and forward) and Ordering</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /><br /><u><span style="color: #660000;">Sample Code</span></u><br />Suppose we have a requirement where we have to fetch firstname and lastname of accounts where it belongs to city Redmond and firstname should be in descending order. The same requirement will be written in SQL Query given below.<br /><br /><b><i>Select name, accountnumber, address_city from account where address1_country="U.S." order by name desc</i></b></span><span style="font-family: "arial" , "helvetica" , sans-serif;"><i><br /></i>
The same query logic in QueryByAttribute.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="color: blue; font-family: "arial" , "helvetica" , sans-serif;"><u>Example: Without Pagination</u></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div class="WordSection1">
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">QueryByAttribute</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> myQuery = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">QueryByAttribute</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"account"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">);</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">myQuery.ColumnSet = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">ColumnSet</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"name"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">, </span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"accountnumber"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">, </span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"address1_city"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">);</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">myQuery.AddAttributeValue(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"address1_country"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">, </span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"U.S."</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">);</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">myQuery.AddOrder(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"name"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">OrderType</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">.Descending);</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">EntityCollection</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> resultset=
orgproxy.RetrieveMultiple(myQuery);</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">foreach</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> (</span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Entity</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> acct
</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">in</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> resultset.Entities)</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Console</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">.WriteLine(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"AccountName:{0}
\t AccountNumber: {1}\t City: {2}"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">, acct.GetAttributeValue<</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">>(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"name"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">),
acct.GetAttributeValue<</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">>(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"accountnumber"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">),
acct.GetAttributeValue<</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">>(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"address1_city"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">));</span></span></div>
<div class="MsoNormal">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt; line-height: 115%;"> }</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt; line-height: 115%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1b-_slJTTjUnAAyC4qLeTmiKsk_t84PBGbPweZy5gRsxUf_XtS5RKlpN6MgDY3YxrnR7653grAJ7M2oOdGrG_jE6RdLQ6Sb9-3iJfvTZfL-qD_bX1dVC9gAIw9x1jJiGnP-p9oiIKwjU/s1600/pic1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><img border="0" height="352" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1b-_slJTTjUnAAyC4qLeTmiKsk_t84PBGbPweZy5gRsxUf_XtS5RKlpN6MgDY3YxrnR7653grAJ7M2oOdGrG_jE6RdLQ6Sb9-3iJfvTZfL-qD_bX1dVC9gAIw9x1jJiGnP-p9oiIKwjU/s640/pic1.jpg" width="640" /></span></a></div>
<div class="MsoNormal">
<span style="color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="color: blue; font-family: "arial" , "helvetica" , sans-serif;"><u><br /></u></span>
<span style="color: blue; font-family: "arial" , "helvetica" , sans-serif;"><u><br /></u></span>
<span style="color: blue; font-family: "arial" , "helvetica" , sans-serif;"><u><br /></u></span>
<span style="color: blue; font-family: "arial" , "helvetica" , sans-serif;"><u><br /></u></span>
<span style="color: blue; font-family: "arial" , "helvetica" , sans-serif;"><u><br /></u></span>
<span style="color: blue; font-family: "arial" , "helvetica" , sans-serif;"><u>Example: Pagination</u></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: #2b91af; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"><br /></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: #2b91af; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"><br /></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: #2b91af; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"><br /></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">QueryByAttribute</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> myQuery = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">QueryByAttribute</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"account"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">);</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;">myQuery.ColumnSet = new ColumnSet("name",
"accountnumber", "address1_city");</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">myQuery.AddAttributeValue(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"address1_country"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">, </span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"U.S."</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">);</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">myQuery.AddOrder(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"name"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">OrderType</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">.Descending);</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: green; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;">//Pagination logic</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">myQuery.PageInfo = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">PagingInfo</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">();</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">myQuery.PageInfo.Count = 3;</span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">//Display
3 Records in a page</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">myQuery.PageInfo.PageNumber = 1;</span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">//Starts
from page 1 </span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">myQuery.PageInfo.PagingCookie = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">null</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">;</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">while</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> (</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">true</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">)</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">// Retrieve the page.</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">EntityCollection</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">
resultset = orgproxy.RetrieveMultiple(myQuery);</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">
(resultset.Entities != </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">null</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">)</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">//
Retrieve all records from the result set.</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">foreach</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> (</span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Entity</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> acct
</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">in</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> resultset.Entities)</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Console</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">.WriteLine(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"AccountName:{0}
\t AccountNumber: {1}\t City: {2}"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">, acct.GetAttributeValue<</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">>(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"name"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">),
acct.GetAttributeValue<</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">>(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"accountnumber"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">),
acct.GetAttributeValue<</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">>(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"address1_city"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">));</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> } </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">// Check for more
records, if it returns true.</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">
(resultset.MoreRecords)</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Console</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">.WriteLine(</span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"\n****************\nPage
number {0}\n****************"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">,
myQuery.PageInfo.PageNumber);</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">//
Increment the page number to retrieve the next page.</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;">
myQuery.PageInfo.PageNumber++;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">//
Set the paging cookie to the paging cookie returned from current results.</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> myQuery.PageInfo.PagingCookie
= resultset.PagingCookie;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">else</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">// If
no more records are in the result nodes, exit the loop.</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">break</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">;</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal">
<span style="background: white; color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt; line-height: 115%;"> }</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt; line-height: 115%;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA8dkekWLzQfwHdMKifmHzUlK-05U2anXduTh6jF6fEz1B4nlVAVLNrjrEX9mZJZvM0Y0L7Sn2DO-y6fvXiNNg6YQ2_160YmX7ZfFyTm0HTzxUa4sx17sNTRPQGWvGkPD6DWfl5D4uMyA/s1600/pic2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><img border="0" height="449" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA8dkekWLzQfwHdMKifmHzUlK-05U2anXduTh6jF6fEz1B4nlVAVLNrjrEX9mZJZvM0Y0L7Sn2DO-y6fvXiNNg6YQ2_160YmX7ZfFyTm0HTzxUa4sx17sNTRPQGWvGkPD6DWfl5D4uMyA/s640/pic2.jpg" width="640" /></span></a></div>
<div class="MsoNormal">
<span style="color: black; font-family: "arial" , "helvetica" , sans-serif; font-size: 9.5pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
</div>
</div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com0tag:blogger.com,1999:blog-8705530331952662433.post-34307710559904716082015-11-02T01:33:00.000-08:002015-11-02T02:15:28.023-08:00Microsoft Dynamics CRM getting organization(s) endpoint<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #2a2a2a; font-family: arial, helvetica, sans-serif; font-size: x-small; line-height: 18px;">Microsoft Dynamics CRM Online gives you options for segregating your CRM data and user access. For most companies, adding and using multiple instances in your subscription provides the right mix of functionality and ease of management. Enterprises with separate geographic locations might consider using multiple tenants to separate Microsoft Dynamics CRM Online licenses. Multiple instances can share users among instances; multiple tenants cannot.</span><br />
<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-size: x-small;"><span style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18px;"><br /></span></span></span><span style="font-size: x-small;"><span style="color: #2a2a2a; font-family: "arial" , "helvetica" , sans-serif;"><span style="line-height: 18px;">In order to get instances (Organization) configured in your account we use discovery service. Discovery service provides the organizations that are available on your Microsoft Dynamics Server. It uses SOAP protocol. </span></span><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="color: #2a2a2a; line-height: 18px;"><br /></span></span></span></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="color: #2a2a2a; line-height: 18px;"><br /></span></span></span><span style="font-size: x-small;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="color: #2a2a2a; line-height: 18px;">Given below list of discovery service (<b>Online</b>) hosted by Micro</span><span style="color: #2a2a2a; line-height: 18px;">soft for dif</span><span style="color: #2a2a2a; line-height: 18px;">ferent geo locations.</span></span></span></div>
<div style="text-align: left;">
<br /></div>
<div class="sectionblock" style="padding-bottom: 20px; padding-left: 15px;">
<div class="contentTableWrapper" style="overflow-x: auto;">
<table style="border-collapse: collapse; border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 1px solid rgb(187, 187, 187); font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.55px; margin-bottom: 20px; margin-top: 20px;"><tbody>
<tr><th style="background-color: #ededed; border: 1px solid rgb(187, 187, 187); color: #636363; padding: 10px 8px;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Location</span></th><th style="background-color: #ededed; border: 1px solid rgb(187, 187, 187); color: #636363; padding: 10px 8px;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Discovery Web service URL</span></th><th style="background-color: #ededed; border: 1px solid rgb(187, 187, 187); color: #636363; padding: 10px 8px;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Identity Provider</span></th></tr>
<tr><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">North America</span></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<code><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://dev.crm.dynamics.com/XRMServices/2011/Discovery.svc</span></code></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Microsoft account</span></div>
</td></tr>
<tr><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
</div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<code><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://disco.crm.dynamics.com/XRMServices/2011/Discovery.svc</span></code></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Microsoft Office 365</span></div>
</td></tr>
<tr><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">North America 2</span></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<code><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://disco.crm9.dynamics.com/XRMServices/2011/Discovery.svc</span></code></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Microsoft Office 365</span></div>
</td></tr>
<tr><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Europe, Middle East and Africa (EMEA)</span></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<code><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://dev.crm4.dynamics.com/XRMServices/2011/Discovery.svc</span></code></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Microsoft account</span></div>
</td></tr>
<tr><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
</div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<code><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://disco.crm4.dynamics.com/XRMServices/2011/Discovery.svc</span></code></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Microsoft Office 365</span></div>
</td></tr>
<tr><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Asia Pacific Area (APAC)</span></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<code><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://dev.crm5.dynamics.com/XRMServices/2011/Discovery.svc</span></code></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Microsoft account</span></div>
</td></tr>
<tr><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
</div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<code><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://disco.crm5.dynamics.com/XRMServices/2011/Discovery.svc</span></code></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Microsoft Office 365</span></div>
</td></tr>
<tr><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Oceania</span></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<code><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://disco.crm6.dynamics.com/XRMServices/2011/Discovery.svc</span></code></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Microsoft Office 365</span></div>
</td></tr>
<tr><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Japan (JPN)</span></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<code><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://disco.crm7.dynamics.com/XRMServices/2011/Discovery.svc</span></code></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Microsoft Office 365</span></div>
</td></tr>
<tr><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">South America</span></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<code><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://disco.crm2.dynamics.com/XRMServices/2011/Discovery.svc</span></code></div>
</td><td style="border: 1px solid rgb(187, 187, 187); color: #2a2a2a; padding: 10px 8px; vertical-align: top;"><div style="line-height: 18px; padding-bottom: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Microsoft Office 365</span></div>
</td></tr>
</tbody></table>
<span style="color: #2a2a2a; font-family: "segoe ui" , "lucida grande" , "verdana" , "arial" , "helvetica" , sans-serif;"><span style="font-size: 13px; line-height: 18px;"><b>For On-Premise the URL would be:</b> </span></span></div>
<div class="contentTableWrapper" style="line-height: 17.55px; overflow-x: auto;">
<span style="color: #2a2a2a; font-family: "segoe ui" , "lucida grande" , "verdana" , "arial" , "helvetica" , sans-serif; font-size: 13px; line-height: 18px;">http://</span><em style="color: #2a2a2a; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;">ServerName</em><span style="color: #2a2a2a; font-family: "segoe ui" , "lucida grande" , "verdana" , "arial" , "helvetica" , sans-serif; font-size: 13px; line-height: 18px;">/XRMServices/2011/Discovery.svc</span></div>
<div class="contentTableWrapper" style="line-height: 17.55px; overflow-x: auto;">
<span style="color: #2a2a2a; font-family: "segoe ui" , "lucida grande" , "verdana" , "arial" , "helvetica" , sans-serif; font-size: 13px; line-height: 18px;"><br /></span></div>
<div class="contentTableWrapper" style="line-height: 17.55px; overflow-x: auto;">
<span style="color: #2a2a2a; font-family: "segoe ui" , "lucida grande" , "verdana" , "arial" , "helvetica" , sans-serif; font-size: 13px; line-height: 18px;">Code to get organization endpoints for all the instances configured in Microsoft Dynamics CRM Online.</span></div>
<div class="contentTableWrapper" style="overflow-x: auto;">
<div class="separator" style="clear: both; text-align: center;">
</div>
<br /></div>
<div class="WordSection1">
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> discoveryURL = </span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">https://disco.crm5.dynamics.com/XRMServices/2011/Discovery.svc"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">; </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">//Pass your online account credentials</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">ClientCredentials</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> credentials = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">ClientCredentials</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">();</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">credentials.UserName.UserName = </span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"abhishek@xxxxxxxxx.onmicrosoft.com"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">credentials.UserName.Password = </span><span style="background: white; color: #a31515; font-family: "consolas"; font-size: 9.5pt;">"xxxxxxxxxxx"</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">//Create discovery service proxy</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">DiscoveryServiceProxy</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> dsp = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">DiscoveryServiceProxy</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">(</span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">Uri</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">(discoveryURL), </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">null</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">, credentials, </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">null</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">);</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">dsp.Authenticate();</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">//Retrieve Organization details</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">RetrieveOrganizationsRequest</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> orgRequest = </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">RetrieveOrganizationsRequest</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">();</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">RetrieveOrganizationsResponse</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> allOrgs = (</span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">RetrieveOrganizationsResponse</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">)dsp.Execute(orgRequest);</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: green; font-family: "consolas"; font-size: 9.5pt;">//Print all organization(s)(instances) endpoint.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">foreach</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> (</span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">OrganizationDetail</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> orgInfo </span><span style="background: white; color: blue; font-family: "consolas"; font-size: 9.5pt;">in</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> allOrgs.Details)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> { </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;"> Console</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">.Write(orgInfo.Endpoints[</span><span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt;">EndpointType</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;">.OrganizationService]);</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-autospace: none;">
<br /></div>
<div class="MsoNormal">
<span style="background: white; color: #2b91af; font-family: "consolas"; font-size: 9.5pt; line-height: 115%;">Console</span><span style="background: white; color: black; font-family: "consolas"; font-size: 9.5pt; line-height: 115%;">.ReadLine();</span></div>
</div>
</div>
</div>
</div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com0tag:blogger.com,1999:blog-8705530331952662433.post-72646911606929708392009-08-16T06:14:00.001-07:002016-04-17T20:45:31.124-07:00Marking ActiveX Controls as Safe<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: black;"><strong>What is ActiveX Controls?</strong><br />A control using ActiveX technologies. An ActiveX control can be automatically downloaded and executed by a Web browser. ActiveX is not a programming language, but rather a set of rules for how applications should share information. Programmers can develop ActiveX controls in a variety of languages, including C, C++, Visual Basic, and Java.<br /><br /><strong>Creating a Simple COM Component</strong><br />Lets create a simple com component that will extract existing DSN of client system using .NET.<br />1. Create a File->New->Project->ClassLibrary Project. Name it DSNComComponent.<br />2. A default class "Class1.vb" is added to your project file. Here in this project we are not using this class so its better to delete.<br />3. Add a Com Class to your project. Name it DSNComponent. Paste following code</span><br />
<br />
<span style="color: #003300; font-size: 78%;"><strong><comclass dsncomponent.classid="">_<br />Public Class DSNComponent<br />#Region "COM GUIDs"<br />' These GUIDs provide the COM identity for this class<br />' and its COM interfaces. If you change them, existing<br />' clients will no longer be able to access the class.<br />Public Const ClassId As String = "5162d4b1-7440-4fa3-b47f-12906475728b"<br />Public Const InterfaceId As String = "22dd7975-2554-4d49-bc82-b54ef0d2409f"<br />Public Const EventsId As String = "eb56f021-5c97-4e71-a2de-67d6acd2f703"<br />#End Region<br />' A creatable COM class must have a Public Sub New()<br />' with no parameters, otherwise, the class will not be<br />' registered in the COM registry and cannot be created<br />' via CreateObject.<br />Public Sub New()<br />MyBase.New()<br />End Sub<br />Public Function GetDSNLists() As String<br />Return OdbcHelper.GetDSNLists()<br />End Function<br />End Class</comclass></strong></span><br />
<strong><span style="color: #003300; font-size: 78%;"></span></strong><br />
<span style="color: black;">4. Add module to your project. Name it OdbcHelper. Paste following code</span><br />
<br />
<strong><span style="color: #003300; font-size: 78%;">#Region "Imports"<br />Imports System.Text<br />Imports System<br />Imports System.Runtime.InteropServices<br />#End Region<br />Module OdbcHelper<br />#Region "Variable Declaration"<br />Private Const SQL_HANDLE_ENV As Short = 1<br />Private Const SQL_SUCCESS As Short = 0<br />Private Const DEFAULT_RESULT_SIZE As Short = 1024<br />Private Const SQL_FETCH_NEXT As UShort = 1<br />Private Const SQL_MAX_DSN_LENGTH As Short = 1024<br />Private Const SQL_ATTR_ODBC_VERSION As Integer = 200<br />Private Const SQL_OV_ODBC3 As Integer = 3<br />Private Const SQL_HANDLE_CON As Short = 2<br />Private Hwnd As IntPtr<br />#End Region<br />#Region "API Calls / Declarations"<br /><dllimport odbc32.dll="">_<br />Private Function SQLDataSources( _<br />ByVal henv As System.IntPtr, ByVal fDirection As UShort, _<br />ByVal szDSN As StringBuilder, ByVal cbDSNMax As Short, _<br />ByRef pcbDSN As Short, ByVal szDescription As StringBuilder, _<br />ByVal cbDescriptionMax As Short, ByRef pcbDescription As Short _<br />) As Short<br />End Function<br /><dllimport odbc32.dll="">_<br />Private Function SQLAllocHandle(ByVal hType As Short, ByVal inputHandle As IntPtr, ByRef outputHandle As IntPtr) As Short<br />End Function<br /><dllimport odbc32.dll="">_<br />Private Function SQLSetEnvAttr(ByVal henv As IntPtr, ByVal attribute As Integer, ByVal valuePtr As IntPtr, ByVal strLength As Integer) As Short<br />End Function<br /><dllimport odbc32.dll="">_<br />Private Function SQLFreeHandle(ByVal inStringLength As Short, ByVal hconn As IntPtr) As Short<br />End Function<br />#End Region<br />#Region "API Method Invoke"<br />Friend Function GetDSNLists() As String<br />Dim nRc = 0<br />Dim txt As String = String.Empty<br />Dim henv As IntPtr = IntPtr.Zero<br />Dim hconn As IntPtr = IntPtr.Zero<br />Dim nDSNLen As Short<br />Dim inString As StringBuilder = New StringBuilder(1024)<br />Dim outString As StringBuilder = New StringBuilder(1024)<br />Dim lenNeeded As Short<br />Dim Inc As Integer = 0<br />Try<br />If SQL_SUCCESS = SQLAllocHandle(SQL_HANDLE_ENV, henv, henv) Then<br />If SQL_SUCCESS = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, CType(SQL_OV_ODBC3, IntPtr), 0) Then<br />Do Until nRc <> SQL_SUCCESS<br />nRc = SQLDataSources(henv, SQL_FETCH_NEXT, inString, SQL_MAX_DSN_LENGTH, nDSNLen, outString, SQL_MAX_DSN_LENGTH, lenNeeded)<br />If nRc <> SQL_SUCCESS Then<br />Exit Do<br />End If<br />If Inc = 0 Then<br />txt = inString.ToString()<br />Else<br />txt = txt & "," & inString.ToString()<br />End If<br />Inc += 1<br />Loop<br />End If<br />End If<br />Catch ex As Exception<br />MsgBox(ex.Message)<br />txt = String.Empty<br />Finally<br />If Not (henv = IntPtr.Zero) Then<br />SQLFreeHandle(SQL_HANDLE_ENV, hconn)<br />End If<br />End Try<br />Return txt<br />End Function<br />#End Region<br />End Module</dllimport></dllimport></dllimport></dllimport></span></strong><br />
<strong><span style="color: #003300; font-size: 78%;"></span></strong><br />
<span style="color: black;">5. Compile your code. A file DSNComComponent.dll should be created in your bin directory.<br /><br /><strong>Using COM Component on HTML Page</strong><br />1. Create an empty HTML page. Add following code in your HTML file.<br /></span><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgshjn0MOie5t7PrPmK1lr8NnruNpvu_0MMbOW8lLrtfytJvDjMRGTOBiXUaJjeoMtW-H6BK4izn11LgfC2y699EcQikYR1Mx3PSgeDlrJjuQtoaqrVKDA-r8JWiRa0sZMdY_3TJRiBHTU/s1600-h/HtmlPage.jpg"><span style="color: black;"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5370574246046604722" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgshjn0MOie5t7PrPmK1lr8NnruNpvu_0MMbOW8lLrtfytJvDjMRGTOBiXUaJjeoMtW-H6BK4izn11LgfC2y699EcQikYR1Mx3PSgeDlrJjuQtoaqrVKDA-r8JWiRa0sZMdY_3TJRiBHTU/s400/HtmlPage.jpg" style="cursor: hand; height: 224px; width: 497px;" /></span></a><span style="color: black;"><br /></span><br />
<span style="color: black;">2. Open this html page in browser. You would be receiving an Error: Automation server can't create object.<br /><br />3. Search Key HKEY_CLASSES_ROOT\CLSID\{5162D4B1-7440-4FA3-B47F-12906475728B} in your registry using regedit. Note that each COM component created in .NET application has different key value. This key value is available in your COM Class DSNComponent.vb.<br /><br />4. Add two keys within {5162D4B1-7440-4FA3-B47F-12906475728B}<br />[HKEY_CLASSES_ROOT\CLSID\{5162D4B1-7440-4FA3-B47F-12906475728B}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}]<br />[HKEY_CLASSES_ROOT\CLSID\{5162D4B1-7440-4FA3-B47F-12906475728B}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}]<br />Key <strong>7DD95801-9882-11CF-9FA9-00AA006C42C4</strong> is used to mark controls that are safely scriptable.<br />Key <strong>7DD95802-9882-11CF-9FA9-00AA006C42C4 </strong>is used to mark controls safely initializable from persistent data.<br /><br /><br /><br />5. Browse your web page. Now DSN list would appear on your window.<br /><br /><br /><br /><em>Note: Don't use this method unless you have no other choice, and never use this method to mark as safe controls that aren't really safe.</em></span></div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com0tag:blogger.com,1999:blog-8705530331952662433.post-85571381407148125692009-08-16T02:53:00.000-07:002016-04-17T20:45:03.596-07:00Monitoring applications thru Trace Listners<div dir="ltr" style="text-align: left;" trbidi="on">
<strong><span style="color: #330000; font-size: 85%;">What is Trace?</span></strong><br />
<span style="color: #330000; font-size: 85%;">Trace provides an efficient logging and monitoring capabilities. Trace listners can used to write logs on console, text file or debugger output window.</span><br />
<span style="color: #330000; font-size: 85%;"></span><br />
<strong><span style="color: #330000; font-size: 85%;">Difference between Debug and Trace</span></strong><br />
<span style="color: #330000; font-size: 85%;">Debug is used to write output in debug mode. Debug's write method will not work in release mode of application. Apart from it Trace works on both Debug as well Release mode of application. </span><br />
<span style="color: #330000; font-size: 85%;"></span><br />
<span style="font-size: 85%;"><span style="color: #330000;"><strong>Trace Listners</strong> </span></span><br />
<span style="color: #330000; font-size: 85%;">Trace Listners provide a mechanism for collecting and recording message that are sent. These messages are received by listners. The purpose of a listener is to collect, store, and route tracing messages.</span><br />
<span style="color: #330000; font-size: 85%;"></span><br />
<strong><span style="color: #330000; font-size: 85%;">Listner Types</span></strong><br />
<ul>
<li><span style="color: #330000; font-size: 85%;">A <strong>TextWriterTraceListener</strong> redirects output to an instance of the <strong>TextWriter</strong> class or to anything that is a <strong>Stream</strong> class. It can also write to the console or to a file, because these are <strong>Stream</strong><strong> </strong>classes. </span></li>
<li><span style="color: #330000; font-size: 85%;">An <strong>EventLogTraceListener</strong> redirects output to an event log.</span></li>
<li><span style="color: #330000; font-size: 85%;">A <strong>DefaultTraceListener</strong> redirects output to an output window (VS.NET editor output window). This behavior is the default behavior for Debug and Trace messages, because DefaultTraceListener is automatically included in every Listeners collection and is the only listener automatically included.</span></li>
<li><span style="color: #330000; font-size: 85%;">A <strong>ConsoleTraceListener</strong> directs tracing or debugging output to either the standard output or the standard error stream. </span></li>
<li><span style="color: #330000; font-size: 85%;">A <strong>DelimitedListTraceListener</strong> directs tracing or debugging output to a text writer, such as a stream writer, or to a stream, such as a file stream. The trace output is in a delimited text format that uses the delimiter specified by the Delimiter property. </span></li>
<li><span style="color: #330000; font-size: 85%;">An <strong>XmlWriterTraceListener</strong> directs tracing or debugging output as XML-encoded data to a <strong>TextWriter</strong> or to a <strong>Stream</strong>, such as a <strong>FileStream</strong> .</span></li>
</ul>
<span style="color: #330000;"><span style="font-size: 85%;"><strong><u>An example using TextWriterTraceListener</u></strong> </span></span><br />
<span style="color: #330000; font-size: 85%;"></span><br />
<span style="color: #330099; font-size: 85%;"><em><strong>Class: CustomTraceLog.CS</strong></em></span><br />
<br />
<span style="color: #003333; font-size: 78%;"><strong>using System;<br />using System.Collections.Generic;<br />using System.Text;<br />using System.Diagnostics;<br />using System.Collections;<br />namespace CustomTraceLog<br />{<br />public sealed class CMTrace<br />{<br />public static void Path(string FileLocation)<br />{<br />string FileName = DateTime.Now.ToString("MMddyyyy") + ".txt";<br />string QualifiedPath=System.IO.Path.Combine(FileLocation, FileName);<br />Trace.Listeners.Clear();<br />Trace.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(QualifiedPath));<br />}<br />public static void Close()<br />{<br />Trace.Close();<br />}<br />public static void Fail(string message)<br />{<br />Trace.Fail(message);<br />}<br />public static void Flush()<br />{<br />Trace.Flush();<br />}<br />public static void Indent()<br />{<br />Trace.Indent();<br />}<br />public static void Refresh()<br />{<br />Trace.Refresh();<br />}<br />public static void Unindent()<br />{<br />Trace.Unindent();<br />}<br />public static void Write(object value)<br />{<br />Trace.Write(value);<br />}<br />public static void Write(string message)<br />{<br />Trace.Write(message);<br />}<br />public static void Write(object value, string category)<br />{<br />Trace.Write(value,category);<br />}<br />public static void Write(string message, string category)<br />{<br />Trace.Write(message,category);<br />}<br />public static void WriteIf(bool condition, object value)<br />{<br />Trace.WriteIf(condition,value);<br />}<br />public static void WriteIf(bool condition, string message)<br />{<br />Trace.WriteIf(condition,message);<br />}<br />public static void WriteIf(bool condition, object value, string category)<br />{<br />Trace.WriteIf(condition,value,category);<br />}<br />public static void WriteIf(bool condition, string message, string category)<br />{<br />Trace.WriteIf(condition, message, category);<br />}<br />public static void WriteLine(object value)<br />{<br />Trace.WriteLine(value);<br />}<br />public static void WriteLine(string message)<br />{<br />Trace.WriteLine(message);<br />}<br />public static void WriteLine(object value, string category)<br />{<br />Trace.WriteLine(value,category);<br />}<br />public static void WriteLine(string message, string category)<br />{<br />Trace.WriteLine(message,category);<br />}<br />public static void WriteLineIf(bool condition, object value)<br />{<br />Trace.WriteLineIf(condition,value);<br />}<br />public static void WriteLineIf(bool condition, string message)<br />{<br />Trace.WriteLineIf(condition,message);<br />}<br />public static void WriteLineIf(bool condition, object value, string category)<br />{<br />Trace.WriteLineIf(condition,value,category );<br />}<br />public static void WriteLineIf(bool condition, string message, string category)<br />{<br />Trace.WriteLineIf(condition,message ,category );<br />}<br />public static void WriteException(Exception e)<br />{<br />StringBuilder sb = new StringBuilder();<br />sb.Append("***************** BEGIN EXCEPTION *****************");<br />sb.Append("Message: " + e.Message.ToString());<br />sb.Append("Stack Trace: " + e.StackTrace.ToString());<br />sb.Append("Source: " + e.Source.ToString());<br />IEnumerator Ie= e.Data.GetEnumerator();<br />while (Ie.MoveNext())<br />{<br />sb.Append("Data: " + e.Data[Ie.Current].ToString());<br />}<br />sb.Append("***************** END EXCEPTION *****************");<br />WriteLine(sb.ToString());<br />Flush();<br />Close();<br />}<br />public static void WriteLog(string strMessage)<br />{<br />StringBuilder sb = new StringBuilder();<br />sb.Append("***************** BEGIN LOG *****************");<br />sb.Append("Message: " + strMessage);<br />sb.Append("Time: " + DateTime.Now);<br />sb.Append("***************** END EXCEPTION *****************");<br />WriteLine(sb.ToString());<br />Flush();<br />Close();<br />}<br />}<br />}</strong></span><br />
<span style="font-size: 78%;"></span><br />
<em><span style="color: #330099; font-size: 85%;"><strong>Console Application: Program.CS</strong></span></em><br />
<br />
<span style="color: #003333; font-size: 78%;"><strong>static void Main(string[] args)<br />{<br />int i = 10;<br />int j = 0;<br />CustomTraceLog.CMTrace.Path(@"C:\temp\");<br />CustomTraceLog.CMTrace.WriteLog("Application will now throw a zero divide exception");<br />try<br />{<br />int result = i / j;<br />}<br />catch (Exception ex)<br />{<br />CustomTraceLog.CMTrace.WriteException(ex);<br />}</strong></span><br />
<span style="color: #003333; font-size: 78%;"><strong>}</strong></span><br />
<span style="font-size: 78%;"></span><br />
<span style="color: #330099; font-size: 85%;"><em>Output Log File: C:\Temp\08162009.txt</em></span><br />
<em><span style="color: #330099; font-size: 85%;"></span></em><br />
<span style="color: #663366; font-size: 78%;"><strong>***************** BEGIN LOG *****************</strong></span><br />
<span style="color: #663366; font-size: 78%;"><strong>Message: Application will now throw a zero divide exception</strong></span><br />
<span style="color: #663366; font-size: 78%;"><strong>Time: 16-08-2009 16:24:45</strong></span><br />
<span style="color: #663366; font-size: 78%;"><strong>***************** END EXCEPTION *****************<br />***************** BEGIN EXCEPTION *****************</strong></span><br />
<span style="color: #663366; font-size: 78%;"><strong>Message: Attempted to divide by zero.</strong></span><br />
<span style="color: #663366; font-size: 78%;"><strong>Stack Trace: at ConsoleApplication1.Program.Main(String[] args) in C:\Users\Abhishek\Desktop\CM-TraceLog\ConsoleApplication1\Program.cs:line 17</strong></span><br />
<span style="color: #663366; font-size: 78%;"><strong>Source: ConsoleApplication1</strong></span><br />
<span style="color: #663366; font-size: 78%;"><strong>***************** END EXCEPTION *****************</strong></span></div>
Abhishekhttp://www.blogger.com/profile/15293201490777386661noreply@blogger.com0