<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8581690438072849213</atom:id><lastBuildDate>Tue, 07 Oct 2025 07:31:30 +0000</lastBuildDate><category>#PSHAYER</category><category>#MSDYNCRM</category><category>CRM 2013</category><category>CRM 2011</category><category>Dynamics CRM 2013</category><category>Dynamics CRM 2011</category><category>C#</category><category>CRM 2015</category><category>CRM 2016</category><category>Dynamics CRM 2015</category><category>Dynamics CRM Online</category><category>Workflow</category><category>#dynamics365</category><category>Auto-numbering</category><category>Business Closure</category><category>Calender</category><category>CurrentCaseNumber</category><category>CurrentInvoiceNumber</category><category>CurrentKbNumber</category><category>Dynamics 365</category><category>FetchXml</category><category>Plugin</category><category>SDK</category><category>SLA Timer</category><category>#Azure</category><category>#CDS</category><category>#Flow</category><category>#MSDYN365</category><category>#MicrosoftFlow</category><category>Appointment</category><category>Audit</category><category>AuditBase</category><category>Azure</category><category>Branding</category><category>CDS</category><category>CRM 2013 Timer</category><category>CRM 2015 Navigation</category><category>CRM 2015 Theme</category><category>CRM Audit</category><category>CRM Branding</category><category>CRM for Outlook</category><category>CRM2016</category><category>Cancel Workflow</category><category>Cancel Workflow Programmatically</category><category>Case</category><category>CasePrefix</category><category>Column Comparison</category><category>Common Data Service</category><category>CurrentContractNumber</category><category>CurrentOrderNumber</category><category>CurrentQuoteNumber</category><category>Dynamics CRM 2016</category><category>Dynamics365</category><category>EmailRouter</category><category>ErrorSerializingRegFile</category><category>Fetch</category><category>Fetch Xml</category><category>Flow</category><category>Get Business Closure Dates</category><category>Get CRM for Outlook</category><category>Get Workflow by Name</category><category>Get process by name</category><category>How to apply your own theme on Dynamics CRM 2015</category><category>IDENTITY</category><category>InvoicePrefix</category><category>JS</category><category>JavaScript</category><category>KbArticle</category><category>KbPrefix</category><category>MSDYNCRM</category><category>Microsoft Dynamics 365</category><category>Microsoft Flow</category><category>OData</category><category>On Hold Case Status</category><category>On Hold Status</category><category>OnHoldTime</category><category>PagingLimit</category><category>Plugins</category><category>Power Apps</category><category>PowerApps</category><category>Prefix</category><category>Primary Key</category><category>Query Expression</category><category>REST</category><category>Records Per Page</category><category>RegisterPlugin</category><category>Retrieve Business Closure Dates</category><category>SLA</category><category>SLA Clock</category><category>SOAP</category><category>Security Protocol</category><category>ServiceAppointment</category><category>SlaPauseStates</category><category>SystemState</category><category>SystemState.xml</category><category>TFS</category><category>TLS</category><category>The resource string ErrorSerializingRegFile</category><category>Theme</category><category>This button is currently disabled</category><category>Timer</category><category>UserSettings</category><category>Web Api</category><category>WebApi</category><category>Working Days</category><category>asp.net web api</category><category>autonumbering</category><category>calenderrules</category><category>search process by name</category><category>unsupported</category><title>MS Dynamics 365</title><description>Microsoft Dynamics 365 Blog by Premjit Singh</description><link>http://hayercrm.blogspot.com/</link><managingEditor>noreply@blogger.com (HayerCRM)</managingEditor><generator>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-7112536458299094080</guid><pubDate>Thu, 16 Jul 2020 08:34:00 +0000</pubDate><atom:updated>2021-06-17T17:06:56.968+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#CDS</category><category domain="http://www.blogger.com/atom/ns#">#dynamics365</category><category domain="http://www.blogger.com/atom/ns#">CDS</category><category domain="http://www.blogger.com/atom/ns#">Column Comparison</category><category domain="http://www.blogger.com/atom/ns#">Common Data Service</category><category domain="http://www.blogger.com/atom/ns#">FetchXml</category><category domain="http://www.blogger.com/atom/ns#">OData</category><category domain="http://www.blogger.com/atom/ns#">Power Apps</category><category domain="http://www.blogger.com/atom/ns#">PowerApps</category><category domain="http://www.blogger.com/atom/ns#">Query Expression</category><category domain="http://www.blogger.com/atom/ns#">SDK</category><title>Finally we have Column Comparison in FetchXml, SDK and OData!</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
Microsoft has made an announcement and finally we have Column Comparison available using FetchXml, SDK and OData.&lt;br /&gt;
&lt;br /&gt;
Now we will be able to perform column comparisons for the Common Data Service. Column comparisons will also work in the Power Apps expression language with CDS version 9.1.0000.19562 or later.&lt;br /&gt;
&lt;br /&gt;
We can perform a column comparison for the following condition operators using FetchXML, Web API, or the SDK API:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Equal&lt;/li&gt;
&lt;li&gt;NotEqual&lt;/li&gt;
&lt;li&gt;GreaterThan&lt;/li&gt;
&lt;li&gt;GreaterEqual&lt;/li&gt;
&lt;li&gt;LessThan&lt;/li&gt;
&lt;li&gt;LessEqual&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Columns comparison using FetchXML:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
&amp;lt;fetch&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&amp;nbsp; &amp;lt;entity name=&#39;contact&#39; &amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;attribute name=&#39;firstname&#39; /&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;filter&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;condition attribute=&#39;firstname&#39; operator=&#39;eq&#39; valueof=&#39;lastname&#39;/&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/filter&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;lt;/entity&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;lt;/fetch&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Columns comparison using Web Api:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
https://&amp;lt;environment-root&amp;gt;/contacts?$select=firstname&amp;amp;$filter=firstname eq lastname&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Columns comparison using SDK Api &amp;amp; Organization Service:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
public ConditionExpression
(
  string attributeName,
  ConditionOperator conditionOperator,
  bool compareColumns,
  object value
)

public ConditionExpression
(
  string attributeName,
  ConditionOperator conditionOperator,
  bool compareColumns,
  object[] values
)
&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Following link provide more details:&amp;nbsp;&lt;a href=&quot;https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/column-comparison&quot;&gt;https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/column-comparison&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
 Premjit Singh&lt;br /&gt;
 &lt;a href=&quot;https://www.attendite.co.uk/&quot; target=&quot;_blank&quot;&gt;Attendite Ltd.&lt;/a&gt; &lt;br /&gt;
 &lt;a href=&quot;https://twitter.com/HayerCRM&quot; target=&quot;_blank&quot;&gt;Twitter&lt;/a&gt; &lt;br /&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2020/07/finally-we-have-column-comparison-in.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.1277583</georss:point><georss:box>51.1912379 -0.7732053 51.8234639 0.5176887</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-7738918377477923320</guid><pubDate>Mon, 02 Jul 2018 12:54:00 +0000</pubDate><atom:updated>2021-06-17T17:09:03.976+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#Azure</category><category domain="http://www.blogger.com/atom/ns#">#Flow</category><category domain="http://www.blogger.com/atom/ns#">#MicrosoftFlow</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">Azure</category><category domain="http://www.blogger.com/atom/ns#">Flow</category><category domain="http://www.blogger.com/atom/ns#">IDENTITY</category><category domain="http://www.blogger.com/atom/ns#">Microsoft Flow</category><category domain="http://www.blogger.com/atom/ns#">Primary Key</category><title>Microsoft Flow: Sql Server Table Names is not Visible in Flow </title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Recently came across a limitation/issue while creating a flow to export some data from Azure SQL Server. Flow does not show table in the list if it does not have a Primary Key, so we made a DateTime field Primary Key (bad practice anyway). But it was not showing in list of list of tables.&lt;br /&gt;
&lt;br /&gt;
Then came across &lt;a href=&quot;https://flow.microsoft.com/en-us/blog/introducing-triggers-in-the-sql-connector/&quot; target=&quot;_blank&quot;&gt;SQL Connector Documentation&lt;/a&gt;&amp;nbsp;and found it&#39;s limitations there. Second point under limitations says that table must have an &lt;a href=&quot;https://docs.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql-identity-property?view=sql-server-2017&quot; target=&quot;_blank&quot;&gt;IDENTITY&lt;/a&gt;&amp;nbsp;column.&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;background-color: white; box-sizing: inherit; color: #505050; font-family: &amp;quot;Segoe UI Condensed&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe WP&amp;quot;, Tahoma, Arial, sans-serif; font-size: 34px; font-weight: 200; line-height: 1.18; margin: 0px 0px 12px;&quot;&gt;
Limitations&lt;/h2&gt;
&lt;div style=&quot;background-color: white; box-sizing: inherit; color: #505050; font-family: &amp;quot;Segoe UI Condensed&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe WP&amp;quot;, Tahoma, Arial, sans-serif; font-size: 15px; margin-bottom: 12px; margin-top: 12px;&quot;&gt;
The triggers do have the following limitations:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; box-sizing: inherit; color: #505050; font-family: &amp;quot;Segoe UI Condensed&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe WP&amp;quot;, Tahoma, Arial, sans-serif; font-size: 15px; list-style-position: outside; margin-bottom: 14px; margin-left: 0px; padding-left: 17px;&quot;&gt;
&lt;li style=&quot;box-sizing: inherit; font-size: inherit; margin-bottom: 12px;&quot;&gt;It does not work for on-premises SQL Server&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; font-size: inherit; margin-bottom: 12px;&quot;&gt;Table must have an&amp;nbsp;&lt;a href=&quot;https://docs.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql-identity-property&quot; style=&quot;background-color: transparent; box-sizing: inherit; color: #0066ff; text-decoration-line: none; transition: color 0.2s ease-in-out;&quot;&gt;IDENTITY&lt;/a&gt;&amp;nbsp;column for the new row trigger&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; font-size: inherit; margin-bottom: 0px;&quot;&gt;Table must have a&amp;nbsp;&lt;a href=&quot;https://docs.microsoft.com/en-us/sql/t-sql/data-types/rowversion-transact-sql&quot; style=&quot;background-color: transparent; box-sizing: inherit; color: #0066ff; text-decoration-line: none; transition: color 0.2s ease-in-out;&quot;&gt;ROWVERSION&lt;/a&gt;&amp;nbsp;(a.k.a. TIMESTAMP) column for the modified row trigger&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we changed our SQL table as below and it started showing up in the list of tables in flow:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CREATE TABLE&lt;/span&gt; [dbo].[abc_TriggerToRunExportUsingFlow](&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[Id] [bigint] &lt;span style=&quot;color: blue;&quot;&gt;IDENTITY&lt;/span&gt;(1,1) NOT NULL,&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[TriggerOn] [datetime] NOT NULL,&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[Description] [nchar](50) NULL,&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;PRIMARY KEY CLUSTERED&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
(&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[Id] &lt;span style=&quot;color: blue;&quot;&gt;ASC&lt;/span&gt;&lt;br /&gt;
)&lt;span style=&quot;color: blue;&quot;&gt;WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON&lt;/span&gt; [PRIMARY]&lt;br /&gt;
) &lt;span style=&quot;color: blue;&quot;&gt;ON &lt;/span&gt;[PRIMARY]&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;ALTER TABLE&lt;/span&gt; [dbo].[abc_TriggerToRunExportUsingFlow] &lt;span style=&quot;color: blue;&quot;&gt;ADD&amp;nbsp; CONSTRAINT &lt;/span&gt;[DF_abc_TriggerToRunExportUsingFlow_TriggerOn]&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;DEFAULT &lt;/span&gt;(&lt;span style=&quot;color: magenta;&quot;&gt;getdate&lt;/span&gt;()) &lt;span style=&quot;color: blue;&quot;&gt;FOR &lt;/span&gt;[TriggerOn]&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
 Premjit Singh&lt;br /&gt;
 &lt;a href=&quot;https://www.attendite.co.uk/&quot; target=&quot;_blank&quot;&gt;Attendite Ltd.&lt;/a&gt; &lt;br /&gt;
 &lt;a href=&quot;https://twitter.com/HayerCRM&quot; target=&quot;_blank&quot;&gt;Twitter&lt;/a&gt; &lt;br /&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2018/07/microsoft-flow-sql-server-table-names.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>2</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-7033428356483414719</guid><pubDate>Mon, 25 Jun 2018 14:02:00 +0000</pubDate><atom:updated>2021-06-17T17:11:25.052+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#dynamics365</category><category domain="http://www.blogger.com/atom/ns#">#MSDYN365</category><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">Dynamics 365</category><category domain="http://www.blogger.com/atom/ns#">Security Protocol</category><category domain="http://www.blogger.com/atom/ns#">TLS</category><title>Resolve Error &quot;Unable to Login to Dynamics CRM&quot; after v9 update</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Recently we have updated our Dynamics 365 to v9 and we are updating our applications to the latest version of SDK.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;As per Microsoft Guideline, approach is to update apps to .NET Framework 4.6.2 and update CRM SDK to latest v9.0 assemblies. But application was still throwing same error message (&quot;Unable to Login to Dynamics CRM&quot;).&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;One of my colleague pointed to a &lt;a href=&quot;https://blogs.technet.microsoft.com/cloudyhappypeople/2017/12/22/the-end-of-support-for-older-tls-versions-in-office-365/&quot; target=&quot;_blank&quot;&gt;David Branscome&#39;s Post&lt;/a&gt;&amp;nbsp;about moving away from TLS 1.0 and 1.1 to 1.2 and it reminded me about the &lt;a href=&quot;https://support.microsoft.com/en-us/help/4057306/preparing-for-tls-1-2-in-office-365&quot; target=&quot;_blank&quot;&gt;post I read few days back&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Because our .NET assemblies were already updated so version 4.6.2 and it should be handling the TLS Protocol issue itself. But our application was still throwing the same error so we decided to try invoke TLS1.2 manually in our application before CrmServiceClient is instantiated. Following line was added to the code:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;strong style=&quot;background-color: white; border: 0px; color: #3b3e4f; font-size: 17px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; border: 0px; font-size: 17px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;But it was still throwing same error and then we started looking at assembly references and app.config. In config we found that targetFramework was pointing to 4.5.2 and it worked when we changed to 4.6.2 (as shown below). Once it is updated connection will was created without any issue.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #cc0000; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;httpRuntime targetFramework=&quot;4.6.2&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
 Premjit Singh&lt;br /&gt;
 &lt;a href=&quot;https://www.attendite.co.uk/&quot; target=&quot;_blank&quot;&gt;Attendite Ltd.&lt;/a&gt; &lt;br /&gt;
 &lt;a href=&quot;https://twitter.com/HayerCRM&quot; target=&quot;_blank&quot;&gt;Twitter&lt;/a&gt; &lt;br /&gt;
&lt;/div&gt;</description><link>http://hayercrm.blogspot.com/2018/06/resolve-error-unable-to-login-to.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>3</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-7706929167087390213</guid><pubDate>Fri, 28 Apr 2017 15:48:00 +0000</pubDate><atom:updated>2017-05-02T09:53:18.767+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">asp.net web api</category><category domain="http://www.blogger.com/atom/ns#">CRM 2015</category><category domain="http://www.blogger.com/atom/ns#">CRM 2016</category><category domain="http://www.blogger.com/atom/ns#">CRM2016</category><category domain="http://www.blogger.com/atom/ns#">Dynamics 365</category><category domain="http://www.blogger.com/atom/ns#">Dynamics365</category><category domain="http://www.blogger.com/atom/ns#">Fetch</category><category domain="http://www.blogger.com/atom/ns#">Fetch Xml</category><category domain="http://www.blogger.com/atom/ns#">FetchXml</category><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><category domain="http://www.blogger.com/atom/ns#">JS</category><category domain="http://www.blogger.com/atom/ns#">Microsoft Dynamics 365</category><category domain="http://www.blogger.com/atom/ns#">REST</category><category domain="http://www.blogger.com/atom/ns#">SOAP</category><category domain="http://www.blogger.com/atom/ns#">Web Api</category><category domain="http://www.blogger.com/atom/ns#">WebApi</category><title>How to Retrieve record(s) from Dynamics CRM using FetchXml and Web Api</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Following JavaScript shows how to retrieve record(s) from Dynamics CRM using FetchXml and Web Api.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
function RetrieveUsingFetch() {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var date = new Date();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var today = date.DateFormat(&quot;yyyy-MM-dd&quot;); \\&amp;nbsp;&lt;a href=&quot;http://ps-hayer.blogspot.com/2017/04/how-to-format-date-or-datetime-using.html&quot; target=&quot;_blank&quot;&gt;Click here to see function details.&lt;/a&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var marketCondition = &quot;&quot;;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var fetchXml = &quot;&amp;lt;fetch version=&#39;1.0&#39; output-format=&#39;xml-platform&#39; mapping=&#39;logical&#39; distinct=&#39;true&#39;&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;entity name=&#39;contractdetail&#39;&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;attribute name=&#39;contractid&#39; /&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;attribute name=&#39;title&#39; /&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;attribute name=&#39;contractdetailid&#39; /&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;filter type=&#39;and&#39;&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;condition attribute=&#39;statuscode&#39; operator=&#39;in&#39;&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;value&amp;gt;2&amp;lt;/value&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;value&amp;gt;1&amp;lt;/value&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;/condition&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;condition attribute=&#39;activeon&#39; operator=&#39;on-or-before&#39; value=&#39;&quot; + today + &quot;&#39; /&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;condition attribute=&#39;expireson&#39; operator=&#39;on-or-after&#39; value=&#39;&quot; + today + &quot;&#39; /&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;condition attribute=&#39;customerid&#39; operator=&#39;eq&#39; value=&#39;&quot; + Xrm.Page.getAttribute(&quot;dbc_customerid&quot;).getValue()[0].id + &quot;&#39; /&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;/filter&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;link-entity name=&#39;contract&#39; from=&#39;contractid&#39; to=&#39;contractid&#39; alias=&#39;aa&#39;&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot; &amp;lt;attribute name=&#39;title&#39; /&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;filter type=&#39;and&#39;&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;condition attribute=&#39;statuscode&#39; operator=&#39;eq&#39; value=&#39;3&#39; /&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;/filter&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;/link-entity&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;/entity&amp;gt;&quot; +&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;&amp;lt;/fetch&amp;gt;&quot;;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var uri = &quot;/contractdetails?fetchXml=&quot; + encodeURIComponent(fetchXml);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var clientUrl = Xrm.Page.context.getClientUrl();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var webApiPath = &quot;/api/data/v8.1&quot;;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;uri = clientUrl + webApiPath + uri;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var request = new XMLHttpRequest();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.open(&quot;GET&quot;, encodeURI(uri), false);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.setRequestHeader(&quot;Accept&quot;, &quot;application/json&quot;);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.setRequestHeader(&quot;Content-Type&quot;, &quot;application/json; charset=utf-8&quot;);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.setRequestHeader(&quot;OData-MaxVersion&quot;, &quot;4.0&quot;);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.setRequestHeader(&quot;OData-Version&quot;, &quot;4.0&quot;);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.setRequestHeader(&quot;Prefer&quot;, &quot;odata.include-annotations=\&quot;OData.Community.Display.V1.FormattedValue\&quot;&quot;);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.setRequestHeader(&quot;Prefer&quot;, &quot;odata.maxpagesize=10&quot;);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.onreadystatechange = function () {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (request.readyState === 4 /* complete */) {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if (request.status === 200) {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;request.onreadystatechange = null;&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;var data = JSON.parse(request.response);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if (data.value.length === 1 || data.value.length &amp;gt; 1) {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;alert(data.value[0].contractdetailid);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;} else {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;var error = JSON.parse(request.response).error;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;alert(error.message);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;};&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.send();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
}&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;Note: Make sure that you have right version of WebApi in your code.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Happy Coding&lt;br /&gt;
&lt;br /&gt;
P. S. Hayer&lt;br /&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;(ਪ੍ਰੇਮਜੀਤ ਸਿੰਘ ਹੇਰ&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Please check my other (non-CRM) blog here: 
  &lt;a href=&quot;http://ps-hayer.blogspot.co.uk/&quot;&gt;
    Programming Blogs
  &lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;script&gt;
  (function(i,s,o,g,r,a,m){i[&#39;GoogleAnalyticsObject&#39;]=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,&#39;script&#39;,&#39;//www.google-analytics.com/analytics.js&#39;,&#39;ga&#39;);

  ga(&#39;create&#39;, &#39;UA-50919381-1&#39;, &#39;hayercrm.blogspot.com&#39;);
  ga(&#39;send&#39;, &#39;pageview&#39;);
  ga(‘set’, ‘&amp;uid’, {{USER_ID}}); // Set the user ID using signed-in user_id.

&lt;/script&gt;&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2017/04/how-to-retrieve-records-from-dynamics.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>1</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-5937694502434450230</guid><pubDate>Thu, 14 Apr 2016 16:01:00 +0000</pubDate><atom:updated>2021-06-17T17:11:47.356+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">CRM 2015</category><category domain="http://www.blogger.com/atom/ns#">CRM 2016</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2015</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2016</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM Online</category><category domain="http://www.blogger.com/atom/ns#">On Hold Case Status</category><category domain="http://www.blogger.com/atom/ns#">On Hold Status</category><category domain="http://www.blogger.com/atom/ns#">OnHoldTime</category><category domain="http://www.blogger.com/atom/ns#">SLA</category><category domain="http://www.blogger.com/atom/ns#">SLA Timer</category><category domain="http://www.blogger.com/atom/ns#">SlaPauseStates</category><title>How to retrieve SLA Pause States (On Hold Case Status) in C# code</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Following code shows how to retrieve SLA Pause States from Dynamics CRM using C#. I needed code a functionality to calculate case elapsed minutes and I thought it is worth finding a way to load paused statuses from system rather than hard-coding them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;[] GetSlaPauseStates(&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;IOrganizationService&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; service)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;QueryExpression&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; qe = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;QueryExpression&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;organization&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0.0001pt 72pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;ColumnSet = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;ColumnSet&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;[] { &lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;organizationid&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;slapausestates&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;
})&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;EntityCollection&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; orgs = service.RetrieveMultiple(qe);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (orgs != &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &amp;amp;&amp;amp; orgs.Entities.Count &amp;gt; 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; org = orgs[0];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; slaPauseStates = orgs[0][&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;slapausestates&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;[] states = slaPauseStates.ToString().Split(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&#39;;&#39;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; states;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: 13.2px; line-height: 18.48px;&quot;&gt;In Plugin or Custom Workflow we can retrieve the OrganizationId from contact and then we can directly retrieve the Organization by Id. Following is the code to retrieve organizationId.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: 13.2px; line-height: 18.48px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp; IWorkflowContext&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; context = executionContext.GetExtension&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;IWorkflowContext&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp; IOrganizationServiceFactory&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; serviceFactory = &amp;nbsp; &amp;nbsp; &amp;nbsp;executionContext.GetExtension&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;IOrganizationServiceFactory&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp; IOrganizationService&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; service =
serviceFactory.CreateOrganizationService(context.UserId);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp; var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; organizationId = context.OrganizationId;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: green; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp; //
Get Organization Business Closure Calendar Id&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp; var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; organization = service.Retrieve(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;organization&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;,
context.OrganizationId, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;ColumnSet&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;slapausestates&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp; var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; slaPauseStates = organization[&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;slapausestates&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: 13.2px; line-height: 18.48px;&quot;&gt;

















&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp; string&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;[] states = slaPauseStates.ToString().Split(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&#39;;&#39;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: 13.2px; line-height: 18.48px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: 13.2px; line-height: 18.48px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: 13.2px; line-height: 18.48px;&quot;&gt;Happy Coding&lt;/span&gt;&lt;br style=&quot;color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px;&quot; /&gt;&lt;br style=&quot;color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px;&quot; /&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: 13.2px; line-height: 18.48px;&quot;&gt;P. S. Hayer&lt;/span&gt;&lt;br style=&quot;color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px;&quot; /&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: 13.2px; line-height: 18.48px; text-align: justify;&quot;&gt;(ਪ੍ਰੇਮਜੀਤ ਸਿੰਘ ਹੇਰ&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: 13.2px; line-height: 18.48px; text-align: justify;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;
 Premjit Singh&lt;br /&gt;
 &lt;a href=&quot;https://www.attendite.co.uk/&quot; target=&quot;_blank&quot;&gt;Attendite Ltd.&lt;/a&gt; &lt;br /&gt;
 &lt;a href=&quot;https://twitter.com/HayerCRM&quot; target=&quot;_blank&quot;&gt;Twitter&lt;/a&gt; &lt;br /&gt;
&lt;/div&gt;</description><link>http://hayercrm.blogspot.com/2016/04/how-to-retrieve-sla-pause-states-on.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>1</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-3794198102049731332</guid><pubDate>Wed, 03 Feb 2016 13:20:00 +0000</pubDate><atom:updated>2021-06-17T17:12:03.611+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">Auto-numbering</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">CRM 2015</category><category domain="http://www.blogger.com/atom/ns#">CRM 2016</category><category domain="http://www.blogger.com/atom/ns#">CurrentCaseNumber</category><category domain="http://www.blogger.com/atom/ns#">CurrentContractNumber</category><category domain="http://www.blogger.com/atom/ns#">CurrentInvoiceNumber</category><category domain="http://www.blogger.com/atom/ns#">CurrentKbNumber</category><category domain="http://www.blogger.com/atom/ns#">CurrentOrderNumber</category><category domain="http://www.blogger.com/atom/ns#">CurrentQuoteNumber</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM Online</category><title>How to reset Auto-numbering in Dynamics CRM Online</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
In past I have shown &lt;a href=&quot;http://hayercrm.blogspot.co.uk/2015/03/how-to-reset-auto-numbering.html&quot; target=&quot;_blank&quot;&gt;how to reset auto-numbering un-supported way&lt;/a&gt;. Today I am going to discuss how we can reset auto-numbering by Microsoft supported way.&lt;br /&gt;
&lt;br /&gt;
Number greyed-out so it can&#39;t be changed through UI. But we can write a small console application to update it using SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-hOjMYbsDlVd_dOAP0yEYfck_KpsHTRsn_rKxlWnflAXs5xHF_2BMftT9x6a2HxsWic4KPsleyz3Hg0KC50TnUpBqaVRnahIfJ1qOSsedL1Xni9AOaKmrRzST-jF9SM48dyUkaZWjHKw/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;218&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-hOjMYbsDlVd_dOAP0yEYfck_KpsHTRsn_rKxlWnflAXs5xHF_2BMftT9x6a2HxsWic4KPsleyz3Hg0KC50TnUpBqaVRnahIfJ1qOSsedL1Xni9AOaKmrRzST-jF9SM48dyUkaZWjHKw/s400/1.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Following code can be used to update the number. In this example I am updating CurrentKbNumber but we can also update CurrentCaseNumber, CurrentContractNumber, CurrentQuoteNumber, CurrentOrderNumber and CurrentInvoiceNumber. However we don&#39;t need to worry about prefix and they can be updated through UI.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;//
QueryExpression to Retrieve Organization&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;QueryExpression&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; qe = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;QueryExpression&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;organization&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ColumnSet = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;ColumnSet&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;[] {&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;organizationid&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;currentkbnumber&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;})&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;EntityCollection&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; orgs = service.RetrieveMultiple(qe);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (orgs != &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &amp;amp;&amp;amp; orgs.Entities.Count &amp;gt; 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; org = orgs[0];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; organizationId = (&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;)org[&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;organizationid&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;// Creating a new Object to update. Set the
CurrentKbNumber to your desired number&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;Organization&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;
organizationToUpdate = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;Organization&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; { CurrentKbNumber = 100000, Id = organizationId};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;service.Update(organizationToUpdate);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; line-height: 107%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
Once updated, please go to &lt;b&gt;Settings &amp;gt; Administration &amp;gt; Auto-numbering &lt;/b&gt;to verify.&lt;br /&gt;
&lt;br /&gt;
Happy Coding&lt;br /&gt;
&lt;br /&gt;
P. S. Hayer&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;

&lt;div&gt;
 Premjit Singh&lt;br /&gt;
 &lt;a href=&quot;https://www.attendite.co.uk/&quot; target=&quot;_blank&quot;&gt;Attendite Ltd.&lt;/a&gt; &lt;br /&gt;
 &lt;a href=&quot;https://twitter.com/HayerCRM&quot; target=&quot;_blank&quot;&gt;Twitter&lt;/a&gt; &lt;br /&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2016/02/how-to-reset-auto-numbering-in-dynamics.html</link><author>noreply@blogger.com (HayerCRM)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-hOjMYbsDlVd_dOAP0yEYfck_KpsHTRsn_rKxlWnflAXs5xHF_2BMftT9x6a2HxsWic4KPsleyz3Hg0KC50TnUpBqaVRnahIfJ1qOSsedL1Xni9AOaKmrRzST-jF9SM48dyUkaZWjHKw/s72-c/1.JPG" height="72" width="72"/><thr:total>2</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-4979524442913237137</guid><pubDate>Fri, 30 Oct 2015 09:13:00 +0000</pubDate><atom:updated>2015-12-08T12:04:50.554+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2015</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM Online</category><category domain="http://www.blogger.com/atom/ns#">PagingLimit</category><category domain="http://www.blogger.com/atom/ns#">Records Per Page</category><category domain="http://www.blogger.com/atom/ns#">SDK</category><category domain="http://www.blogger.com/atom/ns#">UserSettings</category><title>How to increase Paging Limit (Records Per Page) in Dynamics CRM 2015 Online using C#</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
In Dynamics CRM default paging limit is set to 50 records per page. Sometime we need to increase Paging Limit (per page) so that I can Activate/Deactivate/Edit/View more than 50 records per page. In CRM On-Premises we have an unsupported option to set it
to whatever value we want by running a SQL update query on UserSettings. But with CRM
2015 Online we don’t have access to database so everything needs to be
supported.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
From UI we can only set Paging Limit up to 250. ‘&lt;span style=&quot;background: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10.5pt; line-height: 107%;&quot;&gt;PagingLimit’ in UserSettings entity is valid for
update so &lt;/span&gt;we can write some code to update Paging Limit.
However even with code maximum Paging Limit we can set is 500 but it is
still double than the maximum we can set through UI.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Complete Solution to update Record per page can be downloaded from&amp;nbsp;&lt;a href=&quot;https://updatecrmpaginglimit.codeplex.com/&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;CodePlex&lt;/span&gt;&lt;/a&gt;.&lt;/b&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Following is the code to
update. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; System.Linq;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; System.ServiceModel.Description;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; Microsoft.Xrm.Sdk;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; Microsoft.Xrm.Sdk.Client;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;namespace&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; UpdatePagingLimit&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;internal&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Program&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrganizationServiceProxy&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; _serviceProxy;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; Main(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; context = GetOrganizationServiceContext())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; firstname = &lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;**
user’s first name **&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; userId = (&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; u &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; context.CreateQuery(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;systemuser&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; u.GetAttributeValue&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;firstname&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;) ==
firstname&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;
u.GetAttributeValue&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;systemuserid&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;)).FirstOrDefault();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (userId != &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;.Empty)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; usersettingsId = (&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; s &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; context.CreateQuery(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;usersettings&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; s.GetAttributeValue&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;systemuserid&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;)
== userId&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;
s.Id).FirstOrDefault();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (usersettingsId != &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;.Empty)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; userSettingsToUpdate = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Entity&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;usersettings&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;)
{Id = usersettingsId};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0.0001pt 108pt;&quot;&gt;
&lt;span style=&quot;background: white; color: green; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&amp;nbsp;&amp;nbsp; // 500 is the Maximum you can set&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userSettingsToUpdate[&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;paginglimit&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;] = 500;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; service =
GetOrganizationService();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
service.Update(userSettingsToUpdate);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;.WriteLine(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;Unable to find the System User&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;.ReadLine();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrganizationServiceProxy&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; GetOrganizationServiceProxy()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; organizationUri = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Uri&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;https://XXXXXXXX.crm4.dynamics.com/XRMServices/2011/Organization.svc&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IServiceManagement&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IOrganizationService&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;gt; orgServiceManagement =&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;ServiceConfigurationFactory&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;.CreateManagement&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IOrganizationService&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;gt;(organizationUri);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;AuthenticationProviderType&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; endpointType = orgServiceManagement.AuthenticationType;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;AuthenticationCredentials&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; authCredentials = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;AuthenticationCredentials&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
authCredentials.ClientCredentials.UserName.UserName = &lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;joe.blogs@example.onmicrosoft.com&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
authCredentials.ClientCredentials.UserName.Password = &lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;Password&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (endpointType == &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;AuthenticationProviderType&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;.OnlineFederation)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IdentityProvider&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; provider =&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
orgServiceManagement.GetIdentityProvider(authCredentials.ClientCredentials.UserName.UserName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (provider != &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &amp;amp;&amp;amp; provider.IdentityProviderType == &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IdentityProviderType&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;.LiveId)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
authCredentials.SupportingCredentials = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;AuthenticationCredentials&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ClientCredentials =
Microsoft.Crm.Services.Utility.&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;DeviceIdManager&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;.LoadOrRegisterDevice()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _serviceProxy =&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetProxy&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IOrganizationService&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrganizationServiceProxy&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;gt;(orgServiceManagement,
authCredentials);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; _serviceProxy;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrganizationServiceContext&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; GetOrganizationServiceContext()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; proxy = GetOrganizationServiceProxy();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; context = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrganizationServiceContext&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;(proxy);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; context;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IOrganizationService&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; GetOrganizationService()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; service = (&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IOrganizationService&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;) GetOrganizationServiceProxy();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; service;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; TProxy GetProxy&amp;lt;TService, TProxy&amp;gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IServiceManagement&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;lt;TService&amp;gt; serviceManagement,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;AuthenticationCredentials&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; authCredentials)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; TService : &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; TProxy : &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;ServiceProxy&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;lt;TService&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Type&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; classType = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (TProxy);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (serviceManagement.AuthenticationType !=&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;AuthenticationProviderType&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;.ActiveDirectory)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;AuthenticationCredentials&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; tokenCredentials =&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
serviceManagement.Authenticate(authCredentials);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;//
Obtain organization service proxy for Federated, LiveId and OnlineFederated
environments. &lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;//
Instantiate a new class of type using the 2 parameter constructor of type
IServiceManagement and SecurityTokenResponse.&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (TProxy) classType&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GetConstructor(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Type&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;[] {&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IServiceManagement&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;lt;TService&amp;gt;),
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;SecurityTokenResponse&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;)})&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Invoke(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;[]
{serviceManagement, tokenCredentials.SecurityTokenResponse});&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;//
Obtain discovery/organization service proxy for ActiveDirectory environment.&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;//
Instantiate a new class of type using the 2 parameter constructor of type
IServiceManagement and ClientCredentials.&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (TProxy) classType&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GetConstructor(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Type&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;[] {&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;IServiceManagement&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;lt;TService&amp;gt;),
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;ClientCredentials&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;)})&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Invoke(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt; mso-highlight: white;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;[]
{serviceManagement, authCredentials.ClientCredentials});&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Now if you build the project you will get an error
complaining about missing reference for Microsoft.Xrm.Services. To get rid of
this error download CRM 2015 SDK. Go to &lt;b&gt;\SDK\SampleCode\CS\HelperCode&lt;/b&gt;
and add &lt;b&gt;DeviceIdManager.cs&lt;/b&gt; to you.
Now you will have to add &lt;b&gt;System.Security&lt;/b&gt;
assembly reference. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Your code is ready to build and run. Make sure that you have
updated the credentials, Organization service Uri and user’s first name in
code. I have set them to dummy data. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Happy Coding&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
P. S. Hayer&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2015/10/how-to-increase-paging-limit-in.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-4866541599259734657</guid><pubDate>Fri, 22 May 2015 08:16:00 +0000</pubDate><atom:updated>2015-06-25T15:26:11.150+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">Branding</category><category domain="http://www.blogger.com/atom/ns#">CRM 2015</category><category domain="http://www.blogger.com/atom/ns#">CRM 2015 Navigation</category><category domain="http://www.blogger.com/atom/ns#">CRM 2015 Theme</category><category domain="http://www.blogger.com/atom/ns#">CRM Branding</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2015</category><category domain="http://www.blogger.com/atom/ns#">How to apply your own theme on Dynamics CRM 2015</category><category domain="http://www.blogger.com/atom/ns#">Theme</category><title> CRM 2015 - How to change existing or add new theme</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
From long time customers were waiting the day Microsoft will allow them to change user interface of Dynamics CRM, so that they can have their own logo and colour theme applied to CRM to match their organization&#39;s brand. Finally the day has arrived. In spring 2015 release of CRM, Microsoft has launched a new feature to change theme. However we will not have full control like normal website, but still it is enough for customers to create a custom look and feel.&lt;br /&gt;
&lt;br /&gt;
You can use your company logo instead of MS Dynamics logo and&amp;nbsp;make changes to the default colors and visual elements provided in the un-customized CRM system. But themes are not included in solutions exported from CRM organization, but we can use export/import if needed, however there are only few options and it will take same amount of time to copy and paste from one CRM organization to another.&lt;br /&gt;
&lt;br /&gt;
Personally I found it very useful because it allowed us to make all our CRM systems (Live, development &amp;amp; UAT) look different. We have selected different colours for all three different environment to eliminate the confusion.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
To change the theme, follow the steps below:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
1. Go to setings &amp;gt; customizations in new menu. (Which is far better then the previous one, as display sub-options under the main options. Which made the life a lot easier for desktop users.)&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvXPaxzIVpofQ2HFEav9rN__gswtOqcpA-S9OCAzs-zkpQyZ-lxidsm9V2Xi9KfgA5g9nsYhSjdoZ0a93rTM8oMP707pgn2ybBKEyQG-qDhpedLQhRgGdS7gEZ9JMEA-ODstyPezyQgj8/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;290&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvXPaxzIVpofQ2HFEav9rN__gswtOqcpA-S9OCAzs-zkpQyZ-lxidsm9V2Xi9KfgA5g9nsYhSjdoZ0a93rTM8oMP707pgn2ybBKEyQG-qDhpedLQhRgGdS7gEZ9JMEA-ODstyPezyQgj8/s640/1.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;2. Under customizations, click on Themes.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5YLyBK4Hbe24guGUcHUk47THbrwy7Y6AFe9DjPH_JsSpN_ve_3GqYjbBBO4Iz1m_vUgt87vL3gBlpnT-y6om0SBejEjZkahJ9SAXaXlxArTkvZ7UNVukZRgVZbRZkYb3jxIKq_aFYTH4/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;276&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5YLyBK4Hbe24guGUcHUk47THbrwy7Y6AFe9DjPH_JsSpN_ve_3GqYjbBBO4Iz1m_vUgt87vL3gBlpnT-y6om0SBejEjZkahJ9SAXaXlxArTkvZ7UNVukZRgVZbRZkYb3jxIKq_aFYTH4/s640/2.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;color: black; text-align: justify;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;color: black; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
3. Under themes you will see a default theme. If you have plans to revert back to default theme then don&#39;t edit it and create a new theme or clone the existing one. In this example I am going to create a new theme instead of cloning. Upload your own logo and set all the colors as you want. Though I am using some flashy colors, please forgive me if they are not meeting usability standards, I am selected those just to test this new feature.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR3vu53oXanXN741RdRQLvamx_xstgXHmg2uCYG8RDMoXX8lYo_85r9oaCRyGUyhyphenhyphenJOH7SF2yzsvdPyMIfpTN1AXzSISO9LtWdnTrcilZPRNQ53bSJC1wnBeFWt0M-np8l7Wt2wXJDT4w/s1600/3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR3vu53oXanXN741RdRQLvamx_xstgXHmg2uCYG8RDMoXX8lYo_85r9oaCRyGUyhyphenhyphenJOH7SF2yzsvdPyMIfpTN1AXzSISO9LtWdnTrcilZPRNQ53bSJC1wnBeFWt0M-np8l7Wt2wXJDT4w/s640/3.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;4. Save and Publish the theme. you can preview it if you want. But as we have not deleted the original theme we have an option to go back to that. You can switch between existing themes by simply setting one as default.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZoQoRsqPFrwdwbIVuHJQDeZVHAEsWAZATlpSGYtSQnrdMX35JAx7wTrbvXiqfMr2hnIa6xrq4f84z2Zu2hs7KcH-g57JvReEoSR6DbtL-pERdGq099R5YRmIcRzwW-kGKMIRNDEBYFQw/s1600/4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZoQoRsqPFrwdwbIVuHJQDeZVHAEsWAZATlpSGYtSQnrdMX35JAx7wTrbvXiqfMr2hnIa6xrq4f84z2Zu2hs7KcH-g57JvReEoSR6DbtL-pERdGq099R5YRmIcRzwW-kGKMIRNDEBYFQw/s640/4.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Once you are happy with the new look, set it as default and enjoy.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
P S Hayer&lt;/div&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2015/05/crm-2015-how-to-change-existing-or-add.html</link><author>noreply@blogger.com (HayerCRM)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvXPaxzIVpofQ2HFEav9rN__gswtOqcpA-S9OCAzs-zkpQyZ-lxidsm9V2Xi9KfgA5g9nsYhSjdoZ0a93rTM8oMP707pgn2ybBKEyQG-qDhpedLQhRgGdS7gEZ9JMEA-ODstyPezyQgj8/s72-c/1.JPG" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-4690155001637181752</guid><pubDate>Fri, 06 Mar 2015 16:13:00 +0000</pubDate><atom:updated>2015-03-09T09:33:03.956+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">EmailRouter</category><category domain="http://www.blogger.com/atom/ns#">SystemState</category><category domain="http://www.blogger.com/atom/ns#">SystemState.xml</category><title>The E-mail Router service could not run the service main background thread. The E-mail Router service cannot continue and will now shut down.</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Because of some issues &#39;Microsoft CRM Email Router&#39; service stopped automatically. On manual start it stopped immediately saying&amp;nbsp;SystemState.xml is corrupt.&lt;br /&gt;
&lt;br /&gt;
I found the actual error message (following) in event log. But most useful message was prior to this error message saying &quot;Error accesing SystemState.xml. Restore file with last backup.&quot;&lt;br /&gt;
&lt;br /&gt;
#16192 - The E-mail Router service could not run the service main background thread. The E-mail Router service cannot continue and will now shut down. System.Configuration.ConfigurationErrorsException: The E-mail router service cannot access system state file Microsoft.Crm.Tools.EmailAgent.SystemState.xml. The file may be missing or may not be accessible. The E-mail Router service cannot continue and will now shut down. ---&amp;gt; System.Xml.XmlException: Root element is missing.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;at System.Xml.XmlTextReaderImpl.ParseDocumentContent()&lt;br /&gt;
&amp;nbsp; &amp;nbsp;at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;at System.Xml.XmlDocument.Load(XmlReader reader)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;at System.Xml.XmlDocument.Load(String filename)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.Crm.Tools.Email.Providers.ConfigFileReader..ctor(String filePath, ServiceLogger serviceLogger)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.Crm.Tools.Email.Providers.SystemState.Initialize(ServiceLogger serviceLogger)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.Crm.Tools.Email.Agent.ServiceCore.InitializeSystemConfiguration()&lt;br /&gt;
&amp;nbsp; &amp;nbsp;--- End of inner exception stack trace ---&lt;br /&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.Crm.Tools.Email.Agent.ServiceCore.InitializeSystemConfiguration()&lt;br /&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.Crm.Tools.Email.Agent.ServiceCore.ExecuteService()&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
It gave me an idea that I need to find and restore the file from backup (if there is any). File was located at&amp;nbsp;C:\Program Files\Microsoft CRM Email\Service\Microsoft.Crm.Tools.EmailAgent.SystemState.xml.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
But Unfortunately there was not any backup. So I just renamed the file and restarted the service. It worked and started picking up pending emails gradually.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For future use I have taken backup of SystemState.xml and Configuration.bin as suggested by&amp;nbsp;&lt;a href=&quot;http://support.microsoft.com/kb/954522&quot;&gt;Microsoft&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
P.S. Hayer&lt;/div&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2015/03/the-e-mail-router-service-could-not-run.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-2108107212800625092</guid><pubDate>Fri, 06 Mar 2015 11:18:00 +0000</pubDate><atom:updated>2016-02-04T10:59:03.665+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">Auto-numbering</category><category domain="http://www.blogger.com/atom/ns#">autonumbering</category><category domain="http://www.blogger.com/atom/ns#">Case</category><category domain="http://www.blogger.com/atom/ns#">CasePrefix</category><category domain="http://www.blogger.com/atom/ns#">CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">CurrentCaseNumber</category><category domain="http://www.blogger.com/atom/ns#">CurrentInvoiceNumber</category><category domain="http://www.blogger.com/atom/ns#">CurrentKbNumber</category><category domain="http://www.blogger.com/atom/ns#">InvoicePrefix</category><category domain="http://www.blogger.com/atom/ns#">KbArticle</category><category domain="http://www.blogger.com/atom/ns#">KbPrefix</category><category domain="http://www.blogger.com/atom/ns#">Prefix</category><category domain="http://www.blogger.com/atom/ns#">unsupported</category><title>How to reset Auto-numbering and where does CRM stores Prefix and Number</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
I Recently came across a question on a forum about how
to update Auto-numbering number and where does CRM stores it in Database? I
have looked in CRM tables and found that CRM stores it in [OrganizationBase]
table. But as it is unsupported to update in SQL, I was not sure that if updating the number will work or not. I personally avoid doing unsupported things. But to find out the consequences I decided to give it a go in my Development environment.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Note:&lt;/b&gt; To update Auto-Numbering by Supported way, have a look at&amp;nbsp;&lt;a href=&quot;http://hayercrm.blogspot.co.uk/2016/02/how-to-reset-auto-numbering-in-dynamics.html&quot; target=&quot;_blank&quot;&gt;How to reset Auto-numbering in Dynamics CRM Online&lt;/a&gt;.&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Following query returned the current auto number values.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt; [KbPrefix]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[CurrentKbNumber]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[CasePrefix]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[CurrentCaseNumber]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[ContractPrefix]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[CurrentContractNumber]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[QuotePrefix]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[CurrentQuoteNumber]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[OrderPrefix]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[CurrentOrderNumber]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[InvoicePrefix]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[CurrentInvoiceNumber]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;[UniqueSpecifierLength]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt; line-height: 115%;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; [dbo]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[OrganizationBase]&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Then executed the following query to reset number:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;Update&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt; [dbo]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[OrganizationBase]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10.0pt;&quot;&gt;
[CurrentKbNumber] &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 10000;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Resetting number only can cause duplication if you already have records with that number. So to avoid it I have updated the Prefix as well.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
CRM allows to update Prefix using UI but Number field is locked as shown below:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Got to Settings &amp;gt; Administration &amp;gt; Auto-numbering&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimjqUBBtt4wnRtKxiAy102qwwkeaTAfuIbPBYyhPQ6EZYBtUNCr9tAXf7xCIK9alUU2i6dfXmB2jMfQ9TqztqgJmctk8qVrmdcaUY6AjCpdhKByNzWMmefvwpxkxBAouWEwI4nTWobGj4/s1600/Capture.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimjqUBBtt4wnRtKxiAy102qwwkeaTAfuIbPBYyhPQ6EZYBtUNCr9tAXf7xCIK9alUU2i6dfXmB2jMfQ9TqztqgJmctk8qVrmdcaUY6AjCpdhKByNzWMmefvwpxkxBAouWEwI4nTWobGj4/s1600/Capture.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
Now on new Article creation, I can notice that Number has been set to 10000. Done some light testing and could not find any issues.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
Note: It is not a Microsoft supported way of updating Auto-numbering, I would recommend to update Auto-Numbering &lt;a href=&quot;http://hayercrm.blogspot.co.uk/2016/02/how-to-reset-auto-numbering-in-dynamics.html&quot; target=&quot;_blank&quot;&gt;Supported Way&lt;/a&gt;&amp;nbsp;by updating the Organization using sdk.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
P.S. Hayer&lt;/div&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2015/03/how-to-reset-auto-numbering.html</link><author>noreply@blogger.com (HayerCRM)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimjqUBBtt4wnRtKxiAy102qwwkeaTAfuIbPBYyhPQ6EZYBtUNCr9tAXf7xCIK9alUU2i6dfXmB2jMfQ9TqztqgJmctk8qVrmdcaUY6AjCpdhKByNzWMmefvwpxkxBAouWEwI4nTWobGj4/s72-c/Capture.JPG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-2681236072393792895</guid><pubDate>Wed, 01 Oct 2014 16:23:00 +0000</pubDate><atom:updated>2015-03-06T11:23:32.841+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">Appointment</category><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">Calender</category><category domain="http://www.blogger.com/atom/ns#">CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">ServiceAppointment</category><title>Dynamics CRM: Create ServiceAppointment</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;A&amp;nbsp;service
appointment&amp;nbsp;represents an appointment for service. The schema name for
this entity is&amp;nbsp;&lt;b&gt;ServiceAppointment&lt;/b&gt;. The&amp;nbsp;service
appointment&amp;nbsp;entity represents a block of time on a calendar. This entity
stores the availability blocks for resources and can be used to determine
resource availability and scheduling.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;A
service appointment can be customized independently from other activities to
accommodate the customer&#39;s business requirements for service delivery. A
service appointment must have a corresponding service. It can be already bound
with a set of resources specified by an activity party (&lt;b&gt;ActivityParty&lt;/b&gt;)
list.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;Following
code can be used to create a Service Activity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;// Create the
ActivityParty. Resource can be a system user and user&#39;s Calendar will be booked
for the duration.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;resource =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ActivityParty&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PartyId
=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;EntityReference&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;SystemUser&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.EntityLogicalName,&amp;nbsp;_userId)&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;// Create and instance
of ServiceAppointment&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;appointment =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ServiceAppointment&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Subject
=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;&quot;Test
Service Appointment&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ServiceId
=&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;EntityReference&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Service&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.EntityLogicalName,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Guid&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;&quot;B39F04D6-7C93-E111-9675-005056B41D39&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;)),&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ScheduledStart
=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;DateTime&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Now.AddDays(5),&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ScheduledEnd
=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;DateTime&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Now.AddDays(15),&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Location
=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;&quot;On
Site&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Description
=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;&quot;Test
Appointment created for testing.&quot;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Resources
=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ActivityParty&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;[] {&amp;nbsp;resource },&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IsAllDayEvent
=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IsBilled
=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;request =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;CreateRequest&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;{Target =
appointment};&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;response = (&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;CreateResponse&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;)
_service.Execute(request);&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;serviceAppointmentId
= response.id;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;P.
S. Hayer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Ref:&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-gb/library/gg327905.aspx&quot;&gt;Appointment entities&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2014/10/dynamics-crm-create-serviceappointment.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-1776241227099232299</guid><pubDate>Thu, 28 Aug 2014 10:12:00 +0000</pubDate><atom:updated>2015-03-06T11:23:59.254+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">Audit</category><category domain="http://www.blogger.com/atom/ns#">AuditBase</category><category domain="http://www.blogger.com/atom/ns#">CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">CRM Audit</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2013</category><title>CRM 2011: Get list of audited attributes from AuditBase table</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Recently, I was asked to get all the fields and their entities which were audited in a day so that we can decide if we really need to audit all of those fields and disable auditing where its not required.&lt;br /&gt;
&lt;br /&gt;
As we know there is no Filtered view for audit entity and even advance find don&#39;t support Audit search, so it is bit difficult to get the list of fields audited. But Kelvin&#39;s &lt;a href=&quot;http://kelvinshen.blogspot.co.uk/2012/02/crm-2011-auditing-report.html&quot;&gt;blog&lt;/a&gt; put me on right path to write this query and get desired result.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;-- Declaring
Variable and Temp Tables&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;
@AttributeMask &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;MAX&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt;
@ObjectTypeCode &lt;span style=&quot;color: blue;&quot;&gt;INT&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;
@EntityName &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;100&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt; @LogDATETIME &lt;span style=&quot;color: blue;&quot;&gt;DATETIME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;
@CurrentAttribute &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;MAX&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; @Audit &lt;span style=&quot;color: blue;&quot;&gt;Table&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;AttributeMask &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;MAX&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt;
ObjectTypeCode &lt;span style=&quot;color: blue;&quot;&gt;INT&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;
EntityName &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;100&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt; LogDATETIME &lt;span style=&quot;color: blue;&quot;&gt;DATETIME&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;);&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; @Result &lt;span style=&quot;color: blue;&quot;&gt;Table &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;AttributeId &lt;span style=&quot;color: blue;&quot;&gt;INT&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; ObjectTypeCode &lt;span style=&quot;color: blue;&quot;&gt;INT&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; EntityName &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;100&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt; LogDATETIME &lt;span style=&quot;color: blue;&quot;&gt;DATETIME&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;
@todaysdate &lt;span style=&quot;color: blue;&quot;&gt;DATETIME&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;-- Set the date
to bring all the fields Audited today&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;SET&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;
@todaysdate &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;CAST&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;GETDATE&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;DATE&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;-- Get all
todays records from AuditBase; You can remove where clause to get everything&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; @Audit&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; a&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; a&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ObjectTypeCode&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; e&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; a&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;CreatedOn &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; Audit
&lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; a&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;INNER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;JOIN&lt;/span&gt; MetadataSchema&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Entity
e &lt;span style=&quot;color: blue;&quot;&gt;on&lt;/span&gt; a&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ObjectTypeCode
&lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; e&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ObjectTypeCode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;WHERE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;CAST&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;CreatedOn &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;DATE&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; @todaysdate&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;-- Using Cursor
to go through each and every record in @Audit Table&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;
DataAuditCursor &lt;span style=&quot;color: blue;&quot;&gt;CURSOR&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FOR&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; @Audit&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;OPEN&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;
DataAuditCursor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;FETCH&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;NEXT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt;
DataAuditCursor &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;INTO&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;
@AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; @ObjectTypeCode&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; @EntityName&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;
@LogDATETIME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;WHILE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;@@FETCH_STATUS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;-- Run while Attribute mask have
comma(s) in it&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;WHILE&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;CHARINDEX&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;,&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;@AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;0&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @CurrentAttribute&lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;RTRIM&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;LTRIM&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;SUBSTRING&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;@AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;1&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;CHARINDEX&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;,&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;@AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;0&lt;span style=&quot;color: grey;&quot;&gt;)-&lt;/span&gt;1&lt;span style=&quot;color: grey;&quot;&gt;))),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;RTRIM&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;LTRIM&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;SUBSTRING&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;@AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;CHARINDEX&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;,&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;@AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;0&lt;span style=&quot;color: grey;&quot;&gt;)+&lt;/span&gt;1&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;LEN&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;@AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;))))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;IF&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;LEN&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;@CurrentAttribute&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;&amp;gt;&lt;/span&gt; 0 &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; @Result &lt;span style=&quot;color: blue;&quot;&gt;Values&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;@CurrentAttribute&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;
@ObjectTypeCode&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; @EntityName&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; @LogDATETIME&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;END&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; @Result &lt;span style=&quot;color: blue;&quot;&gt;VALUES&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;CASE&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;ISNULL&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;@AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ELSE&lt;/span&gt; @AttributeMask &lt;span style=&quot;color: blue;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @ObjectTypeCode&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; @EntityName&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;
@LogDATETIME&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;FETCH&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;NEXT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt;
DataAuditCursor &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt;
@AttributeMask&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; @ObjectTypeCode&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; @EntityName&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;
@LogDATETIME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;END&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;CLOSE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;
DataAuditCursor&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;DEALLOCATE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;
DataAuditCursor&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;-- Select
Distinct to get all the Attributes and their entities &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;DISTINCT&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; r&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;EntityName&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TOP&lt;/span&gt; 1 a&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Name &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt;
MetadataSchema&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Attribute a &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;JOIN&lt;/span&gt; MetadataSchema&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Entity
e &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;EntityId &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; e&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;EntityId &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;and&lt;/span&gt; a&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ColumnNumber &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; r&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;AttributeId &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;and&lt;/span&gt; e&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ObjectTypeCode &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; r&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ObjectTypeCode&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;AttributeName&#39;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; @Result r&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;&quot;&gt;Happy Coding&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;&quot; /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;&quot;&gt;P. S. Hayer&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px; text-align: justify;&quot;&gt;(ਪ੍ਰੇਮਜੀਤ ਸਿੰਘ ਹੇਰ&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px; text-align: justify;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;&quot; /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;&quot;&gt;Please check my other (non-CRM) blog here:&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://ps-hayer.blogspot.co.uk/&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px; text-decoration: none;&quot;&gt;Programming Blogs&lt;/a&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2014/08/crm-2011-get-audited-attributes-from.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-5092359547366910175</guid><pubDate>Mon, 23 Jun 2014 09:48:00 +0000</pubDate><atom:updated>2015-03-06T11:24:09.441+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">Business Closure</category><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">Calender</category><category domain="http://www.blogger.com/atom/ns#">calenderrules</category><category domain="http://www.blogger.com/atom/ns#">CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">Get Business Closure Dates</category><category domain="http://www.blogger.com/atom/ns#">Plugins</category><category domain="http://www.blogger.com/atom/ns#">Retrieve Business Closure Dates</category><category domain="http://www.blogger.com/atom/ns#">Workflow</category><title>Dynamics CRM: How to get Business Closure Dates in Plugin</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;using System;
using System.Linq;
using HayerCrmPackage.Plugins.Entities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Query;

namespace HayerCrmPackage.Plugins
{
    public class PreCaseCreate : Plugin
    {
        public PreCaseCreate()
            : base(typeof(PreCaseCreate))
        {
            base.RegisteredEvents.Add(new Tuple&amp;lt;int, string, string, Action&amp;lt;LocalPluginContext&amp;gt;&amp;gt;(20, &quot;Create&quot;, &quot;incident&quot;, new Action&amp;lt;LocalPluginContext&amp;gt;(ExecutePreCaseCreate)));            
        }

        protected void ExecutePreCaseCreate(LocalPluginContext localContext)
        {
            if (localContext == null)
            {
                throw new ArgumentNullException(&quot;localContext&quot;);                
            }

            var pluginContext = localContext.PluginExecutionContext;
            var service = localContext.OrganizationService;
            var context = new OrganizationServiceContext(service);

            // Get Organization Business Closure Calendar Id
            var organization = service.Retrieve(&quot;organization&quot;, context.OrganizationId, new ColumnSet(&quot;businessclosurecalendarid&quot;));

            var query = new QueryExpression(&quot;calendar&quot;)
            {
                ColumnSet = new ColumnSet(true),
                Criteria = new FilterExpression()
            };

            // Add condition to get Get Calander where CalanderId is equal to Organization&#39;s businessclosurecalendarid
            query.Criteria.AddCondition(new ConditionExpression(&quot;calendarid&quot;, ConditionOperator.Equal, organization[&quot;businessclosurecalendarid&quot;].ToString()));

            // Get Calendar
            var businessClosureCalendar = service.RetrieveMultiple(query).Entities[0];

            // Get the Calendar rules
            IEnumerable&amp;lt;Entity&amp;gt; calanderRules = businessClosureCalendar != null ? businessClosureCalendar.GetAttributeValue&amp;lt;EntityCollection&amp;gt;(&quot;calendarrules&quot;).Entities : null;
        }
    }
}

&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;To know how to add working days by calculating business closure dates and weekends, please check my blog &lt;a href=&quot;http://hayercrm.blogspot.co.uk/2014/06/dynamics-crm-how-to-add-working-days-by.html&quot;&gt;Here&lt;/a&gt;.&lt;/b&gt;
&lt;br /&gt;
&lt;br /&gt;
Happy Coding&lt;br /&gt;
&lt;br /&gt;
P. S. Hayer&lt;br /&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;(ਪ੍ਰੇਮਜੀਤ ਸਿੰਘ ਹੇਰ&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Please check my other (non-CRM) blog here: 
  &lt;a href=&quot;http://ps-hayer.blogspot.co.uk/&quot;&gt;
    Programming Blogs
  &lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2014/06/dynamics-crm-how-to-get-business.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-3174320306950958220</guid><pubDate>Fri, 20 Jun 2014 11:27:00 +0000</pubDate><atom:updated>2015-03-06T11:24:23.878+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">Business Closure</category><category domain="http://www.blogger.com/atom/ns#">CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">Plugin</category><category domain="http://www.blogger.com/atom/ns#">Workflow</category><category domain="http://www.blogger.com/atom/ns#">Working Days</category><title>Dynamics CRM: How to Add working days by calculating business closure and weekends</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Recently I received a requirement to set the Incident Auto Closure date to  &#39;CreatedOn&#39; + 7 working days. To add working days to &#39;CreatedOn&#39; date, we need to exclude all the weekend and business closures. I came up with the following solution to achieve the required outcome. 
&lt;br /&gt;
Add the following Class to your project to calculate working day and business closures.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;using System;
using System.Collections.Generic;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;

namespace HayerCrmPackage.Plugins
{
    public class AddWorkingDaysClass
    {
        /// &lt;summary&gt;
        /// Add working days to a specific date by calculating Business Closure and weekends
        /// &lt;/summary&gt;
        public static DateTime AddWorkingAndBusinessClosureDays(DateTime specificDate, int workingDaysToAdd, 
            IOrganizationService service, IPluginExecutionContext context)
        {
            var currentDate = specificDate;
            var businessClosures = GetBusinessClosureCalendarRules(context, service);

            // Calculate the working days by taking out the weekends
            int completeWeeks = workingDaysToAdd / 5;
            DateTime date = specificDate.AddDays(completeWeeks * 7);
            workingDaysToAdd = workingDaysToAdd % 5;
            for (int i = 0; i &amp;lt; workingDaysToAdd; i++)
            {
                date = date.AddDays(1);
                while (!IsWorkingDayOfWeek(date))
                {
                    date = date.AddDays(1);
                }
            }

            // Calculate the working days by taking out Business Closures
            for (var i = currentDate; i &amp;lt;= date; i = i.AddDays(1))
            {
                if (i.DayOfWeek == DayOfWeek.Saturday || i.DayOfWeek == DayOfWeek.Sunday)
                    continue;

                foreach (var closure in businessClosures)
                {
                    var startDate = (DateTime)closure[&quot;effectiveintervalstart&quot;];
                    var endDate = (DateTime)closure[&quot;effectiveintervalend&quot;];
                    var range = new DateRange(startDate, endDate);

                    if (range.Includes(i))
                    {
                        date = date.AddDays(1);

                        if (date.DayOfWeek == DayOfWeek.Saturday)
                        {
                            date = date.AddDays(2);
                            i = i.AddDays(1);
                        }
                        else if (date.DayOfWeek == DayOfWeek.Sunday)
                        {
                            date = date.AddDays(1);
                        }
                    }
                }
            }
            return date;
        }

        /// &lt;summary&gt;
        /// Get Business Closure Calendar Rules
        /// &lt;/summary&gt;
        private static IEnumerable&amp;lt;Entity&amp;gt; GetBusinessClosureCalendarRules(IPluginExecutionContext context,
            IOrganizationService service)
        {
            // Get Organization Business Closure Calendar Id
            var organization = service.Retrieve(&quot;organization&quot;, context.OrganizationId, new ColumnSet(&quot;businessclosurecalendarid&quot;));

            var query = new QueryExpression(&quot;calendar&quot;)
            {
                ColumnSet = new ColumnSet(true),
                Criteria = new FilterExpression()
            };

            // Add condition to get Get Calander where CalanderId is equal to Organization&#39;s businessclosurecalendarid
            query.Criteria.AddCondition(new ConditionExpression(&quot;calendarid&quot;, ConditionOperator.Equal, organization[&quot;businessclosurecalendarid&quot;].ToString()));

            // Get Calendar
            var businessClosureCalendar = service.RetrieveMultiple(query).Entities[0];

            // Return the Calendar rules
            return businessClosureCalendar != null ? businessClosureCalendar.GetAttributeValue&amp;lt;EntityCollection&amp;gt;(&quot;calendarrules&quot;).Entities : null;
        }

        private static bool IsWorkingDayOfWeek(DateTime date)
        {
            var day = date.DayOfWeek;
            return day != DayOfWeek.Saturday &amp;amp;&amp;amp; day != DayOfWeek.Sunday;
        }

        public interface IRange&amp;lt;T&amp;gt;
        {
            T Start { get; }
            T End { get; }
            bool Includes(T value);
        }

        public class DateRange : IRange&amp;lt;DateTime&amp;gt;
        {
            public DateRange(DateTime start, DateTime end)
            {
                Start = start;
                End = end;
            }

            public DateTime Start { get; private set; }
            public DateTime End { get; private set; }

            public bool Includes(DateTime value)
            {
                return (Start &amp;lt;= value) &amp;amp;&amp;amp; (value &amp;lt; End);
            }
        }
    }
}

&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
To consume above class in your plugin, use the following code:
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;using System;
using System.Linq;
using HayerCrmPackage.Plugins.Entities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Query;

namespace HayerCrmPackage.Plugins
{
    public class PreCaseCreate : Plugin
    {
        public PreCaseCreate()
            : base(typeof(PreCaseCreate))
        {
            base.RegisteredEvents.Add(new Tuple&amp;lt;int, string, string, Action&amp;lt;LocalPluginContext&amp;gt;&amp;gt;(20, &quot;Create&quot;, &quot;incident&quot;, new Action&amp;lt;LocalPluginContext&amp;gt;(ExecutePreCaseCreate)));            
        }

        protected void ExecutePreCaseCreate(LocalPluginContext localContext)
        {
            if (localContext == null)
            {
                throw new ArgumentNullException(&quot;localContext&quot;);                
            }

            var pluginContext = localContext.PluginExecutionContext;
            var service = localContext.OrganizationService;
            var context = new OrganizationServiceContext(service);

            var targetEntity = (pluginContext.InputParameters != null &amp;amp;&amp;amp; pluginContext.InputParameters.Contains(&quot;Target&quot;))
            ? (Entity)pluginContext.InputParameters[&quot;Target&quot;]
            : null;

            // Converting Entity to Incident
            var incident = (targetEntity != null &amp;amp;&amp;amp; targetEntity.LogicalName == Incident.EntityLogicalName) ? targetEntity.ToEntity&amp;lt;Incident&amp;gt;() : null;
            
            // If you want to update the number of working days to add, change the value of 2nd parameter below
            incident.new_AutoClosureDate = AddWorkingDaysClass.AddWorkingAndBusinessClosureDays(DateTime.Now, 7, service,
                        pluginContext);
        }
    }
}

&lt;/pre&gt;
Happy Coding&lt;br /&gt;
&lt;br /&gt;
P. S. Hayer&lt;br /&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;(ਪ੍ਰੇਮਜੀਤ ਸਿੰਘ ਹੇਰ&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Ref:&lt;br /&gt;
&amp;nbsp;1.&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/3717791/c-adding-working-days-from-a-cetain-date&quot; target=&quot;_blank&quot;&gt;Adding Working Week Days to a Specific Date&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;2.&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/4781611/how-to-know-if-a-datetime-is-between-a-daterange-in-c-sharp&quot; target=&quot;_blank&quot;&gt;Check if Date Time is in Date Range&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
Please check my other (non-CRM) blog here: 
  &lt;a href=&quot;http://ps-hayer.blogspot.co.uk/&quot;&gt;
    Programming Blogs
  &lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;script&gt;
  (function(i,s,o,g,r,a,m){i[&#39;GoogleAnalyticsObject&#39;]=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,&#39;script&#39;,&#39;//www.google-analytics.com/analytics.js&#39;,&#39;ga&#39;);

  ga(&#39;create&#39;, &#39;UA-50919381-1&#39;, &#39;hayercrm.blogspot.com&#39;);
  ga(&#39;send&#39;, &#39;pageview&#39;);
  ga(‘set’, ‘&amp;uid’, {{USER_ID}}); // Set the user ID using signed-in user_id.

&lt;/script&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2014/06/dynamics-crm-how-to-add-working-days-by.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-7602893358519540454</guid><pubDate>Thu, 19 Jun 2014 11:38:00 +0000</pubDate><atom:updated>2015-03-06T11:24:36.403+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013 Timer</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">SLA Clock</category><category domain="http://www.blogger.com/atom/ns#">SLA Timer</category><category domain="http://www.blogger.com/atom/ns#">This button is currently disabled</category><category domain="http://www.blogger.com/atom/ns#">Timer</category><title>CRM 2013: Timer button is currently disabled</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Service pack 1 of Dynamics CRM 2013 came up with an exciting feature of SLA Timer. Timers can be used to track service level agreement KPI to ensure customer commitments are met. Today I was trying to get my hands on it but after installing Service Pack 1, I discovered that Timer option was greyed out on form editor. It was saying:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&quot;This button is currently disabled&quot;.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&quot;You may not have selected the item that works with this feature. If you don not have permissions to use this feature, correct your system.&quot; &lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIvGfdJ1KrRbhA9t-vKAj6wB8uCN7CgnEa-ucPIkDf2djgVsHSWC2T4390YJeFOcVaNm4KJV6g1JKPOaTI4cJ-hspeAyy7XD_R2MlSyGkUz2Jx_SaWMqfyppZC14wdRLVKsZDjmT3hM8Y/s1600/1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIvGfdJ1KrRbhA9t-vKAj6wB8uCN7CgnEa-ucPIkDf2djgVsHSWC2T4390YJeFOcVaNm4KJV6g1JKPOaTI4cJ-hspeAyy7XD_R2MlSyGkUz2Jx_SaWMqfyppZC14wdRLVKsZDjmT3hM8Y/s1600/1.jpg&quot; height=&quot;272&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp;Solution:&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Go to Settings &amp;gt; Administration &amp;gt; Install Product Updates&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You will get the following screen.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUAB_ae2WhTGZ8O6OBl3xaTo2jsR_sBEwHFedmPow77-M1R1rUH0wYDJP6PAJFDV7j45X4OMxyYfk8wCDG-3P5hmK8tvKRLp1AzFjeR10DU17ATT81GpYPY4xdjHZr923KoliId8zoiDg/s1600/2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUAB_ae2WhTGZ8O6OBl3xaTo2jsR_sBEwHFedmPow77-M1R1rUH0wYDJP6PAJFDV7j45X4OMxyYfk8wCDG-3P5hmK8tvKRLp1AzFjeR10DU17ATT81GpYPY4xdjHZr923KoliId8zoiDg/s1600/2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
Install the updated by clicking on &#39;Update&#39; at the bottom of the screen.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
it will install the updated and in the mean time you can watch the video on installation screen to know more about this brilliant feature. Once updated you will get the confirmation screen.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Open case form in form editor. You will see that &#39;Timer&#39; button is enabled not and it is ready to use.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCo4QPH_lg88fTJVi3_YBifVsyvRmq12nNoED2YcqTUfjW4bthrngzCILceSemn8u7UO70X3LSPXGR_GdWNv3i-vI9u6AQ3osTESkQXeugyOjlhMq5FzNIP0cDxeouc2uqLGlTz_Jzj0Y/s1600/3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCo4QPH_lg88fTJVi3_YBifVsyvRmq12nNoED2YcqTUfjW4bthrngzCILceSemn8u7UO70X3LSPXGR_GdWNv3i-vI9u6AQ3osTESkQXeugyOjlhMq5FzNIP0cDxeouc2uqLGlTz_Jzj0Y/s1600/3.JPG&quot; height=&quot;145&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
P. S. Hayer&lt;br /&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;(ਪ੍ਰੇਮਜੀਤ ਸਿੰਘ ਹੇਰ&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Please check my other (non-CRM) blog here: 
  &lt;a href=&quot;http://ps-hayer.blogspot.co.uk/&quot;&gt;
    Programming Blogs
  &lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2014/06/crm-2013-timer-button-on-is-currently.html</link><author>noreply@blogger.com (HayerCRM)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIvGfdJ1KrRbhA9t-vKAj6wB8uCN7CgnEa-ucPIkDf2djgVsHSWC2T4390YJeFOcVaNm4KJV6g1JKPOaTI4cJ-hspeAyy7XD_R2MlSyGkUz2Jx_SaWMqfyppZC14wdRLVKsZDjmT3hM8Y/s72-c/1.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.508515 -0.12548719999995228</georss:point><georss:box>51.192402 -0.77093419999995227 51.824628000000004 0.51995980000004771</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-4896657601511128477</guid><pubDate>Mon, 12 May 2014 12:53:00 +0000</pubDate><atom:updated>2015-03-06T11:24:48.403+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">Cancel Workflow</category><category domain="http://www.blogger.com/atom/ns#">Cancel Workflow Programmatically</category><category domain="http://www.blogger.com/atom/ns#">CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">Get process by name</category><category domain="http://www.blogger.com/atom/ns#">Get Workflow by Name</category><category domain="http://www.blogger.com/atom/ns#">Plugin</category><category domain="http://www.blogger.com/atom/ns#">search process by name</category><category domain="http://www.blogger.com/atom/ns#">Workflow</category><title>CRM 2011: How to Cancel/Terminate Workflow Programmatically using C#</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I was assigned a task where workflow was running on status change and then it waits for few days to send an email message to contact. During the period of wait if status has been changed to something else then workflow should be cancelled.&lt;br /&gt;
&lt;br /&gt;
So I have written a plugin with following code, which check for the status. if status is changed then cancel the workflow as following. There is an easy way to code by hard-coding the process Guid but I tried to write generic code so that I can reuse it if needed.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;        /// &lt;summary&gt;
        /// Cancel the running workflow if it is still not completed
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;context&quot; /&gt;Organization Service Context
        /// &lt;param name=&quot;regardingObjectId&quot; /&gt;Regarding Entity Id
        /// &lt;param name=&quot;processName&quot; /&gt;Name of the workflow
        /// &lt;param name=&quot;entityLogicalName&quot; /&gt;Logical name of the Entity on which worklow is running
        private static void CancelRunningWorkflow(OrganizationServiceContext context,string entityLogicalName, Guid regardingObjectId, string processName)
        {
           // Get Process by name where its running on given incident
           // and current status is waiting, in process or waiting for resources
            var processes = (from p in context.CreateQuery&amp;lt;AsyncOperation&amp;gt;()
                where p.PrimaryEntityType == entityLogicalName
                      &amp;amp;&amp;amp; p.RegardingObjectId.Id == regardingObjectId
                      &amp;amp;&amp;amp; p.Name == processName
                      &amp;amp;&amp;amp;
                      (p.StatusCode.Value == 10 ||       // Waiting
                       p.StatusCode.Value == 20 ||       // In Process
                       p.StatusCode.Value == 0)          // Waiting For Resources
                select new AsyncOperation {Id = p.Id, StateCode = p.StateCode, StatusCode = p.StatusCode})
                .ToList();

           // Go through each process and set the status to Cancelled
            foreach (var process in processes)
            {
                process[&quot;statecode&quot;] = new OptionSetValue(3);
                process[&quot;statuscode&quot;] = new OptionSetValue(32);       // Cancelled
                context.UpdateObject(process);
            }
            // Save the changes
            context.SaveChanges();
        }
&lt;/pre&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;You can call the method as below:&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;CancelRunningWorkflow(context, Incident.EntityLogicalName, incident.Id, &quot;Workflow to Stop&quot;);
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;You can create linq Context as following:&lt;/span&gt;

&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;OrganizationServiceContext context = new OrganizationServiceContext(_service);
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;Note: Make sure use have permissions to cancel the process.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Happy Coding&lt;br /&gt;
&lt;br /&gt;
P. S. Hayer&lt;br /&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;(ਪ੍ਰੇਮਜੀਤ ਸਿੰਘ ਹੇਰ&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Please check my other (non-CRM) blog here: 
  &lt;a href=&quot;http://ps-hayer.blogspot.co.uk/&quot;&gt;
    Programming Blogs
  &lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;script&gt;
  (function(i,s,o,g,r,a,m){i[&#39;GoogleAnalyticsObject&#39;]=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,&#39;script&#39;,&#39;//www.google-analytics.com/analytics.js&#39;,&#39;ga&#39;);

  ga(&#39;create&#39;, &#39;UA-50919381-1&#39;, &#39;hayercrm.blogspot.com&#39;);
  ga(&#39;send&#39;, &#39;pageview&#39;);
  ga(‘set’, ‘&amp;uid’, {{USER_ID}}); // Set the user ID using signed-in user_id.

&lt;/script&gt;&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2014/05/crm-2011-how-to-cancel-workflow-using-c.html</link><author>noreply@blogger.com (HayerCRM)</author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.508515 -0.12548719999995228</georss:point><georss:box>51.192402 -0.77093419999995227 51.824628000000004 0.51995980000004771</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-4723562783369765185</guid><pubDate>Fri, 09 May 2014 16:23:00 +0000</pubDate><atom:updated>2015-03-06T11:25:02.784+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">CRM for Outlook</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">Get CRM for Outlook</category><title>CRM 2013: How to disable of &quot;Get CRM for Outlook&quot; notification bar permanently </title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Recently few of our users complained about &quot;Get CRM for Outlook&quot; notification they receive every time they login to CRM. However it is not as frustrating as popups but some laptop users feel that it takes little screen space and it is bit frustrating to close it every time. After spending little time I discovered that we can get rid of time as following.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQVDicX4Lfzl5ZUb0T2KORYbgxq6NQifxGjzu9o5V-8DFNBm4W6UZnpXV80xm2kh-JL_wQOGl299T49Rnff32DYnuHr-GshDYX7fmOzo5WQcPAyjZGmQD2R2dO_5-DU1YQwm-Hqc3xUcE/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQVDicX4Lfzl5ZUb0T2KORYbgxq6NQifxGjzu9o5V-8DFNBm4W6UZnpXV80xm2kh-JL_wQOGl299T49Rnff32DYnuHr-GshDYX7fmOzo5WQcPAyjZGmQD2R2dO_5-DU1YQwm-Hqc3xUcE/s1600/1.JPG&quot; height=&quot;74&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Login to the system as System Administrator and go to &lt;b&gt;Settings &amp;gt; Administration&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPPu0oIr06Lvhk9op4kMLljNTYnPMOs9m0h3aMxA0NQKGWJGsbf5OwZcRAUHzcsW1JF83CrJY0C6rnQNrCDj8kE72mMsRFTj4L1Xxm3xUbr0Y0YgGnrmN5SY4ziTQyg7pTVHlvQLLxyUM/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPPu0oIr06Lvhk9op4kMLljNTYnPMOs9m0h3aMxA0NQKGWJGsbf5OwZcRAUHzcsW1JF83CrJY0C6rnQNrCDj8kE72mMsRFTj4L1Xxm3xUbr0Y0YgGnrmN5SY4ziTQyg7pTVHlvQLLxyUM/s1600/2.JPG&quot; height=&quot;63&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Click on System Settings.&amp;nbsp;It will open System settings in new window.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAWkj8DI9S1bsHY0XCNqyGKzi1Wtou-ljpbGajHDAhfti5NcRM3S-HyupcR_WGEQqrTbgB8uLM-VblSL8ljOiKzv9-eaDsbdttHxoPKS20ZOj9PJWpSSjzdtQgczVJyGsyM6orQPFhm6g/s1600/3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAWkj8DI9S1bsHY0XCNqyGKzi1Wtou-ljpbGajHDAhfti5NcRM3S-HyupcR_WGEQqrTbgB8uLM-VblSL8ljOiKzv9-eaDsbdttHxoPKS20ZOj9PJWpSSjzdtQgczVJyGsyM6orQPFhm6g/s1600/3.JPG&quot; height=&quot;209&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Under out look tab go to the last option &quot;Set whether users see CRM for Outlook message&quot;. Select &#39;No&#39; and click OK.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidMIMIBtkCPIx95tra7EfzRQsii_TcjZbW8nTxItcvshKOEQRGaY3Fs7bz8WodHegpX3Tqt-0AxM3T_9JiwNeDiTp7vrkvPjPOAxi8KWWWKTG_Na87Ht33tq_Z20XuCij88OwPaYfBgOs/s1600/4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidMIMIBtkCPIx95tra7EfzRQsii_TcjZbW8nTxItcvshKOEQRGaY3Fs7bz8WodHegpX3Tqt-0AxM3T_9JiwNeDiTp7vrkvPjPOAxi8KWWWKTG_Na87Ht33tq_Z20XuCij88OwPaYfBgOs/s1600/4.JPG&quot; height=&quot;213&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Users will not get the &quot;Get CRM for Outlook&quot; message again, unitl you want it.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Same Steps can be followed to remove this message from CRM 2011 as well.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
P. S. Hayer&lt;br /&gt;
(ਪ੍ਰੇਮਜੀਤ ਸਿੰਘ ਹੇਰ)
&lt;br /&gt;
&lt;div&gt;
Please check my other (non-CRM) blog here: 
  &lt;a href=&quot;http://ps-hayer.blogspot.co.uk/&quot;&gt;
    Programming Blogs
  &lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;script&gt;
  (function(i,s,o,g,r,a,m){i[&#39;GoogleAnalyticsObject&#39;]=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,&#39;script&#39;,&#39;//www.google-analytics.com/analytics.js&#39;,&#39;ga&#39;);

  ga(&#39;create&#39;, &#39;UA-50919381-1&#39;, &#39;hayercrm.blogspot.com&#39;);
  ga(&#39;send&#39;, &#39;pageview&#39;);
ga(‘set’, ‘&amp;uid’, {{USER_ID}}); // Set the user ID using signed-in user_id.
&lt;/script&gt;&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2014/05/crm-2013-how-to-get-rid-of-get-crm-for.html</link><author>noreply@blogger.com (HayerCRM)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQVDicX4Lfzl5ZUb0T2KORYbgxq6NQifxGjzu9o5V-8DFNBm4W6UZnpXV80xm2kh-JL_wQOGl299T49Rnff32DYnuHr-GshDYX7fmOzo5WQcPAyjZGmQD2R2dO_5-DU1YQwm-Hqc3xUcE/s72-c/1.JPG" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.508515 -0.12548719999995228</georss:point><georss:box>51.192402 -0.77093419999995227 51.824628000000004 0.51995980000004771</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8581690438072849213.post-1142655901010598137</guid><pubDate>Tue, 29 Apr 2014 10:07:00 +0000</pubDate><atom:updated>2015-03-06T11:26:32.046+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">#MSDYNCRM</category><category domain="http://www.blogger.com/atom/ns#">#PSHAYER</category><category domain="http://www.blogger.com/atom/ns#">CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2011</category><category domain="http://www.blogger.com/atom/ns#">Dynamics CRM 2013</category><category domain="http://www.blogger.com/atom/ns#">ErrorSerializingRegFile</category><category domain="http://www.blogger.com/atom/ns#">RegisterPlugin</category><category domain="http://www.blogger.com/atom/ns#">TFS</category><category domain="http://www.blogger.com/atom/ns#">The resource string ErrorSerializingRegFile</category><title>CRM 2011 - Error registering plugins and/or workflows. The resource string &quot;ErrorSerializingRegFile&quot; for the &quot;RegisterPlugin&quot; task cannot be found. Confirm that the resource name &quot;ErrorSerializingRegFile&quot; is correctly spelled, and the resource exists in the task&#39;s assembly.</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;This is very common error which we get while deploying CRM 2011 plugins solution using Developer Tool Kit.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;I have experienced this only where source is kept in TFS. I have used SVN in past and have not had any issues. But once we migrated to TFS we started getting this error.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I have seen many people over the internet and new starters in my team asking about the same error. So I thought about writing this blog.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;u&gt;Error:&lt;/u&gt;&amp;nbsp;&lt;/b&gt;Error registering plugins and/or workflows. The resource string &quot;ErrorSerializingRegFile&quot; for the &quot;RegisterPlugin&quot; task cannot be found. Confirm that the resource name &quot;ErrorSerializingRegFile&quot; is correctly spelled, and the resource exists in the task&#39;s assembly.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEEQdgsmC3JuVwsUH3Iu6eswxo3I0uxetjDaC9fKTe3tFA_w6UolPELEQwNQi_P1s0W99NzucCQxLLYNi3EEyXb-gHA_l4Yg8UV13HHQBE5WqhIOp1ViHZZdeyiJjccgUPqGhRr5lf2c0/s1600/TFS1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEEQdgsmC3JuVwsUH3Iu6eswxo3I0uxetjDaC9fKTe3tFA_w6UolPELEQwNQi_P1s0W99NzucCQxLLYNi3EEyXb-gHA_l4Yg8UV13HHQBE5WqhIOp1ViHZZdeyiJjccgUPqGhRr5lf2c0/s1600/TFS1.JPG&quot; height=&quot;104&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;u&gt;Cause:&lt;/u&gt; &lt;/b&gt;When we deploy the solution using developer tool kit in Visual studio, it tries to update RegisterFile.crmregister. Because its checked in to TFS, system fails to check-out and update the file.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;u&gt;Solution:&lt;/u&gt; &lt;/b&gt;Checkout the RegisterFile.crmregister file manually and deploy again.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge63ghv2MeJgWPpP0wuOoeyVg3IvWbtfo7RBploL1inGCyR6KJYGnmaY5Z0vwJyUaSChglhEdz39qPVoqPq0ebL6w1Bzj5BLS_1qXZpMyw5263gs2nb1wFjAGkWYd4-tNk7zI6CGIN7E8/s1600/TFS.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge63ghv2MeJgWPpP0wuOoeyVg3IvWbtfo7RBploL1inGCyR6KJYGnmaY5Z0vwJyUaSChglhEdz39qPVoqPq0ebL6w1Bzj5BLS_1qXZpMyw5263gs2nb1wFjAGkWYd4-tNk7zI6CGIN7E8/s1600/TFS.JPG&quot; height=&quot;320&quot; width=&quot;223&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
I hope it will help many people.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
Happy Coding.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
P S Hayer&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
( ਪ੍ਰੇਮਜੀਤ ਸਿੰਘ ਹੇਰ&amp;nbsp;)&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
Please check my other (non-CRM) blog here: 
  &lt;a href=&quot;http://ps-hayer.blogspot.co.uk/&quot;&gt;
    Programming Blogs
  &lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;script&gt;
  (function(i,s,o,g,r,a,m){i[&#39;GoogleAnalyticsObject&#39;]=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,&#39;script&#39;,&#39;//www.google-analytics.com/analytics.js&#39;,&#39;ga&#39;);

  ga(&#39;create&#39;, &#39;UA-50919381-1&#39;, &#39;hayercrm.blogspot.com&#39;);
  ga(&#39;send&#39;, &#39;pageview&#39;);
ga(‘set’, ‘&amp;uid’, {{USER_ID}}); // Set the user ID using signed-in user_id.
&lt;/script&gt;&lt;/div&gt;
</description><link>http://hayercrm.blogspot.com/2014/04/crm-2011-error-registering-plugins.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEEQdgsmC3JuVwsUH3Iu6eswxo3I0uxetjDaC9fKTe3tFA_w6UolPELEQwNQi_P1s0W99NzucCQxLLYNi3EEyXb-gHA_l4Yg8UV13HHQBE5WqhIOp1ViHZZdeyiJjccgUPqGhRr5lf2c0/s72-c/TFS1.JPG" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.508515 -0.12548719999995228</georss:point><georss:box>51.192402 -0.77093419999995227 51.824628000000004 0.51995980000004771</georss:box></item></channel></rss>