tag:blogger.com,1999:blog-8474138585666424212024-03-15T18:09:12.176-07:00Jerry's BlogAnonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-847413858566642421.post-59621137728818252532017-11-07T14:54:00.005-08:002017-11-07T14:54:57.252-08:00Unsupported Customization<br />
<div class="lf-text-block lf-block" data-lf-anchor-id="8a844848418eb121b1e9aa8443e64a89:0" style="background-color: white; color: #222222; font-family: segoe-ui_normal, "Segoe UI", Segoe, "Segoe WP", "Helvetica Neue", Helvetica, sans-serif; font-size: 16px; margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Modifications to Dynamics 365 that are made without using either the methods described in this documentation or Dynamics 365 tools are not supported and are not preserved during updates or upgrades of Dynamics 365. Anything that is not documented in this documentation and supporting documents is not supported. Additionally, unsupported modifications could cause problems when you update through the addition of hotfixes or service packs or upgrade Dynamics 365. To minimize update and upgrade issues, do not modify any Dynamics 365 file that you did not create yourself.<span class="lf-thread-btn" style="position: absolute !important; right: 0px !important; top: 0px !important;"></span></div>
<div class="lf-text-block lf-block" data-lf-anchor-id="0000850ac0910855304cc8d7cf504a45:0" style="background-color: white; color: #222222; font-family: segoe-ui_normal, "Segoe UI", Segoe, "Segoe WP", "Helvetica Neue", Helvetica, sans-serif; font-size: 16px; margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
The following is a list of unsupported action types that are frequently asked about:<span class="lf-thread-btn" style="position: absolute !important; right: 0px !important; top: 0px !important;"></span></div>
<ul class="lf-text-block lf-block" data-lf-anchor-id="8be42c694f9eaef121e9a84d67476ae9:0" style="background-color: white; color: #222222; font-family: segoe-ui_normal, "Segoe UI", Segoe, "Segoe WP", "Helvetica Neue", Helvetica, sans-serif; font-size: 16px; margin: 16px 0px 16px 38px; padding-bottom: 0px; padding-left: 0px; padding-right: 25px !important; padding-top: 0px; position: relative !important;">
<li style="list-style: disc outside none;"><div class="" style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Modifications to any .aspx, .css, .htm, .js, .xml, .jpg, or .gif files or the addition of files in the <code style="-webkit-font-smoothing: auto; background-color: #f9f9f9; border-radius: 2px; border: 1px solid rgb(211, 214, 219); direction: ltr; display: inline-block; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 0.8rem; line-height: 19px; padding: 3px 7px;">wwwroot</code> directories of the Dynamics 365 application, Dynamics 365 tools, or Dynamics 365 files located at Program Files\Dynamics 365. However, if you have made changes to these files, these files are checked for modifications and will not be overwritten.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Modifications to the Dynamics 365 website (file and website settings). Custom applications should be installed in a different website. This includes modifications to the file system access control lists (ACLs) of any files on the Dynamics 365 server.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Use of client certificates is not supported. If you configure the Dynamics 365 website to require IIS client certificates, you will get authentication failures for any applications that were built using the SDK.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Modifications to the physical schema of the database, other than adding or updating indexes. This includes any actions performed against the database without using the System Customization capabilities in the web application or using the metadata APIs that are described in this SDK documentation. Modifying tables, stored procedures, or views in the database is not supported. Adding tables, stored procedures, or views to the database is also not supported because of referential integrity or upgrade issues. For Dynamics 365 (online) on-premises deployments, adding indexes is supported per the guidelines in the <a data-linktype="external" href="http://go.microsoft.com/fwlink/p/?LinkID=510793" style="background-color: transparent; color: #0078d7; cursor: pointer; text-decoration-line: none; word-wrap: break-word;">Deploying and administering Microsoft Dynamics 365 (on-premises)</a>documentation. This applies to all Dynamics 365 databases and the Dynamics 365 for Outlook local database.</div>
<div class="IMPORTANT alert" style="-webkit-box-direction: normal; -webkit-box-orient: horizontal; background-color: #eee9f8; border-color: rgb(218, 206, 239); border-radius: 6px; box-sizing: border-box; color: inherit; flex-flow: row wrap; font-size: 1rem; margin-top: 16px; max-height: 750px; padding: 20px; position: relative;">
<div style="color: #351e5e; font-size: 1rem; max-width: 95%; padding-right: 25px !important; position: relative !important; width: 582.469px;">
Important</div>
<div style="margin-top: 8px; max-width: 95%; padding-right: 25px !important; position: relative !important;">
When you change the database without using the support methods for system customization, you run the risk of problems occurring during updates and upgrades.</div>
</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Data (record) changes in the Dynamics 365 database using SQL commands or any technology other than those described in this documentation.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Referencing any Dynamics 365 dynamic-link libraries (DLLs) other than the following:</div>
<ul style="margin: 16px 0px 16px 38px; padding-bottom: 0px; padding-left: 0px; padding-right: 25px !important; padding-top: 0px; position: relative !important;">
<li style="list-style: circle outside none;">Microsoft.Xrm.Sdk.dll</li>
<li style="list-style: circle outside none;">Microsoft.Crm.Sdk.Proxy.dll</li>
<li style="list-style: circle outside none;">Microsoft.Xrm.Sdk.Workflow.dll</li>
<li style="list-style: circle outside none;">Microsoft.Xrm.Sdk.Deployment.dll</li>
<li style="list-style: circle outside none;">Microsoft.Crm.Outlook.Sdk.dll</li>
<li style="list-style: circle outside none;">Microsoft.Xrm.Sdk.Data.dll</li>
</ul>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
The use of application programming interfaces (APIs) other than the documented APIs in the web services: Web API, Organization Service, Deployment Service, Discovery Service, Organization Data Service.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
To achieve the appearance and behavior of Dynamics 365, the reuse of any Dynamics 365 user interface controls, including the grid controls. These controls may change or be overwritten during an upgrade. We do not recommend that you use or change the Default.css file in the Dynamics 365 root installation folder.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
The reuse of any Dynamics 365 JavaScript code, including ribbon commands. This code may change or be overwritten during an upgrade.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Modifications to any one of the Dynamics 365 forms or adding new forms, such as custom .aspx pages, directly to Office Outlook or making changes to .pst files. These changes will not be upgraded.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Making customizations except when you use the Dynamics 365 supported tools available offline in the Dynamics 365 for Outlook.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
The use of custom HttpModules to inject HTML/DHTML into the Dynamics 365 Forms.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Creating a plug-in assembly for a standard Dynamics 365 assembly (Microsoft.Crm.*.dll) or performing an update or delete of a platform created <code style="-webkit-font-smoothing: auto; background-color: #f9f9f9; border-radius: 2px; border: 1px solid rgb(211, 214, 219); direction: ltr; display: inline-block; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 0.8rem; line-height: 19px; padding: 3px 7px;">pluginassembly</code> is not supported.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Creating an Internet Information Services (IIS) application inside the Dynamics 365 website for any VDir and specifically within the ISV folder is not supported. The <crmwebroot>\ISV folder is no longer supported.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Editing a solutions file to edit any solution components other than ribbons, forms, SiteMap, or saved queries is not supported. For more information, see <a data-linktype="relative-path" href="https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/customize-dev/when-edit-customization-file" style="background-color: transparent; color: #0078d7; cursor: pointer; text-decoration-line: none; word-wrap: break-word;">Support for Editing the Customization File</a>. Defining new solution components by editing the solutions file is not supported. Editing web resource files exported with a solution is not supported. Except for the steps documented in <a data-linktype="relative-path" href="https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/maintain-managed-solutions" style="background-color: transparent; color: #0078d7; cursor: pointer; text-decoration-line: none; word-wrap: break-word;">Maintain Managed Solutions</a>, editing the contents of a managed solution is not supported.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Silverlight <a data-linktype="external" href="https://msdn.microsoft.com/library/dd833069.aspx" style="background-color: transparent; color: #0078d7; cursor: pointer; text-decoration-line: none; word-wrap: break-word;">Application Library Caching</a> is not supported.</div>
</li>
<li style="list-style: disc outside none;"><div style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Displaying an entity form within an IFrame embedded in another entity form is not supported.</div>
</li>
<li style="list-style: disc outside none;"><div class="x-hidden-focus" style="margin-top: 1rem; padding-right: 25px !important; position: relative !important;">
Plugin and Workflow Assemblies must contain all the necessary logic within the respective dll. Plugins may reference some core .Net assemblies. However, we do not support dependencies on .Net assemblies that interact with low-level Windows APIs, such as the graphics design interface. Previously, Dynamics 365 allowed for assemblies to refer to these interfaces, but to adhere to our security standards, changes to this behavior are required.</div>
</li>
</ul>
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-88349295604037182472016-10-25T15:53:00.000-07:002016-10-25T15:57:12.143-07:00Importing CRM solution - Workflow owner<div class="MsoNormal" style="background-color: white; color: #666666; font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px; margin: 0in 0in 0pt;">
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"> I am importing a solution that contains processes and it fails with this error message “<i>The workflow cannot be published or unpublished by someone who is not its owner</i>”. What is wrong?<o:p></o:p></span></b></div>
<span style="background-color: white; color: #666666; font-family: "arial" , "helvetica" , sans-serif; font-size: 13.2px; line-height: 18.48px;"></span><br style="background-color: white; color: #666666; font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px;" />
<div class="MsoNormal" style="background-color: white; color: #666666; font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px; margin: 0in 0in 0pt;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">If your solution contains a process that already exists in the organization and is activated then solution import will attempt to update it. In order to do so, it must first deactivate it. However, if the owner of the activated process is not the same as the user who is importing the solution, then deactivating the process will fail. Therefore you have a few options to fix this problem:<o:p></o:p></span></div>
<span style="background-color: white; color: #666666; font-family: "arial" , "helvetica" , sans-serif; font-size: 13.2px; line-height: 18.48px;"></span><br style="background-color: white; color: #666666; font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px;" />
<div class="MsoListParagraphCxSpFirst" style="background-color: white; color: #666666; font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px; margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">1.<span style="font-family: "times new roman"; font-stretch: normal; line-height: normal;"> </span>Import the solution using the user who owns the activated process. This can be tricky, especially if there are multiple processes owned by different users which need to be updated by the solution import.<o:p></o:p></span></div>
<span style="background-color: white; color: #666666; font-family: "arial" , "helvetica" , sans-serif; font-size: 13.2px; line-height: 18.48px;"></span><br style="background-color: white; color: #666666; font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px;" />
<span style="background-color: white; color: #666666; font-family: "arial" , "helvetica" , sans-serif; font-size: 13.2px; line-height: 18.48px;"></span>
<div class="MsoListParagraphCxSpLast" style="-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-size: 13.2px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; line-height: 18.48px; margin: 0in 0in 0pt 0.5in; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">2.<span style="font-family: "times new roman"; font-stretch: normal; font-style: normal; font-weight: normal; line-height: normal;"> </span>Verify which processes are included in the solution, and then find them in the organization, if you can find them and they are not owned by you then you must assign them to yourself. You can reassign them to the original user after you import the solution; however, you will have to ask the process owners to activate it themselves.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="MsoNormal" style="font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px; margin: 0in 0in 0pt; text-indent: 0px;">
<b><span style="font-family: Arial, Helvetica, sans-serif;">Why can’t I activate/deactivate someone else’s workflow, even if I am the system administrator?<o:p></o:p></span></b></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 13.2px; line-height: 18.48px; text-indent: 0px;"></span><br style="font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px; text-indent: 0px;" /></span>
<div class="MsoNormal" style="font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-size: 13.2px; line-height: 18.48px; margin: 0in 0in 0pt; text-indent: 0px;">
<span style="font-family: Arial, Helvetica, sans-serif;">For the same security reason as explained above. You want the workflow owner to explicitly acknowledge that a workflow will be activated and will perform some actions on his behalf. You would not want to allow another user (even the system administrator) to decide that some process should be executed on another user’s behalf. If you want to activate/deactivate someone else’s process you must first assign it to yourself.</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-79671721407267924552015-09-21T15:18:00.000-07:002015-09-21T15:18:41.683-07:00Default Status And Status Reason Values<br />
<header class="entry-header">
<h1 class="entry-title">
</h1>
</header><br />
Status
reason transitions are an optional additional level of filtering to
define what the status reason value can be changed to for each status
reason.<br />
Entities that can have different status values have two fields that capture this data:<br />
<table>
<thead>
<tr>
<td width="295"><b>Display Name</b></td>
<td width="295"><b>Description</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">Status</td>
<td width="295">Represents the state of the record. Typically Active or Inactive. You cannot add new status options.</td>
</tr>
<tr>
<td width="295">Status Reason</td>
<td width="295">Represents a reason that is linked to a specific status.
Each status must have at least one possible status reason. You can add
additional status reason options.</td>
</tr>
</tbody>
</table>
Activity entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Open</td>
<td width="295">1 : Open</td>
</tr>
<tr>
<td width="295">1 : Completed</td>
<td width="295">2 : Completed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">3 : Canceled</td>
</tr>
<tr>
<td width="295">3 : Scheduled</td>
<td width="295">4 : Scheduled</td>
</tr>
</tbody>
</table>
Appointment entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Open</td>
<td width="295">1 : Free</td>
</tr>
<tr>
<td width="295">2 : Tentative</td>
</tr>
<tr>
<td width="295">1 : Completed</td>
<td width="295">3 : Completed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">4 : Canceled</td>
</tr>
<tr>
<td rowspan="2" width="295">3 : Scheduled</td>
<td width="295">5 : Busy</td>
</tr>
<tr>
<td width="295">6 : Out of Office</td>
</tr>
</tbody>
</table>
Article entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">1 : Draft</td>
<td width="295">1 : Draft</td>
</tr>
<tr>
<td width="295">2 : Unapproved</td>
<td width="295">2 : Unapproved</td>
</tr>
<tr>
<td width="295">3 : Published</td>
<td width="295">3 : Published</td>
</tr>
</tbody>
</table>
Authorization Server entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">1 : Enabled</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">2 : Disabled</td>
</tr>
</tbody>
</table>
Bulk Delete Operation entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Ready</td>
<td width="295">0 : Waiting For Resources</td>
</tr>
<tr>
<td rowspan="3" width="295">1 : Suspended</td>
<td width="295">10 : Waiting</td>
</tr>
<tr>
<td width="295">11 : Retrying</td>
</tr>
<tr>
<td width="295">12 : Paused</td>
</tr>
<tr>
<td rowspan="3" width="295">2 : Locked</td>
<td width="295">20 : In Progress</td>
</tr>
<tr>
<td width="295">21 : Pausing</td>
</tr>
<tr>
<td width="295">22 : Canceling</td>
</tr>
<tr>
<td rowspan="3" width="295">3 : Completed</td>
<td width="295">30 : Succeeded</td>
</tr>
<tr>
<td width="295">31 : Failed</td>
</tr>
<tr>
<td width="295">32 : Canceled</td>
</tr>
</tbody>
</table>
Campaign entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="6" width="295">0 : Active</td>
<td width="295">0 : Proposed</td>
</tr>
<tr>
<td width="295">1 : Ready To Launch</td>
</tr>
<tr>
<td width="295">2 : Launched</td>
</tr>
<tr>
<td width="295">3 : Completed</td>
</tr>
<tr>
<td width="295">4 : Canceled</td>
</tr>
<tr>
<td width="295">5 : Suspended</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">6 : Inactive</td>
</tr>
</tbody>
</table>
Campaign Activity entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="5" width="295">0 : Open</td>
<td width="295">1 : Proposed</td>
</tr>
<tr>
<td width="295">0 : In Progress</td>
</tr>
<tr>
<td width="295">4 : Pending</td>
</tr>
<tr>
<td width="295">5 : System Aborted</td>
</tr>
<tr>
<td width="295">6 : Completed</td>
</tr>
<tr>
<td width="295">1 : Closed</td>
<td width="295">2 : Closed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">3 : Canceled</td>
</tr>
</tbody>
</table>
Campaign Response entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Open</td>
<td width="295">1 : Open</td>
</tr>
<tr>
<td width="295">1 : Closed</td>
<td width="295">2 : Closed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">3 : Canceled</td>
</tr>
</tbody>
</table>
Case entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="4" width="295">0 : Active</td>
<td width="295">1 : In Progress</td>
</tr>
<tr>
<td width="295">2 : On Hold</td>
</tr>
<tr>
<td width="295">3 : Waiting for Details</td>
</tr>
<tr>
<td width="295">4 : Researching</td>
</tr>
<tr>
<td rowspan="2" width="295">1 : Resolved</td>
<td width="295">5 : Problem Solved</td>
</tr>
<tr>
<td width="295">1000 : Information Provided</td>
</tr>
<tr>
<td rowspan="2" width="295">2 : Canceled</td>
<td width="295">6 : Canceled</td>
</tr>
<tr>
<td width="295">2000 : Merged</td>
</tr>
</tbody>
</table>
Case Resolution entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Open</td>
<td width="295">1 : Open</td>
</tr>
<tr>
<td width="295">1 : Completed</td>
<td width="295">2 : Closed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">3 : Canceled</td>
</tr>
</tbody>
</table>
Column Mapping entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">1 : Active</td>
</tr>
</tbody>
</table>
Contract entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Draft</td>
<td width="295">1 : Draft</td>
</tr>
<tr>
<td width="295">1 : Invoiced</td>
<td width="295">2 : Invoiced</td>
</tr>
<tr>
<td width="295">2 : Active</td>
<td width="295">3 : Active</td>
</tr>
<tr>
<td width="295">3 : On Hold</td>
<td width="295">4 : On Hold</td>
</tr>
<tr>
<td width="295">4 : Canceled</td>
<td width="295">5 : Canceled</td>
</tr>
<tr>
<td width="295">5 : Expired</td>
<td width="295">6 : Expired</td>
</tr>
</tbody>
</table>
Contract Line entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Existing</td>
<td width="295">1 : New</td>
</tr>
<tr>
<td width="295">1 : Renewed</td>
<td width="295">2 : Renewed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">3 : Canceled</td>
</tr>
<tr>
<td width="295">3 : Expired</td>
<td width="295">4 : Expired</td>
</tr>
</tbody>
</table>
Data Import entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="6" width="295">0 : Active</td>
<td width="295">0 : Submitted</td>
</tr>
<tr>
<td width="295">1 : Parsing</td>
</tr>
<tr>
<td width="295">2 : Transforming</td>
</tr>
<tr>
<td width="295">3 : Importing</td>
</tr>
<tr>
<td width="295">4 : Completed</td>
</tr>
<tr>
<td width="295">5 : Failed</td>
</tr>
</tbody>
</table>
Discount List entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">100001 : Active</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">100002 : Inactive</td>
</tr>
</tbody>
</table>
Duplicate Detection Rule entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Inactive</td>
<td width="295">0 : Unpublished</td>
</tr>
<tr>
<td width="295">1 : Publishing</td>
</tr>
<tr>
<td width="295">1 : Active</td>
<td width="295">2 : Published</td>
</tr>
</tbody>
</table>
Email entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Open</td>
<td width="295">1 : Draft</td>
</tr>
<tr>
<td width="295">8 : Failed</td>
</tr>
<tr>
<td rowspan="5" width="295">1 : Completed</td>
<td width="295">2 : Completed</td>
</tr>
<tr>
<td width="295">3 : Sent</td>
</tr>
<tr>
<td width="295">4 : Received</td>
</tr>
<tr>
<td width="295">6 : Pending Send</td>
</tr>
<tr>
<td width="295">7 : Sending</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">5 : Canceled</td>
</tr>
</tbody>
</table>
Fax entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Open</td>
<td width="295">1 : Open</td>
</tr>
<tr>
<td rowspan="3" width="295">1 : Completed</td>
<td width="295">2 : Completed</td>
</tr>
<tr>
<td width="295">3 : Sent</td>
</tr>
<tr>
<td width="295">4 : Received</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">5 : Canceled</td>
</tr>
</tbody>
</table>
Goal entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">0 : Open</td>
</tr>
<tr>
<td rowspan="2" width="295">1 : Inactive</td>
<td width="295">1 : Closed</td>
</tr>
<tr>
<td width="295">2 : Discarded</td>
</tr>
</tbody>
</table>
Goal Metric entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">0 : Open</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">1 : Closed</td>
</tr>
</tbody>
</table>
Import Data entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">0 : Active</td>
</tr>
</tbody>
</table>
Import Entity Mapping entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">1 : Active</td>
</tr>
</tbody>
</table>
Import Log entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">0 : Active</td>
</tr>
</tbody>
</table>
Import Source File entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="6" width="295">0 : Active</td>
<td width="295">0 : Submitted</td>
</tr>
<tr>
<td width="295">1 : Parsing</td>
</tr>
<tr>
<td width="295">2 : Transforming</td>
</tr>
<tr>
<td width="295">3 : Importing</td>
</tr>
<tr>
<td width="295">4 : Completed</td>
</tr>
<tr>
<td width="295">5 : Failed</td>
</tr>
</tbody>
</table>
Invoice entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="5" width="295">0 : Active</td>
<td width="295">1 : New</td>
</tr>
<tr>
<td width="295">2 : Partially Shipped</td>
</tr>
<tr>
<td width="295">4 : Billed</td>
</tr>
<tr>
<td width="295">5 : Booked (applies to services)</td>
</tr>
<tr>
<td width="295">6 : Installed (applies to services)</td>
</tr>
<tr>
<td rowspan="2" width="295">1 : Closed (deprecated)</td>
<td width="295">3 : Canceled (deprecated)</td>
</tr>
<tr>
<td width="295">7 : Paid in Full (deprecated)</td>
</tr>
<tr>
<td rowspan="2" width="295">2 : Paid</td>
<td width="295">100001 : Complete</td>
</tr>
<tr>
<td width="295">100002 : Partial</td>
</tr>
<tr>
<td width="295">3 : Canceled</td>
<td width="295">100003 : Canceled</td>
</tr>
</tbody>
</table>
Lead entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Open</td>
<td width="295">1 : New</td>
</tr>
<tr>
<td width="295">2 : Contacted</td>
</tr>
<tr>
<td width="295">1 : Qualified</td>
<td width="295">3 : Qualified</td>
</tr>
<tr>
<td rowspan="4" width="295">2 : Disqualified</td>
<td width="295">4 : Lost</td>
</tr>
<tr>
<td width="295">5 : Cannot Contact</td>
</tr>
<tr>
<td width="295">6 : No Longer Interested</td>
</tr>
<tr>
<td width="295">7 : Canceled</td>
</tr>
</tbody>
</table>
Letter entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Open</td>
<td width="295">1 : Open</td>
</tr>
<tr>
<td width="295">2 : Draft</td>
</tr>
<tr>
<td rowspan="2" width="295">1 : Completed</td>
<td width="295">3 : Received</td>
</tr>
<tr>
<td width="295">4 : Sent</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">5 : Canceled</td>
</tr>
</tbody>
</table>
List Value Mapping entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">0 : Active</td>
</tr>
</tbody>
</table>
Lookup Mapping entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">0 : Active</td>
</tr>
</tbody>
</table>
Marketing List entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">0 : Active</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">1 : Inactive</td>
</tr>
</tbody>
</table>
Opportunity entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Open</td>
<td width="295">1 : In Progress</td>
</tr>
<tr>
<td width="295">2 : On Hold</td>
</tr>
<tr>
<td width="295">1 : Won</td>
<td width="295">3 : Won</td>
</tr>
<tr>
<td rowspan="2" width="295">2 : Lost</td>
<td width="295">4 : Canceled</td>
</tr>
<tr>
<td width="295">5 : Out-Sold</td>
</tr>
</tbody>
</table>
Opportunity Close entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Open</td>
<td width="295">1 : Open</td>
</tr>
<tr>
<td width="295">1 : Completed</td>
<td width="295">2 : Completed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">3 : Canceled</td>
</tr>
</tbody>
</table>
Order entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Active</td>
<td width="295">1 : New</td>
</tr>
<tr>
<td width="295">2 : Pending</td>
</tr>
<tr>
<td width="295">1 : Submitted</td>
<td width="295">3 : In Progress</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">4 : No Money</td>
</tr>
<tr>
<td rowspan="2" width="295">3 : Fulfilled</td>
<td width="295">100001 : Complete</td>
</tr>
<tr>
<td width="295">100002 : Partial</td>
</tr>
<tr>
<td width="295">4 : Invoiced</td>
<td width="295">100003 : Invoiced</td>
</tr>
</tbody>
</table>
Order Close entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Open</td>
<td width="295">1 : Open</td>
</tr>
<tr>
<td width="295">1 : Completed</td>
<td width="295">2 : Completed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">3 : Canceled</td>
</tr>
</tbody>
</table>
Owner Mapping entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">0 : Active</td>
</tr>
</tbody>
</table>
Partner Application entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">1 : Enabled</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">2 : Disabled</td>
</tr>
</tbody>
</table>
Phone Call entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Open</td>
<td width="295">1 : Open</td>
</tr>
<tr>
<td rowspan="2" width="295">1 : Completed</td>
<td width="295">2 : Made</td>
</tr>
<tr>
<td width="295">4 : Received</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">3 : Canceled</td>
</tr>
</tbody>
</table>
Price List entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">100001 : Active</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">100002 : Inactive</td>
</tr>
</tbody>
</table>
Process entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Draft</td>
<td width="295">1 : Draft</td>
</tr>
<tr>
<td width="295">1 : Activated</td>
<td width="295">2 : Activated</td>
</tr>
</tbody>
</table>
Process Session entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="3" width="295">0 : Incomplete</td>
<td width="295">1 : Not Started</td>
</tr>
<tr>
<td width="295">2 : In Progress</td>
</tr>
<tr>
<td width="295">3 : Paused</td>
</tr>
<tr>
<td rowspan="3" width="295">1 : Complete</td>
<td width="295">4 : Completed</td>
</tr>
<tr>
<td width="295">5 : Canceled</td>
</tr>
<tr>
<td width="295">6 : Failed</td>
</tr>
</tbody>
</table>
Queue entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">1 : Active</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">2 : Inactive</td>
</tr>
</tbody>
</table>
Queue Item entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">1 : Active</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">2 : Inactive</td>
</tr>
</tbody>
</table>
Quick Campaign entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Open</td>
<td width="295">1 : Pending</td>
</tr>
<tr>
<td width="295">2 : In Progress</td>
</tr>
<tr>
<td rowspan="2" width="295">1 : Closed</td>
<td width="295">3 : Aborted</td>
</tr>
<tr>
<td width="295">4 : Completed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">5 : Canceled</td>
</tr>
</tbody>
</table>
Quote entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Draft</td>
<td width="295">1 : In Progress</td>
</tr>
<tr>
<td rowspan="2" width="295">1 : Active</td>
<td width="295">2 : In Progress</td>
</tr>
<tr>
<td width="295">3 : Open</td>
</tr>
<tr>
<td width="295">2 : Won</td>
<td width="295">4 : Won</td>
</tr>
<tr>
<td rowspan="3" width="295">3 : Closed</td>
<td width="295">5 : Lost</td>
</tr>
<tr>
<td width="295">6 : Canceled</td>
</tr>
<tr>
<td width="295">7 : Revised</td>
</tr>
</tbody>
</table>
Quote Close entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Open</td>
<td width="295">1 : Open</td>
</tr>
<tr>
<td width="295">1 : Completed</td>
<td width="295">2 : Completed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">3 : Canceled</td>
</tr>
</tbody>
</table>
Recurring Appointment entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Open</td>
<td width="295">1 : Free</td>
</tr>
<tr>
<td width="295">2 : Tentative</td>
</tr>
<tr>
<td width="295">1 : Completed</td>
<td width="295">3 : Completed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">4 : Canceled</td>
</tr>
<tr>
<td rowspan="2" width="295">3 : Scheduled</td>
<td width="295">5 : Busy</td>
</tr>
<tr>
<td width="295">6 : Out of Office</td>
</tr>
</tbody>
</table>
Rollup Query entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">0 : Open</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">1 : Closed</td>
</tr>
</tbody>
</table>
Saved View entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Active</td>
<td width="295">1 : Active</td>
</tr>
<tr>
<td width="295">3 : All</td>
</tr>
<tr>
<td width="295">1 : Inactive</td>
<td width="295">2 : Inactive</td>
</tr>
</tbody>
</table>
Sdk Message Processing Step entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Enabled</td>
<td width="295">1 : Enabled</td>
</tr>
<tr>
<td width="295">1 : Disabled</td>
<td width="295">2 : Disabled</td>
</tr>
</tbody>
</table>
Service Activity entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" width="295">0 : Open</td>
<td width="295">1 : Requested</td>
</tr>
<tr>
<td width="295">2 : Tentative</td>
</tr>
<tr>
<td width="295">1 : Closed</td>
<td width="295">8 : Completed</td>
</tr>
<tr>
<td rowspan="2" width="295">2 : Canceled</td>
<td width="295">9 : Canceled</td>
</tr>
<tr>
<td width="295">10 : No Show</td>
</tr>
<tr>
<td rowspan="4" width="295">3 : Scheduled</td>
<td width="295">3 : Pending</td>
</tr>
<tr>
<td width="295">4 : Reserved</td>
</tr>
<tr>
<td width="295">6 : In Progress</td>
</tr>
<tr>
<td width="295">7 : Arrived</td>
</tr>
</tbody>
</table>
System Job entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Ready</td>
<td width="295">0 : Waiting For Resources</td>
</tr>
<tr>
<td width="295">1 : Suspended</td>
<td width="295">10 : Waiting</td>
</tr>
<tr>
<td rowspan="3" width="295">2 : Locked</td>
<td width="295">20 : In Progress</td>
</tr>
<tr>
<td width="295">21 : Pausing</td>
</tr>
<tr>
<td width="295">22 : Canceling</td>
</tr>
<tr>
<td rowspan="3" width="295">3 : Completed</td>
<td width="295">30 : Succeeded</td>
</tr>
<tr>
<td width="295">31 : Failed</td>
</tr>
<tr>
<td width="295">32 : Canceled</td>
</tr>
</tbody>
</table>
Task entity<br />
<table>
<thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="4" width="295">0 : Open</td>
<td width="295">2 : Not Started</td>
</tr>
<tr>
<td width="295">3 : In Progress</td>
</tr>
<tr>
<td width="295">4 : Waiting on someone else</td>
</tr>
<tr>
<td width="295">7 : Deferred</td>
</tr>
<tr>
<td width="295">1 : Completed</td>
<td width="295">5 : Completed</td>
</tr>
<tr>
<td width="295">2 : Canceled</td>
<td width="295">6 : Canceled</td>
</tr>
</tbody>
</table>
Transformation Mapping entity<br />
<table><thead>
<tr>
<td width="295"><b>State</b></td>
<td width="295"><b>Status Reason</b></td>
</tr>
</thead>
<tbody>
<tr>
<td width="295">0 : Active</td>
<td width="295">0 : Active</td></tr>
</tbody></table>
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-37394637248216851382015-09-01T15:53:00.002-07:002015-09-01T15:53:52.727-07:00CRM 2013 Adding an On Change Event to a Grid View<div class="entry-title">
<span class="byline"><span class="author vcard"><a class="url fn n" href="https://woodsworkblog.wordpress.com/author/woodsworkblog/" rel="author" title="View all posts by James Wood"></a></span></span> </div>
<!-- .entry-meta --><!-- .entry-header --><div class="entry-content">
How to add an on change event to a grid view, similar to an on load or save event, which will allow a developer to add some code to the page??<br />
<br />
<a href="https://woodsworkblog.files.wordpress.com/2014/01/capture.png"><img alt="Capture" class="aligncenter size-full wp-image-340" src="https://woodsworkblog.files.wordpress.com/2014/01/capture.png?w=652" /></a><br />
<span id="more-339"></span><br />
Take the contact associated view shown on the account (in the image above), imagine we wish to add JavaScript so that whenever the user clicks an option we get a chance to run some code. We don’t want to make the user click a button, we just need to chance to run some logic and show a message. If this was a form we could add an on change event, however this is a view and MSCRM doesn’t provide that kind of hook.<br />
So we need to get a little more creative:<br />
<ol>
<li>Add a new ribbon button to the sub grid with a command (in CRM 2013 buttons without commands are hidden).</li>
<li>Add an enable rule so the button is always disabled (in CRM 2013 disabled buttons are automatically hidden).</li>
<li>Add a JavaScript library to that enable rule – this is where we can place our custom code.</li>
<li>When the user makes a selection in the view, MSCRM automatically refreshes the ribbon (command bar), and re-evaluates the enable rules – effectively we have an on change event.</li>
</ol>
My ribbon editor of choice is <a href="http://www.develop1.net/public/page/Ribbon-Workbench-for-Dynamics-CRM-2011.aspx">Ribbon Workbench</a> from Scott Durrow.<br />
<strong>Building the Solution</strong><br />
Create a new solution (or reuse an old one, it doesn’t matter), include in that solution the entity which is shown in the associated view. In my case that is the contact. Into that solution also add a JavaScript library (new_select in my case).<a href="https://woodsworkblog.files.wordpress.com/2014/01/capture1.png"><img alt="Capture" class="aligncenter size-full wp-image-345" src="https://woodsworkblog.files.wordpress.com/2014/01/capture1.png?w=652" /></a><strong>Add the JavaScript</strong><br />
Into your JavaScript library add the following code, this will print the IDs of the records that are selected in associated view and will serve as the base for your developments.<br />
<div>
<div class="syntaxhighlighter jscript ie" id="highlighter_991356">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">OnClick(input) {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript comments">//This is where you can put your custom code</code></div>
<div class="line number3 index2 alt2">
<code class="jscript comments">//For the purposes of demonstration I'm just going to print the selected IDs</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">alert(input);</code></div>
<div class="line number5 index4 alt2">
</div>
<div class="line number6 index5 alt1">
<code class="jscript comments">//Return false so the button is always disabled and in CRM 2013 automatically hidden.</code></div>
<div class="line number7 index6 alt2">
<code class="jscript keyword">return</code> <code class="jscript keyword">false</code><code class="jscript plain">;</code></div>
<div class="line number8 index7 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<strong>Adding the Button</strong><br />
Time to fire up Ribbon Workbench and add the button.<br />
<ol>
<li>Add a new button within the SUB GRID section (also the associated view section).</li>
<li>Add a new command, set the command to be the command for the new button.</li>
<li>Add a URL action to the command which navigates to your favorite website – the user will never be able to click this button and open the link, but we need to add an action to the button otherwise CRM wont display it.</li>
<li>Add a new enable rule to the command:</li>
</ol>
<ul>
<li>Default: False – this will mean the button is always disabled and in CRM 2013 this means it is always hidden. This will be used if you didn’t provide a return value in your script.</li>
<li>Function Name: OnClick – this should match whatever you have defined in your JavaScript.</li>
<li>Library: $webresource:new_Select – this should match your library name, if you use the lookup control in Ribbon Workbench its fairly easy to select the correct file.</li>
<li>Parameters: SelectedControlSelectedItemIds – this will mean CRM will pass the function the ID of every selected ribbon in the grid view.</li>
</ul>
<a href="https://woodsworkblog.files.wordpress.com/2014/01/capture2.png"><img alt="Capture" class="aligncenter size-full wp-image-351" height="342" src="https://woodsworkblog.files.wordpress.com/2014/01/capture2.png?w=652&h=342" width="652" /></a><em></em><br />
<em><a href="https://woodsworkblog.files.wordpress.com/2014/01/capture4.png"><img alt="Capture" class="aligncenter size-full wp-image-353" src="https://woodsworkblog.files.wordpress.com/2014/01/capture4.png?w=652" /></a></em><br />
<strong>Test</strong><br />
Publish your changes and return to your parent entity (account in my case) and then start clicking grid records, and you should get something similar to the following.<br />
<a href="https://woodsworkblog.files.wordpress.com/2014/01/capture5.png"><img alt="Capture" class="aligncenter size-full wp-image-354" height="186" src="https://woodsworkblog.files.wordpress.com/2014/01/capture5.png?w=652&h=186" width="652" /></a><br />
<div>
<div class="syntaxhighlighter collapsed xml ie" id="highlighter_428924">
<div class="toolbar">
<span><a class="toolbar_item command_expandSource expandSource" href="https://woodsworkblog.wordpress.com/2014/01/27/crm-2013-adding-an-on-change-event-to-a-sub-grid/#">Ribbon XML</a></span><span><a class="toolbar_item command_help help" href="https://woodsworkblog.wordpress.com/2014/01/27/crm-2013-adding-an-on-change-event-to-a-sub-grid/#">?</a></span></div>
<table border="0" cellpadding="0" cellspacing="0"><caption>Ribbon XML</caption><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
<div class="line number13 index12 alt2">
13</div>
<div class="line number14 index13 alt1">
14</div>
<div class="line number15 index14 alt2">
15</div>
<div class="line number16 index15 alt1">
16</div>
<div class="line number17 index16 alt2">
17</div>
<div class="line number18 index17 alt1">
18</div>
<div class="line number19 index18 alt2">
19</div>
<div class="line number20 index19 alt1">
20</div>
<div class="line number21 index20 alt2">
21</div>
<div class="line number22 index21 alt1">
22</div>
<div class="line number23 index22 alt2">
23</div>
<div class="line number24 index23 alt1">
24</div>
<div class="line number25 index24 alt2">
25</div>
<div class="line number26 index25 alt1">
26</div>
<div class="line number27 index26 alt2">
27</div>
<div class="line number28 index27 alt1">
28</div>
<div class="line number29 index28 alt2">
29</div>
<div class="line number30 index29 alt1">
30</div>
<div class="line number31 index30 alt2">
31</div>
<div class="line number32 index31 alt1">
32</div>
<div class="line number33 index32 alt2">
33</div>
<div class="line number34 index33 alt1">
34</div>
<div class="line number35 index34 alt2">
35</div>
<div class="line number36 index35 alt1">
36</div>
<div class="line number37 index36 alt2">
37</div>
<div class="line number38 index37 alt1">
38</div>
<div class="line number39 index38 alt2">
39</div>
<div class="line number40 index39 alt1">
40</div>
<div class="line number41 index40 alt2">
41</div>
<div class="line number42 index41 alt1">
42</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="xml plain"><?</code><code class="xml keyword">xml</code> <code class="xml color1">version</code><code class="xml plain">=</code><code class="xml string">"1.0"</code> <code class="xml color1">encoding</code><code class="xml plain">=</code><code class="xml string">"utf-16"</code><code class="xml plain">?></code></div>
<div class="line number2 index1 alt1">
<code class="xml plain"><</code><code class="xml keyword">RibbonDiffXml</code> <code class="xml color1">xmlns:xsi</code><code class="xml plain">=</code><code class="xml string">"<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"</code> <code class="xml color1">xmlns:xsd</code><code class="xml plain">=</code><code class="xml string">"<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"</code><code class="xml plain">></code></div>
<div class="line number3 index2 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">CustomActions</code><code class="xml plain">></code></div>
<div class="line number4 index3 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">CustomAction</code> <code class="xml color1">Id</code><code class="xml plain">=</code><code class="xml string">"new.contact.Button1.Button.CustomAction"</code> <code class="xml color1">Location</code><code class="xml plain">=</code><code class="xml string">"Mscrm.SubGrid.contact.MainTab.Management.Controls._children"</code> <code class="xml color1">Sequence</code><code class="xml plain">=</code><code class="xml string">"5"</code><code class="xml plain">></code></div>
<div class="line number5 index4 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">CommandUIDefinition</code><code class="xml plain">></code></div>
<div class="line number6 index5 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">Button</code> <code class="xml color1">Command</code><code class="xml plain">=</code><code class="xml string">"new.contact.Command0.Command"</code> <code class="xml color1">Id</code><code class="xml plain">=</code><code class="xml string">"new.contact.Button1.Button"</code> <code class="xml color1">LabelText</code><code class="xml plain">=</code><code class="xml string">"$LocLabels:new.contact.Button1.Button.LabelText"</code> <code class="xml color1">Sequence</code><code class="xml plain">=</code><code class="xml string">"5"</code> <code class="xml color1">TemplateAlias</code><code class="xml plain">=</code><code class="xml string">"o1"</code> <code class="xml plain">/></code></div>
<div class="line number7 index6 alt2">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">CommandUIDefinition</code><code class="xml plain">></code></div>
<div class="line number8 index7 alt1">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">CustomAction</code><code class="xml plain">></code></div>
<div class="line number9 index8 alt2">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">CustomActions</code><code class="xml plain">></code></div>
<div class="line number10 index9 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">Templates</code><code class="xml plain">></code></div>
<div class="line number11 index10 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">RibbonTemplates</code> <code class="xml color1">Id</code><code class="xml plain">=</code><code class="xml string">"Mscrm.Templates"</code> <code class="xml plain">/></code></div>
<div class="line number12 index11 alt1">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">Templates</code><code class="xml plain">></code></div>
<div class="line number13 index12 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">CommandDefinitions</code><code class="xml plain">></code></div>
<div class="line number14 index13 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">CommandDefinition</code> <code class="xml color1">Id</code><code class="xml plain">=</code><code class="xml string">"new.contact.Command0.Command"</code><code class="xml plain">></code></div>
<div class="line number15 index14 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">EnableRules</code><code class="xml plain">></code></div>
<div class="line number16 index15 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">EnableRule</code> <code class="xml color1">Id</code><code class="xml plain">=</code><code class="xml string">"new.contact.EnableRule0.EnableRule"</code> <code class="xml plain">/></code></div>
<div class="line number17 index16 alt2">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">EnableRules</code><code class="xml plain">></code></div>
<div class="line number18 index17 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">DisplayRules</code> <code class="xml plain">/></code></div>
<div class="line number19 index18 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">Actions</code><code class="xml plain">></code></div>
<div class="line number20 index19 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">Url</code> <code class="xml color1">Address</code><code class="xml plain">=</code><code class="xml string">"<a href="https://woodsworkblog.wordpress.com/">https://woodsworkblog.wordpress.com</a>"</code> <code class="xml color1">WinMode</code><code class="xml plain">=</code><code class="xml string">"0"</code> <code class="xml plain">/></code></div>
<div class="line number21 index20 alt2">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">Actions</code><code class="xml plain">></code></div>
<div class="line number22 index21 alt1">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">CommandDefinition</code><code class="xml plain">></code></div>
<div class="line number23 index22 alt2">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">CommandDefinitions</code><code class="xml plain">></code></div>
<div class="line number24 index23 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">RuleDefinitions</code><code class="xml plain">></code></div>
<div class="line number25 index24 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">TabDisplayRules</code> <code class="xml plain">/></code></div>
<div class="line number26 index25 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">DisplayRules</code> <code class="xml plain">/></code></div>
<div class="line number27 index26 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">EnableRules</code><code class="xml plain">></code></div>
<div class="line number28 index27 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">EnableRule</code> <code class="xml color1">Id</code><code class="xml plain">=</code><code class="xml string">"new.contact.EnableRule0.EnableRule"</code><code class="xml plain">></code></div>
<div class="line number29 index28 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">CustomRule</code> <code class="xml color1">FunctionName</code><code class="xml plain">=</code><code class="xml string">"OnClick"</code> <code class="xml color1">Library</code><code class="xml plain">=</code><code class="xml string">"$webresource:new_Select"</code> <code class="xml color1">Default</code><code class="xml plain">=</code><code class="xml string">"false"</code><code class="xml plain">></code></div>
<div class="line number30 index29 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">CrmParameter</code> <code class="xml color1">Value</code><code class="xml plain">=</code><code class="xml string">"SelectedControlSelectedItemIds"</code> <code class="xml plain">/></code></div>
<div class="line number31 index30 alt2">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">CustomRule</code><code class="xml plain">></code></div>
<div class="line number32 index31 alt1">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">EnableRule</code><code class="xml plain">></code></div>
<div class="line number33 index32 alt2">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">EnableRules</code><code class="xml plain">></code></div>
<div class="line number34 index33 alt1">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">RuleDefinitions</code><code class="xml plain">></code></div>
<div class="line number35 index34 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">LocLabels</code><code class="xml plain">></code></div>
<div class="line number36 index35 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">LocLabel</code> <code class="xml color1">Id</code><code class="xml plain">=</code><code class="xml string">"new.contact.Button1.Button.LabelText"</code><code class="xml plain">></code></div>
<div class="line number37 index36 alt2">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">Titles</code><code class="xml plain">></code></div>
<div class="line number38 index37 alt1">
<code class="xml spaces"> </code><code class="xml plain"><</code><code class="xml keyword">Title</code> <code class="xml color1">description</code><code class="xml plain">=</code><code class="xml string">"Button"</code> <code class="xml color1">languagecode</code><code class="xml plain">=</code><code class="xml string">"1033"</code> <code class="xml plain">/></code></div>
<div class="line number39 index38 alt2">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">Titles</code><code class="xml plain">></code></div>
<div class="line number40 index39 alt1">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">LocLabel</code><code class="xml plain">></code></div>
<div class="line number41 index40 alt2">
<code class="xml spaces"> </code><code class="xml plain"></</code><code class="xml keyword">LocLabels</code><code class="xml plain">></code></div>
<div class="line number42 index41 alt1">
<code class="xml plain"></</code><code class="xml keyword">RibbonDiffXml</code><code class="xml plain">></code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<em>Note for CRM 2011:</em> I believe the steps described above will still work, but you will end up with a disabled button sat on the ribbon. You could try adding a visibility rule to hide the button, but I don’t think CRM bothers to evaluate the enable rules of a hidden button so your custom code wont be called. So you could try piggy backing the enable rule on another existing button, but the rule should always returns true so the button is always visible.<br />
<em>Note for CRM 2013 & sub grids on the form:</em> Sub grids embedded on the form in CRM 2013 don’t get the ribbon (command) bar<em></em>, so these steps wont work there. I suggest removing any sub grids and just using the associated views if you really need this type of behavior.</div>
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-67536397457527563792015-02-19T12:39:00.001-08:002015-02-19T12:39:30.952-08:00CRM Javascript Functions<strong>1. Get the GUID value of a lookup field:</strong><br />
<em>Note: this example reads and pops the GUID of the primary contact on the Account form</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:bb719aa8-2682-43f6-9227-1ce03c724e4e" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_955216">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">AlertGUID() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">primaryContactGUID = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"primarycontactid"</code><code class="jscript plain">).getValue()[0].id;</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">alert(primaryContactGUID);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><strong>2. Get </strong>the Text value of a lookup field:</strong><br />
<em>Note: this example reads and pops the name of the primary contact on the Account form</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:c1d9017f-4b92-4079-91d3-e43de0f00cb6" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_195143">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">AlertText() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">primaryContactName = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"primarycontactid"</code><code class="jscript plain">).getValue()[0].name;</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">alert(primaryContactName);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><strong>3. Get </strong>the value of a text field:</strong><br />
<em>Note: this example reads and pops the value of the Main Phone (telephone1) field on the Account form</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:b5d405f2-8677-4e28-852c-bd1a505d48e7" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_57160">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">AlertTextField() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">MainPhone = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"telephone1"</code><code class="jscript plain">).getValue();</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">alert(MainPhone);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><strong>4. Get </strong>the database value of an Option Set field:</strong><br />
<em>Note: this example reads and pops the value of the Address Type (address1_addresstypecode) field on the Account form</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:b9e08104-251c-4a6b-a5ac-358d022f10cc" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_137984">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">AlertOptionSetDatabaseValue() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">AddressTypeDBValue = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"address1_addresstypecode"</code><code class="jscript plain">).getValue();</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(AddressTypeDBValue != </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">alert(AddressTypeDBValue);</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number6 index5 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><strong>5. Get </strong>the text value of an Option Set field:</strong><br />
<em>Note: this example reads and pops the value of the Address Type (address1_addresstypecode) field on the Account form</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:6d99e872-a3ef-4594-a90c-578814a5fb60" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_928876">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">AlertOptionSetDisplayValue() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">AddressTypeDisplayValue = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"address1_addresstypecode"</code><code class="jscript plain">).getText();</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(AddressTypeDisplayValue != </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">alert(AddressTypeDisplayValue);</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number6 index5 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><strong>6. Get </strong>the database value of a Bit field:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:55b0864d-cad6-4a23-bdb0-3db63ee91ca9" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_158817">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript comments">// example GetBitValue("telephone1");</code></div>
<div class="line number2 index1 alt1">
<code class="jscript keyword">function</code> <code class="jscript plain">GetBitValue(fieldname) {</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">return</code> <code class="jscript plain">Xrm.Page.data.entity.attributes.get(fieldname).getValue();</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><strong>7. Get </strong>the value of a Date field:</strong><br />
<em>returns a value like: Wed Nov 30 17:04:06 UTC+0800 2011</em><br />
and reflects the users time zone set under personal options<br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:f4f68535-15fe-4210-8bdc-25f3876a49fc" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_424572">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript comments">// example GetDate("createdon");</code></div>
<div class="line number2 index1 alt1">
<code class="jscript keyword">function</code> <code class="jscript plain">GetDate(fieldname) {</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">return</code> <code class="jscript plain">Xrm.Page.data.entity.attributes.get(fieldname).getValue();</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>8. Get the day, month and year parts from a Date field:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:81396a35-5b4e-4ead-8b53-abc5d5c9dff3" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_685746">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
<div class="line number13 index12 alt2">
13</div>
<div class="line number14 index13 alt1">
14</div>
<div class="line number15 index14 alt2">
15</div>
<div class="line number16 index15 alt1">
16</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript comments">// This function takes the fieldname of a date field as input and returns a DD-MM-YYYY value</code></div>
<div class="line number2 index1 alt1">
<code class="jscript comments">// Note: the day, month and year variables are numbers</code></div>
<div class="line number3 index2 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">FormatDate(fieldname) {</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">d = Xrm.Page.data.entity.attributes.get(fieldname).getValue();</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(d != </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">curr_date = d.getDate();</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">curr_month = d.getMonth();</code></div>
<div class="line number8 index7 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">curr_month++; </code><code class="jscript comments">// getMonth() considers Jan month 0, need to add 1</code></div>
<div class="line number9 index8 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">curr_year = d.getFullYear();</code></div>
<div class="line number10 index9 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">return</code> <code class="jscript plain">curr_date + </code><code class="jscript string">"-"</code> <code class="jscript plain">+ curr_month + </code><code class="jscript string">"-"</code> <code class="jscript plain">+ curr_year;</code></div>
<div class="line number11 index10 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number12 index11 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">else</code> <code class="jscript keyword">return</code> <code class="jscript keyword">null</code><code class="jscript plain">;</code></div>
<div class="line number13 index12 alt2">
<code class="jscript plain">}</code></div>
<div class="line number14 index13 alt1">
</div>
<div class="line number15 index14 alt2">
<code class="jscript comments">// An example where the above function is called</code></div>
<div class="line number16 index15 alt1">
<code class="jscript plain">alert(FormatDate(</code><code class="jscript string">"new_date2"</code><code class="jscript plain">));</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>9. Set the value of a string field:</strong><br />
<em>Note: this example sets the Account Name field on the Account Form to “ABC”</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:c2e62a18-4f6e-401d-a1ae-23054678fb41" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_21802">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">SetStringField() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">Name = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"name"</code><code class="jscript plain">);</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">Name.setValue(</code><code class="jscript string">"ABC"</code><code class="jscript plain">);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>10. Set the value of an Option Set (pick list) field:</strong><br />
<em>Note: this example sets the Address Type field on the Account Form to “Bill To”, which corresponds to a database value of “1”</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:48647b2f-7d23-43f9-a3cc-29242fef004e" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_662066">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">SetOptionSetField() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">AddressType = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"address1_addresstypecode"</code><code class="jscript plain">);</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">AddressType.setValue(1);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>11. Set a Date field / Default a Date field to Today:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:86255642-522f-4312-b529-1cee1a575af0" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_45907">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript comments">//set date field to now (works on date and date time fields)</code></div>
<div class="line number2 index1 alt1">
<code class="jscript plain">Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"new_date1"</code><code class="jscript plain">).setValue(</code><code class="jscript keyword">new</code> <code class="jscript plain">Date());</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>12. Set a Date field to 7 days from now:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:4d537992-23c5-4279-a628-1504514280d7" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter as3" id="highlighter_132190">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="as3 color3">function</code> <code class="as3 plain">SetDateField() {</code></div>
<div class="line number2 index1 alt1">
<code class="as3 spaces"> </code><code class="as3 variable">var</code> <code class="as3 plain">today = </code><code class="as3 keyword">new</code> <code class="as3 keyword">Date</code><code class="as3 plain">();</code></div>
<div class="line number3 index2 alt2">
<code class="as3 spaces"> </code><code class="as3 variable">var</code> <code class="as3 plain">futureDate = </code><code class="as3 keyword">new</code> <code class="as3 keyword">Date</code><code class="as3 plain">(today.setDate(today.getDate() + </code><code class="as3 value">7</code><code class="as3 plain">));</code></div>
<div class="line number4 index3 alt1">
<code class="as3 spaces"> </code><code class="as3 plain">Xrm.Page.data.entity.attributes.</code><code class="as3 keyword">get</code><code class="as3 plain">(</code><code class="as3 string">"new_date2"</code><code class="as3 plain">).setValue(futureDate);</code></div>
<div class="line number5 index4 alt2">
<code class="as3 spaces"> </code><code class="as3 plain">Xrm.Page.data.entity.attributes.</code><code class="as3 keyword">get</code><code class="as3 plain">(</code><code class="as3 string">"new_date2"</code><code class="as3 plain">).setSubmitMode(</code><code class="as3 string">"always"</code><code class="as3 plain">); </code><code class="as3 comments">// Save the Disabled Field</code></div>
<div class="line number6 index5 alt1">
<code class="as3 plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>13. Set the Time portion of a Date Field:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:2b9e06ea-2745-46f0-999a-e4ad461f0779" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_913241">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript comments">// This is a function you can call to set the time portion of a date field</code></div>
<div class="line number2 index1 alt1">
<code class="jscript keyword">function</code> <code class="jscript plain">SetTime(attributeName, hour, minute) {</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">attribute = Xrm.Page.getAttribute(attributeName);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(attribute.getValue() == </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">attribute.setValue(</code><code class="jscript keyword">new</code> <code class="jscript plain">Date());</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">attribute.setValue(attribute.getValue().setHours(hour, minute, 0));</code></div>
<div class="line number8 index7 alt1">
<code class="jscript plain">}</code></div>
<div class="line number9 index8 alt2">
</div>
<div class="line number10 index9 alt1">
<code class="jscript comments">// Here's an example where I use the function to default the time to 8:30am</code></div>
<div class="line number11 index10 alt2">
<code class="jscript plain">SetTime('new_date2', 8, 30);</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>14. Set the value of a Lookup field:</strong><br />
<em>Note: here I am providing a reusable function…</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:4ec7679b-9ccb-414b-b40c-a348d8b8abeb" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_336955">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript comments">// Set the value of a lookup field</code></div>
<div class="line number2 index1 alt1">
<code class="jscript keyword">function</code> <code class="jscript plain">SetLookupValue(fieldName, id, name, entityType) {</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(fieldName != </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">lookupValue = </code><code class="jscript keyword">new</code> <code class="jscript plain">Array();</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">lookupValue[0] = </code><code class="jscript keyword">new</code> <code class="jscript plain">Object();</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">lookupValue[0].id = id;</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">lookupValue[0].name = name;</code></div>
<div class="line number8 index7 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">lookupValue[0].entityType = entityType;</code></div>
<div class="line number9 index8 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.getAttribute(fieldName).setValue(lookupValue);</code></div>
<div class="line number10 index9 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number11 index10 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<em>Here’s an example of how to call the function (I retrieve the
details of one lookup field and then call the above function to populate
another lookup field):</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:f0a7095a-2d91-450c-92e0-07a74f5d3333" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_64313">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">var</code> <code class="jscript plain">ExistingCase = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"new_existingcase"</code><code class="jscript plain">);</code></div>
<div class="line number2 index1 alt1">
<code class="jscript keyword">if</code> <code class="jscript plain">(ExistingCase.getValue() != </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">ExistingCaseGUID = ExistingCase.getValue()[0].id;</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">ExistingCaseName = ExistingCase.getValue()[0].name;</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">SetLookupValue(</code><code class="jscript string">"regardingobjectid"</code><code class="jscript plain">, ExistingCaseGUID, ExistingCaseName, </code><code class="jscript string">"incident"</code><code class="jscript plain">);</code></div>
<div class="line number6 index5 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>15. Split a Full Name into First Name and Last Name fields:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:10d1d8c3-2752-49f8-9b8a-37f422264313" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_406277">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">PopulateNameFields() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">ContactName = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"customerid"</code><code class="jscript plain">).getValue()[0].name;</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">mySplitResult = ContactName.split(</code><code class="jscript string">" "</code><code class="jscript plain">);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">fName = mySplitResult[0];</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">lName = mySplitResult[1];</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"firstname"</code><code class="jscript plain">).setValue(fName);</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"lastname"</code><code class="jscript plain">).setValue(lName);</code></div>
<div class="line number8 index7 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>16. Set the Requirement Level of a Field:</strong><br />
<em>Note: this example sets the requirement level of the Address Type field on the Account form to Required. </em><br />
<em>Note: setRequiredLevel(“none”) would make the field optional again.</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:477bd30a-ff6c-40c2-b4e1-43319b467163" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_557440">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">SetRequirementLevel() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">AddressType = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"address1_addresstypecode"</code><code class="jscript plain">);</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">AddressType.setRequiredLevel(</code><code class="jscript string">"required"</code><code class="jscript plain">);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>17. Disable a field:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:9099ffd6-c326-4c8a-be9e-07b849be2797" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_791507">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">SetEnabledState() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">AddressType = Xrm.Page.ui.controls.get(</code><code class="jscript string">"address1_addresstypecode"</code><code class="jscript plain">);</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">AddressType.setDisabled(</code><code class="jscript keyword">true</code><code class="jscript plain">);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>18. Force Submit the Save of a Disabled Field:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:47a5d88b-9349-4d2e-ba70-ebdf0d45dcad" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_191910">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript comments">// Save the Disabled Field</code></div>
<div class="line number2 index1 alt1">
<code class="jscript plain">Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"new_date1"</code><code class="jscript plain">).setSubmitMode(</code><code class="jscript string">"always"</code><code class="jscript plain">);</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>19. Show/Hide a field:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:38626ce8-7968-4901-a019-f816a3f5bcbd" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_803956">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">hideName() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">name = Xrm.Page.ui.controls.get(</code><code class="jscript string">"name"</code><code class="jscript plain">);</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">name.setVisible(</code><code class="jscript keyword">false</code><code class="jscript plain">);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>20. Show/Hide a field based on a Bit field </strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:226e8d16-471d-424e-9c37-fe6a9a897c26" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_281863">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">DisableExistingCustomerLookup() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">ExistingCustomerBit = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"new_existingcustomer"</code><code class="jscript plain">).getValue();</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(ExistingCustomerBit == </code><code class="jscript keyword">false</code><code class="jscript plain">) {</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.ui.controls.get(</code><code class="jscript string">"customerid"</code><code class="jscript plain">).setVisible(</code><code class="jscript keyword">false</code><code class="jscript plain">);</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">else</code> <code class="jscript plain">{</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.ui.controls.get(</code><code class="jscript string">"customerid"</code><code class="jscript plain">).setVisible(</code><code class="jscript keyword">true</code><code class="jscript plain">);</code></div>
<div class="line number8 index7 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number9 index8 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><strong>21. Show/Hide </strong>a nav item:</strong><br />
<em>Note: you need to refer to the nav id of the link, use F12 developer tools in IE to determine this</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:65c4b004-05fe-498a-bf1e-f8a8223b18a0" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_782591">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">hideContacts() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">objNavItem = Xrm.Page.ui.navigation.items.get(</code><code class="jscript string">"navContacts"</code><code class="jscript plain">);</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">objNavItem.setVisible(</code><code class="jscript keyword">false</code><code class="jscript plain">);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><strong>22. Show/Hide </strong>a Section:</strong><br />
Note: Here I provide a function you can use. Below the function is a sample.<br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:2a4e6ce4-0595-40ba-ae24-445c60e90dd6" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_391139">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">HideShowSection(tabName, sectionName, visible) {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">try</code> <code class="jscript plain">{</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.ui.tabs.get(tabName).sections.get(sectionName).setVisible(visible);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">catch</code> <code class="jscript plain">(err) { }</code></div>
<div class="line number6 index5 alt1">
<code class="jscript plain">}</code></div>
<div class="line number7 index6 alt2">
</div>
<div class="line number8 index7 alt1">
<code class="jscript plain">HideShowSection(</code><code class="jscript string">"general"</code><code class="jscript plain">, </code><code class="jscript string">"address"</code><code class="jscript plain">, </code><code class="jscript keyword">false</code><code class="jscript plain">); </code><code class="jscript comments">// "false" = invisible</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><strong>23. Show/Hide </strong>a Tab:</strong><br />
Note: Here I provide a function you can use. Below the function is a sample.<br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:28b7331c-ab91-431c-967f-7d2126dac7b9" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_218705">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">HideShowTab(tabName, visible) {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">try</code> <code class="jscript plain">{</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.ui.tabs.get(tabName).setVisible(visible);</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">catch</code> <code class="jscript plain">(err) { }</code></div>
<div class="line number6 index5 alt1">
<code class="jscript plain">}</code></div>
<div class="line number7 index6 alt2">
</div>
<div class="line number8 index7 alt1">
<code class="jscript plain">HideShowTab(</code><code class="jscript string">"general"</code><code class="jscript plain">, </code><code class="jscript keyword">false</code><code class="jscript plain">); </code><code class="jscript comments">// "false" = invisible</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>24. Save the form:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:96311243-bbf3-41a5-8091-ed86b4a5a197" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_126360">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">SaveAndClose() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.data.entity.save();</code></div>
<div class="line number3 index2 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>25. Save and close the form:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:47a3f479-fd70-4079-91dc-028213e12686" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_537366">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">SaveAndClose() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.data.entity.save(</code><code class="jscript string">"saveandclose"</code><code class="jscript plain">);</code></div>
<div class="line number3 index2 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>26. Close the form:</strong><br />
<em>Note: the user will be prompted for confirmation if unsaved changes exist</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:b714659a-25b4-4dcc-a2b6-6c93cb030295" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_459734">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">Close() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.ui.close();</code></div>
<div class="line number3 index2 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><span style="color: #333333;">27. Determine which fields on the form are dirty:</span></strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:324a8b61-5d95-4e84-90b2-7615b7d3b5bc" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_546711">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">var</code> <code class="jscript plain">attributes = Xrm.Page.data.entity.attributes.get()</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">for</code> <code class="jscript plain">(</code><code class="jscript keyword">var</code> <code class="jscript plain">i </code><code class="jscript keyword">in</code> <code class="jscript plain">attributes)</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">{</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">attribute = attributes[i];</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(attribute.getIsDirty())</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">{</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">alert(</code><code class="jscript string">"attribute dirty: "</code> <code class="jscript plain">+ attribute.getName());</code></div>
<div class="line number8 index7 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number9 index8 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>28. Determine the Form Type:</strong><br />
<em>Note: Form type codes: Create (1), Update (2), Read Only (3), Disabled (4), Bulk Edit (6)</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:bdc34ef7-cb61-4258-b81a-2ef09a4a9c55" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_581886">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">AlertFormType() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">FormType = Xrm.Page.ui.getFormType();</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(FormType != </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">alert(FormType);</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number6 index5 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>29. Get the GUID of the current record:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:006610d2-6714-400c-812a-af555d5baf6a" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_891890">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">AlertGUID() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">GUIDvalue = Xrm.Page.data.entity.getId();</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(GUIDvalue != </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">alert(GUIDvalue);</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number6 index5 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>30. Get the GUID of the current user:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:08290cbc-227f-42a6-9573-e1343371b9dc" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_363974">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">AlertGUIDofCurrentUser() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">UserGUID = Xrm.Page.context.getUserId();</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(UserGUID != </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">alert(UserGUID);</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number6 index5 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>31. Get the Security Roles of the current user:</strong><br />
(returns an array of GUIDs, note: my example reveals the first value in the array only)<br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:ba25c4b9-ed5c-4aaf-8b66-b5c65ba99488" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_218983">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">AlertRoles() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">alert(Xrm.Page.context.getUserRoles());</code></div>
<div class="line number3 index2 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>32. Determine the CRM server URL:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:33e97a59-e5e9-4608-a7e3-34a3f4d8c4b2" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_611021">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript comments">// Get the CRM URL</code></div>
<div class="line number2 index1 alt1">
<code class="jscript keyword">var</code> <code class="jscript plain">serverUrl = Xrm.Page.context.getServerUrl();</code></div>
<div class="line number3 index2 alt2">
</div>
<div class="line number4 index3 alt1">
<code class="jscript comments">// Cater for URL differences between on premise and online</code></div>
<div class="line number5 index4 alt2">
<code class="jscript keyword">if</code> <code class="jscript plain">(serverUrl.match(/\/$/)) {</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">serverUrl = serverUrl.substring(0, serverUrl.length - 1);</code></div>
<div class="line number7 index6 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>33. Refresh a Sub-Grid:</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:9206decb-5150-437f-8ac7-9f2e932eabef" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_396953">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">var</code> <code class="jscript plain">targetgird = Xrm.Page.ui.controls.get(</code><code class="jscript string">"target_grid"</code><code class="jscript plain">);</code></div>
<div class="line number2 index1 alt1">
<code class="jscript plain">targetgird.refresh();</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>34. Change the default entity in the lookup window of a Customer or Regarding field:</strong><br />
<em>Note: I am setting the customerid field’s lookup window to offer
Contacts (entityid 2) by default (rather than Accounts). I have also
hardcoded the GUID of the default view I wish displayed in the lookup
window. </em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:1f61ee77-6577-48d7-a1a1-8833011d7601" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter as3" id="highlighter_216578">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="as3 color3">function</code> <code class="as3 plain">ChangeLookup() {</code></div>
<div class="line number2 index1 alt1">
<code class="as3 spaces"> </code><code class="as3 plain">document.getElementById(</code><code class="as3 string">"customerid"</code><code class="as3 plain">).setAttribute(</code><code class="as3 string">"defaulttype"</code><code class="as3 plain">, </code><code class="as3 string">"2"</code><code class="as3 plain">);</code></div>
<div class="line number3 index2 alt2">
<code class="as3 spaces"> </code><code class="as3 variable">var</code> <code class="as3 plain">ViewGUID= </code><code class="as3 string">"A2D479C5-53E3-4C69-ADDD-802327E67A0D"</code><code class="as3 plain">;</code></div>
<div class="line number4 index3 alt1">
<code class="as3 spaces"> </code><code class="as3 plain">Xrm.Page.getControl(</code><code class="as3 string">"customerid"</code><code class="as3 plain">).setDefaultView(ViewGUID);</code></div>
<div class="line number5 index4 alt2">
<code class="as3 plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>35. Pop an existing CRM record (new approach):</strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:4baaa692-7759-4a8d-bfc8-b696a1bec380" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_747272">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">PopContact() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript comments">//get PrimaryContact GUID</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">primaryContactGUID = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"primarycontactid"</code><code class="jscript plain">).getValue()[0].id;</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(primaryContactGUID != </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript comments">//open Contact form</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Utility.openEntityForm(</code><code class="jscript string">"contact"</code><code class="jscript plain">, primaryContactGUID)</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number8 index7 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong>36. Pop an existing CRM record (old approach):</strong><br />
<em>Note: this example pops an existing Case record. The GUID of the
record has already been established and is stored in the variable
IncidentId.</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:60cb67c0-56ee-4396-9902-f3716e37271d" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_462384">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
01</div>
<div class="line number2 index1 alt1">
02</div>
<div class="line number3 index2 alt2">
03</div>
<div class="line number4 index3 alt1">
04</div>
<div class="line number5 index4 alt2">
05</div>
<div class="line number6 index5 alt1">
06</div>
<div class="line number7 index6 alt2">
07</div>
<div class="line number8 index7 alt1">
08</div>
<div class="line number9 index8 alt2">
09</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript comments">//Set features for how the window will appear</code></div>
<div class="line number2 index1 alt1">
<code class="jscript keyword">var</code> <code class="jscript plain">features = </code><code class="jscript string">"location=no,menubar=no,status=no,toolbar=no"</code><code class="jscript plain">;</code></div>
<div class="line number3 index2 alt2">
</div>
<div class="line number4 index3 alt1">
<code class="jscript comments">// Get the CRM URL</code></div>
<div class="line number5 index4 alt2">
<code class="jscript keyword">var</code> <code class="jscript plain">serverUrl = Xrm.Page.context.getServerUrl();</code></div>
<div class="line number6 index5 alt1">
</div>
<div class="line number7 index6 alt2">
<code class="jscript comments">// Cater for URL differences between on premise and online</code></div>
<div class="line number8 index7 alt1">
<code class="jscript keyword">if</code> <code class="jscript plain">(serverUrl.match(/\/$/)) {</code></div>
<div class="line number9 index8 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">serverUrl = serverUrl.substring(0, serverUrl.length - 1);</code></div>
<div class="line number10 index9 alt1">
<code class="jscript plain">}</code></div>
<div class="line number11 index10 alt2">
</div>
<div class="line number12 index11 alt1">
<code class="jscript plain">window.open(serverUrl + </code><code class="jscript string">"/main.aspx?etn=incident&pagetype=entityrecord&id="</code> <code class="jscript plain">+ encodeURIComponent(IncidentId), </code><code class="jscript string">"_blank"</code><code class="jscript plain">, features, </code><code class="jscript keyword">false</code><code class="jscript plain">);</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><span style="color: #333333;">37. Pop a blank CRM form (new approach):</span></strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:5dae1172-05ae-4709-84d5-11e2a05c83ed" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_178877">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">PopNewCase() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Utility.openEntityForm(</code><code class="jscript string">"incident"</code><code class="jscript plain">)</code></div>
<div class="line number3 index2 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><span style="color: #333333;">38. Pop a new CRM record with default values (new approach):</span></strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:e8d9f67c-90c6-4457-8f88-637227e5540e" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_253670">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
<div class="line number13 index12 alt2">
13</div>
<div class="line number14 index13 alt1">
14</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">CreateIncident() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript comments">//get Account GUID and Name</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">AccountGUID = Xrm.Page.data.entity.getId();</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">AccountName = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"name"</code><code class="jscript plain">).getValue();</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript comments">//define default values for new Incident record</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">parameters = {};</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">parameters[</code><code class="jscript string">"title"</code><code class="jscript plain">] = </code><code class="jscript string">"New customer support request"</code><code class="jscript plain">;</code></div>
<div class="line number8 index7 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">parameters[</code><code class="jscript string">"casetypecode"</code><code class="jscript plain">] = </code><code class="jscript string">"3"</code><code class="jscript plain">;</code></div>
<div class="line number9 index8 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">parameters[</code><code class="jscript string">"customerid"</code><code class="jscript plain">] = AccountGUID;</code></div>
<div class="line number10 index9 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">parameters[</code><code class="jscript string">"customeridname"</code><code class="jscript plain">] = AccountName;</code></div>
<div class="line number11 index10 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">parameters[</code><code class="jscript string">"customeridtype"</code><code class="jscript plain">] = </code><code class="jscript string">"account"</code><code class="jscript plain">;</code></div>
<div class="line number12 index11 alt1">
<code class="jscript spaces"> </code><code class="jscript comments">//pop incident form with default values</code></div>
<div class="line number13 index12 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Utility.openEntityForm(</code><code class="jscript string">"incident"</code><code class="jscript plain">, </code><code class="jscript keyword">null</code><code class="jscript plain">, parameters);</code></div>
<div class="line number14 index13 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><span style="color: #333333;"><strong>39. Pop a new CRM record with default values</strong> (old approach):</span></strong><br />
<em>Note: this example pops the Case form from the Phone Call form,
defaulting the Case’s CustomerID based on the Phone Call’s SenderID and
defaulting the Case Title to “New Case”</em><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:f61b875f-5169-4451-93fc-3e051e87e113" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_761492">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
<div class="line number13 index12 alt2">
13</div>
<div class="line number14 index13 alt1">
14</div>
<div class="line number15 index14 alt2">
15</div>
<div class="line number16 index15 alt1">
16</div>
<div class="line number17 index16 alt2">
17</div>
<div class="line number18 index17 alt1">
18</div>
<div class="line number19 index18 alt2">
19</div>
<div class="line number20 index19 alt1">
20</div>
<div class="line number21 index20 alt2">
21</div>
<div class="line number22 index21 alt1">
22</div>
<div class="line number23 index22 alt2">
23</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript comments">//Collect values from the existing CRM form that you want to default onto the new record</code></div>
<div class="line number2 index1 alt1">
<code class="jscript keyword">var</code> <code class="jscript plain">CallerGUID = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"from"</code><code class="jscript plain">).getValue()[0].id;</code></div>
<div class="line number3 index2 alt2">
<code class="jscript keyword">var</code> <code class="jscript plain">CallerName = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"from"</code><code class="jscript plain">).getValue()[0].name;</code></div>
<div class="line number4 index3 alt1">
</div>
<div class="line number5 index4 alt2">
<code class="jscript comments">//Set the parameter values</code></div>
<div class="line number6 index5 alt1">
<code class="jscript keyword">var</code> <code class="jscript plain">extraqs = </code><code class="jscript string">"&title=New Case"</code><code class="jscript plain">;</code></div>
<div class="line number7 index6 alt2">
<code class="jscript plain">extraqs += </code><code class="jscript string">"&customerid="</code> <code class="jscript plain">+ CallerGUID;</code></div>
<div class="line number8 index7 alt1">
<code class="jscript plain">extraqs += </code><code class="jscript string">"&customeridname="</code> <code class="jscript plain">+ CallerName;</code></div>
<div class="line number9 index8 alt2">
<code class="jscript plain">extraqs += </code><code class="jscript string">"&customeridtype=contact"</code><code class="jscript plain">;</code></div>
<div class="line number10 index9 alt1">
</div>
<div class="line number11 index10 alt2">
<code class="jscript comments">//Set features for how the window will appear</code></div>
<div class="line number12 index11 alt1">
<code class="jscript keyword">var</code> <code class="jscript plain">features = </code><code class="jscript string">"location=no,menubar=no,status=no,toolbar=no"</code><code class="jscript plain">;</code></div>
<div class="line number13 index12 alt2">
</div>
<div class="line number14 index13 alt1">
<code class="jscript comments">// Get the CRM URL</code></div>
<div class="line number15 index14 alt2">
<code class="jscript keyword">var</code> <code class="jscript plain">serverUrl = Xrm.Page.context.getServerUrl();</code></div>
<div class="line number16 index15 alt1">
</div>
<div class="line number17 index16 alt2">
<code class="jscript comments">// Cater for URL differences between on premise and online</code></div>
<div class="line number18 index17 alt1">
<code class="jscript keyword">if</code> <code class="jscript plain">(serverUrl.match(/\/$/)) {</code></div>
<div class="line number19 index18 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">serverUrl = serverUrl.substring(0, serverUrl.length - 1);</code></div>
<div class="line number20 index19 alt1">
<code class="jscript plain">}</code></div>
<div class="line number21 index20 alt2">
</div>
<div class="line number22 index21 alt1">
<code class="jscript comments">//Pop the window</code></div>
<div class="line number23 index22 alt2">
<code class="jscript plain">window.open(serverUrl + </code><code class="jscript string">"/main.aspx?etn=incident&pagetype=entityrecord&extraqs="</code> <code class="jscript plain">+ encodeURIComponent(extraqs), </code><code class="jscript string">"_blank"</code><code class="jscript plain">, features, </code><code class="jscript keyword">false</code><code class="jscript plain">);</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><span style="color: #333333;">40. Pop a Dialog from a ribbon button</span></strong><br />
<span style="color: black;"><em>Note: this example has the Dialog
GUID and CRM Server URL hardcoded, which you should avoid. A simple
function is included which centres the Dialog when launched.</em></span><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:ef7a0a1a-3177-4547-add2-2ff686418ecd" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_327203">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
01</div>
<div class="line number2 index1 alt1">
02</div>
<div class="line number3 index2 alt2">
03</div>
<div class="line number4 index3 alt1">
04</div>
<div class="line number5 index4 alt2">
05</div>
<div class="line number6 index5 alt1">
06</div>
<div class="line number7 index6 alt2">
07</div>
<div class="line number8 index7 alt1">
08</div>
<div class="line number9 index8 alt2">
09</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
<div class="line number13 index12 alt2">
13</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">LaunchDialog(sLeadID) {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">DialogGUID = </code><code class="jscript string">"128CEEDC-2763-4FA9-AB89-35BBB7D5517D"</code><code class="jscript plain">;</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">serverUrl = </code><code class="jscript string">"<a href="https://avanademarchdemo.crm5.dynamics.com/">https://avanademarchdemo.crm5.dynamics.com/</a>"</code><code class="jscript plain">;</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">serverUrl = serverUrl + </code><code class="jscript string">"cs/dialog/rundialog.aspx?DialogId="</code> <code class="jscript plain">+ </code><code class="jscript string">"{"</code> <code class="jscript plain">+ DialogGUID + </code><code class="jscript string">"}"</code> <code class="jscript plain">+ </code><code class="jscript string">"&EntityName=lead&ObjectId="</code> <code class="jscript plain">+ sLeadID;</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">PopupCenter(serverUrl, </code><code class="jscript string">"mywindow"</code><code class="jscript plain">, 400, 400);</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">window.location.reload(</code><code class="jscript keyword">true</code><code class="jscript plain">);</code></div>
<div class="line number7 index6 alt2">
<code class="jscript plain">}</code></div>
<div class="line number8 index7 alt1">
</div>
<div class="line number9 index8 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">PopupCenter(pageURL, title, w, h) {</code></div>
<div class="line number10 index9 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">left = (screen.width / 2) - (w / 2);</code></div>
<div class="line number11 index10 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">top = (screen.height / 2) - (h / 2);</code></div>
<div class="line number12 index11 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">targetWin = window.showModalDialog(pageURL, title, </code><code class="jscript string">'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='</code> <code class="jscript plain">+ w + </code><code class="jscript string">', height='</code> <code class="jscript plain">+ h + </code><code class="jscript string">', top='</code> <code class="jscript plain">+ top + </code><code class="jscript string">', left='</code> <code class="jscript plain">+ left);</code></div>
<div class="line number13 index12 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><span style="color: #333333;">41. Pop a URL from a ribbon button</span></strong><br />
<span style="color: black;"><em>Great info on the window parameters you can set here: <a href="http://javascript-array.com/scripts/window_open/" title="http://javascript-array.com/scripts/window_open/">http://javascript-array.com/scripts/window_open/</a></em></span><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:c0f31264-f09b-45d0-90ce-73147bcca327" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_136988">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
01</div>
<div class="line number2 index1 alt1">
02</div>
<div class="line number3 index2 alt2">
03</div>
<div class="line number4 index3 alt1">
04</div>
<div class="line number5 index4 alt2">
05</div>
<div class="line number6 index5 alt1">
06</div>
<div class="line number7 index6 alt2">
07</div>
<div class="line number8 index7 alt1">
08</div>
<div class="line number9 index8 alt2">
09</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
<div class="line number13 index12 alt2">
13</div>
<div class="line number14 index13 alt1">
14</div>
<div class="line number15 index14 alt2">
15</div>
<div class="line number16 index15 alt1">
16</div>
<div class="line number17 index16 alt2">
17</div>
<div class="line number18 index17 alt1">
18</div>
<div class="line number19 index18 alt2">
19</div>
<div class="line number20 index19 alt1">
20</div>
<div class="line number21 index20 alt2">
21</div>
<div class="line number22 index21 alt1">
22</div>
<div class="line number23 index22 alt2">
23</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">LaunchSite() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript comments">// read URL from CRM field</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">SiteURL = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"new_sharepointurl"</code><code class="jscript plain">).getValue();</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript comments">// execute function to launch the URL</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">LaunchFullScreen(SiteURL);</code></div>
<div class="line number6 index5 alt1">
<code class="jscript plain">}</code></div>
<div class="line number7 index6 alt2">
</div>
<div class="line number8 index7 alt1">
<code class="jscript keyword">function</code> <code class="jscript plain">LaunchFullScreen(url) {</code></div>
<div class="line number9 index8 alt2">
<code class="jscript spaces"> </code><code class="jscript comments">// set the window parameters</code></div>
<div class="line number10 index9 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">params = </code><code class="jscript string">'width='</code><code class="jscript plain">+screen.width;</code></div>
<div class="line number11 index10 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">params += </code><code class="jscript string">', height='</code><code class="jscript plain">+screen.height;</code></div>
<div class="line number12 index11 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">params += </code><code class="jscript string">', top=0, left=0'</code><code class="jscript plain">;</code></div>
<div class="line number13 index12 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">params += </code><code class="jscript string">', fullscreen=yes'</code><code class="jscript plain">;</code></div>
<div class="line number14 index13 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">params += </code><code class="jscript string">', resizable=yes'</code><code class="jscript plain">;</code></div>
<div class="line number15 index14 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">params += </code><code class="jscript string">', scrollbars=yes'</code><code class="jscript plain">;</code></div>
<div class="line number16 index15 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">params += </code><code class="jscript string">', location=yes'</code><code class="jscript plain">;</code></div>
<div class="line number17 index16 alt2">
</div>
<div class="line number18 index17 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">newwin=window.open(url,</code><code class="jscript string">'windowname4'</code><code class="jscript plain">, params);</code></div>
<div class="line number19 index18 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(window.focus) {</code></div>
<div class="line number20 index19 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">newwin.focus()</code></div>
<div class="line number21 index20 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number22 index21 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">return</code> <code class="jscript keyword">false</code><code class="jscript plain">;</code></div>
<div class="line number23 index22 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><span style="color: #333333;">42. Pop the lookup window associated to a Lookup field:</span></strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:3ba14a55-c014-4c17-b138-bccc96d90c1c" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_29454">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript plain">window.document.getElementById(</code><code class="jscript string">'new_existingcase'</code><code class="jscript plain">).click();</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><span style="color: #333333;">43. Pop a Web Resource (new approach):</span></strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:17c32fb6-3374-4e9e-a0fb-0963819a1c83" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_263391">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">PopWebResource() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Utility.openWebResource(</code><code class="jscript string">"new_Hello"</code><code class="jscript plain">);</code></div>
<div class="line number3 index2 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><span style="color: #333333;">44. Using a SWITCH statement</span></strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:e6086623-073f-4c26-bfcf-803ed39b81b4" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_328673">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
<div class="line number13 index12 alt2">
13</div>
<div class="line number14 index13 alt1">
14</div>
<div class="line number15 index14 alt2">
15</div>
<div class="line number16 index15 alt1">
16</div>
<div class="line number17 index16 alt2">
17</div>
<div class="line number18 index17 alt1">
18</div>
<div class="line number19 index18 alt2">
19</div>
<div class="line number20 index19 alt1">
20</div>
<div class="line number21 index20 alt2">
21</div>
<div class="line number22 index21 alt1">
22</div>
<div class="line number23 index22 alt2">
23</div>
<div class="line number24 index23 alt1">
24</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">GetFormType() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">FormType = Xrm.Page.ui.getFormType();</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(FormType != </code><code class="jscript keyword">null</code><code class="jscript plain">) {</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">switch</code> <code class="jscript plain">(FormType) {</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">case</code> <code class="jscript plain">1:</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">return</code> <code class="jscript string">"create"</code><code class="jscript plain">;</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">break</code><code class="jscript plain">;</code></div>
<div class="line number8 index7 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">case</code> <code class="jscript plain">2:</code></div>
<div class="line number9 index8 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">return</code> <code class="jscript string">"update"</code><code class="jscript plain">;</code></div>
<div class="line number10 index9 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">break</code><code class="jscript plain">;</code></div>
<div class="line number11 index10 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">case</code> <code class="jscript plain">3:</code></div>
<div class="line number12 index11 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">return</code> <code class="jscript string">"readonly"</code><code class="jscript plain">;</code></div>
<div class="line number13 index12 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">break</code><code class="jscript plain">;</code></div>
<div class="line number14 index13 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">case</code> <code class="jscript plain">4:</code></div>
<div class="line number15 index14 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">return</code> <code class="jscript string">"disabled"</code><code class="jscript plain">;</code></div>
<div class="line number16 index15 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">break</code><code class="jscript plain">;</code></div>
<div class="line number17 index16 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">case</code> <code class="jscript plain">6:</code></div>
<div class="line number18 index17 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">return</code> <code class="jscript string">"bulkedit"</code><code class="jscript plain">;</code></div>
<div class="line number19 index18 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">break</code><code class="jscript plain">;</code></div>
<div class="line number20 index19 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">default</code><code class="jscript plain">:</code></div>
<div class="line number21 index20 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">return</code> <code class="jscript keyword">null</code><code class="jscript plain">;</code></div>
<div class="line number22 index21 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number23 index22 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number24 index23 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<strong><span style="color: #333333;">45. Pop an Ok/Cancel Dialog</span></strong><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:ae3ca2d7-d351-4810-a386-10e3c5ae8950" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_9644">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
<div class="line number13 index12 alt2">
13</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">SetApproval() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(confirm(</code><code class="jscript string">"Are you sure?"</code><code class="jscript plain">)) {</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript comments">// Actions to perform when 'Ok' is selected:</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">Approval = Xrm.Page.data.entity.attributes.get(</code><code class="jscript string">"new_phaseapproval"</code><code class="jscript plain">);</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">Approval.setValue(1);</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">alert(</code><code class="jscript string">"Approval has been granted - click Ok to update CRM"</code><code class="jscript plain">);</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.data.entity.save();</code></div>
<div class="line number8 index7 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number9 index8 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">else</code> <code class="jscript plain">{</code></div>
<div class="line number10 index9 alt1">
<code class="jscript spaces"> </code><code class="jscript comments">// Actions to perform when 'Cancel' is selected:</code></div>
<div class="line number11 index10 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">alert(</code><code class="jscript string">"Action cancelled"</code><code class="jscript plain">);</code></div>
<div class="line number12 index11 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number13 index12 alt2">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<span style="color: #333333;"><strong>46. Retrieve a GUID via REST (default the Price List field)</strong></span><br />
<span style="color: #333333;">In this example (intended for the
Opportunity form’s Onload event) I execute a REST query to retrieve the
GUID of the Price List named “Wholesale Price List”. I then execute the
DefaultPriceList function to default the Price List field. As this
uses REST your CRM form will need json2 and jquery libraries registered
on the CRM form (I have these libraries in a <a href="https://www.box.com/s/948bf324d50527599495">solution file</a> I import when needed):</span><br />
<a href="http://gtcrm.files.wordpress.com/2012/07/image105.png"><img alt="image" border="0" height="208" src="http://gtcrm.files.wordpress.com/2012/07/image_thumb104.png?w=540&h=208" style="background-image: none; border: 0; display: inline; padding-left: 0; padding-right: 0; padding-top: 0;" title="image" width="540" /></a><br />
<div class="wlWriterEditableSmartContent" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:43df6140-57ac-4a9d-a710-6d442e56b022" style="display: inline; float: none; margin: 0; padding: 0;">
<div>
<div class="syntaxhighlighter jscript" id="highlighter_317778">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
<div class="line number13 index12 alt2">
13</div>
<div class="line number14 index13 alt1">
14</div>
<div class="line number15 index14 alt2">
15</div>
<div class="line number16 index15 alt1">
16</div>
<div class="line number17 index16 alt2">
17</div>
<div class="line number18 index17 alt1">
18</div>
<div class="line number19 index18 alt2">
19</div>
<div class="line number20 index19 alt1">
20</div>
<div class="line number21 index20 alt2">
21</div>
<div class="line number22 index21 alt1">
22</div>
<div class="line number23 index22 alt2">
23</div>
<div class="line number24 index23 alt1">
24</div>
<div class="line number25 index24 alt2">
25</div>
<div class="line number26 index25 alt1">
26</div>
<div class="line number27 index26 alt2">
27</div>
<div class="line number28 index27 alt1">
28</div>
<div class="line number29 index28 alt2">
29</div>
<div class="line number30 index29 alt1">
30</div>
<div class="line number31 index30 alt2">
31</div>
<div class="line number32 index31 alt1">
32</div>
<div class="line number33 index32 alt2">
33</div>
<div class="line number34 index33 alt1">
34</div>
<div class="line number35 index34 alt2">
35</div>
<div class="line number36 index35 alt1">
36</div>
<div class="line number37 index36 alt2">
37</div>
<div class="line number38 index37 alt1">
38</div>
<div class="line number39 index38 alt2">
39</div>
<div class="line number40 index39 alt1">
40</div>
<div class="line number41 index40 alt2">
41</div>
<div class="line number42 index41 alt1">
42</div>
<div class="line number43 index42 alt2">
43</div>
<div class="line number44 index43 alt1">
44</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">RetrieveGUID() {</code></div>
<div class="line number2 index1 alt1">
<code class="jscript spaces"> </code><code class="jscript comments">// Get CRM Context</code></div>
<div class="line number3 index2 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">context = Xrm.Page.context;</code></div>
<div class="line number4 index3 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">serverUrl = context.getServerUrl();</code></div>
<div class="line number5 index4 alt2">
<code class="jscript spaces"> </code><code class="jscript comments">// Cater for URL differences between on-premise and online</code></div>
<div class="line number6 index5 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">if</code> <code class="jscript plain">(serverUrl.match(/\/$/)) {</code></div>
<div class="line number7 index6 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">serverUrl = serverUrl.substring(0, serverUrl.length - 1);</code></div>
<div class="line number8 index7 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number9 index8 alt2">
<code class="jscript spaces"> </code><code class="jscript comments">// Define ODATA query</code></div>
<div class="line number10 index9 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">ODATA_ENDPOINT = </code><code class="jscript string">"/XRMServices/2011/OrganizationData.svc"</code><code class="jscript plain">;</code></div>
<div class="line number11 index10 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">ODATA_EntityCollection = </code><code class="jscript string">"/PriceLevelSet"</code><code class="jscript plain">;</code></div>
<div class="line number12 index11 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">PriceListName = </code><code class="jscript string">'Wholesale Price List'</code><code class="jscript plain">;</code></div>
<div class="line number13 index12 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">QUERY = </code><code class="jscript string">"?$select=PriceLevelId&$filter=Name%20eq%20'"</code> <code class="jscript plain">+ PriceListName + </code><code class="jscript string">"'&$top=1"</code><code class="jscript plain">;</code></div>
<div class="line number14 index13 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">URL = serverUrl + ODATA_ENDPOINT + ODATA_EntityCollection + QUERY;</code></div>
<div class="line number15 index14 alt2">
<code class="jscript spaces"> </code><code class="jscript comments">//Asynchronous AJAX call</code></div>
<div class="line number16 index15 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">$.ajax({</code></div>
<div class="line number17 index16 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">type: </code><code class="jscript string">"GET"</code><code class="jscript plain">,</code></div>
<div class="line number18 index17 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">contentType: </code><code class="jscript string">"application/json; charset=utf-8"</code><code class="jscript plain">,</code></div>
<div class="line number19 index18 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">datatype: </code><code class="jscript string">"json"</code><code class="jscript plain">,</code></div>
<div class="line number20 index19 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">url: URL,</code></div>
<div class="line number21 index20 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">beforeSend: </code><code class="jscript keyword">function</code> <code class="jscript plain">(XMLHttpRequest) {</code></div>
<div class="line number22 index21 alt1">
<code class="jscript spaces"> </code><code class="jscript comments">//Specifying this header ensures that the results will be returned as JSON.</code></div>
<div class="line number23 index22 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">XMLHttpRequest.setRequestHeader(</code><code class="jscript string">"Accept"</code><code class="jscript plain">, </code><code class="jscript string">"application/json"</code><code class="jscript plain">);</code></div>
<div class="line number24 index23 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">},</code></div>
<div class="line number25 index24 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">success: </code><code class="jscript keyword">function</code> <code class="jscript plain">(data, textStatus, XmlHttpRequest) {</code></div>
<div class="line number26 index25 alt1">
<code class="jscript spaces"> </code><code class="jscript comments">//This function will trigger asynchronously if the Retrieve was successful</code></div>
<div class="line number27 index26 alt2">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">GUID_Retrieved = data.d.results[0].PriceLevelId;</code></div>
<div class="line number28 index27 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">DefaultPriceList(GUID_Retrieved, PriceListName);</code></div>
<div class="line number29 index28 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">},</code></div>
<div class="line number30 index29 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">error: </code><code class="jscript keyword">function</code> <code class="jscript plain">(XmlHttpRequest, textStatus, errorThrown) {</code></div>
<div class="line number31 index30 alt2">
<code class="jscript spaces"> </code><code class="jscript comments">//This function will trigger asynchronously if the Retrieve returned an error</code></div>
<div class="line number32 index31 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">alert(</code><code class="jscript string">"ajax call failed"</code><code class="jscript plain">);</code></div>
<div class="line number33 index32 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">}</code></div>
<div class="line number34 index33 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">});</code></div>
<div class="line number35 index34 alt2">
<code class="jscript plain">}</code></div>
<div class="line number36 index35 alt1">
</div>
<div class="line number37 index36 alt2">
<code class="jscript keyword">function</code> <code class="jscript plain">DefaultPriceList(GUID, NAME){</code></div>
<div class="line number38 index37 alt1">
<code class="jscript spaces"> </code><code class="jscript keyword">var</code> <code class="jscript plain">lookupValue = </code><code class="jscript keyword">new</code> <code class="jscript plain">Array();</code></div>
<div class="line number39 index38 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">lookupValue[0] = </code><code class="jscript keyword">new</code> <code class="jscript plain">Object();</code></div>
<div class="line number40 index39 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">lookupValue[0].id = GUID;</code></div>
<div class="line number41 index40 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">lookupValue[0].name = NAME;</code></div>
<div class="line number42 index41 alt1">
<code class="jscript spaces"> </code><code class="jscript plain">lookupValue[0].entityType = </code><code class="jscript string">"pricelevel"</code><code class="jscript plain">;</code></div>
<div class="line number43 index42 alt2">
<code class="jscript spaces"> </code><code class="jscript plain">Xrm.Page.getAttribute(</code><code class="jscript string">"pricelevelid"</code><code class="jscript plain">).setValue(lookupValue);</code></div>
<div class="line number44 index43 alt1">
<code class="jscript plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<hr />
Here is a little more info that will help you get your head around the general design of all this…<br />
Depending upon what you want to do you will interact with one of the following:<br />
<strong>Xrm.Page.data.entity.attributes</strong> – The data fields represented by fields on the form<br />
<strong>Xrm.Page.ui.controls</strong> – The user interface controls on the form<br />
<strong>Xrm.Page.ui.navigation.items</strong> – The navigation items on the form<br />
<strong>Xrm.Utility</strong> – A container of helpful functions<br />
When referring to fields or controls you must specify the name of the
field and surround with quotes (and make sure you get the case right):<br />
<a href="http://gtcrm.files.wordpress.com/2011/03/image.png"><img alt="image" border="0" height="276" src="http://gtcrm.files.wordpress.com/2011/03/image_thumb.png?w=531&h=276" style="background-image: none; border-width: 0; display: inline; margin: 0; padding-left: 0; padding-right: 0; padding-top: 0;" title="image" width="531" /></a><br />
When referring to nav items you must specify the nav ID and surround it with quotes. To determine the nav ID:<br />
– open the CRM form in IE<br />
– hit F12 to activate IE’s developer tools (if it doesn’t appear, check for it under Task Manager and maximise it from there)<br />
– in the developer tools window click the arrow to activate the “Select element by click” mode<br />
– on the CRM form click the nav item (the dev tools window will take you to HTML definition of that element)<br />
<a href="http://gtcrm.files.wordpress.com/2011/03/image1.png"><img alt="image" border="0" height="453" src="http://gtcrm.files.wordpress.com/2011/03/image_thumb1.png?w=401&h=453" style="background-image: none; border-width: 0; display: inline; margin: 0; padding-left: 0; padding-right: 0; padding-top: 0;" title="image" width="401" /></a><br />
– just above there you will see the nav ID specified, look for <strong>id=”nav<something>”</strong><br />
<a href="http://gtcrm.files.wordpress.com/2011/03/image2.png"><img alt="image" border="0" height="61" src="http://gtcrm.files.wordpress.com/2011/03/image_thumb2.png?w=600&h=61" style="background-image: none; border-width: 0; display: inline; margin: 0; padding-left: 0; padding-right: 0; padding-top: 0;" title="image" width="600" /></a><br />
When setting properties to true/false do not surround the true/false value with quotes.<br />
Typically there are 2 steps to interacting with fields. First you
get the field as an object. Then you interact with that object to get
or set the property value you are interested in.<br />
<br />
<br />
<b>Hide/Show Field</b><br />
<br />
<div>
<div class="syntaxhighlighter js" id="highlighter_655604">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">HideShowField(fieldName, show) {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">field = Xrm.Page.ui.controls.get(fieldName);</code></div>
<div class="line number3 index2 alt2">
</div>
<div class="line number4 index3 alt1">
<code class="js spaces"> </code><code class="js keyword">if</code> <code class="js plain">(field != </code><code class="js keyword">null</code><code class="js plain">)</code></div>
<div class="line number5 index4 alt2">
<code class="js spaces"> </code><code class="js plain">field.setVisible(show);</code></div>
<div class="line number6 index5 alt1">
<code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<br />
<br />
<b>Hide/Show Field but removing white space</b><br />
<div>
<div class="syntaxhighlighter js" id="highlighter_704487">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">HideShowFieldRemoveSpace(fieldname, show) {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">displayStyle = show ? </code><code class="js string">'block'</code> <code class="js plain">: </code><code class="js string">'none'</code><code class="js plain">;</code></div>
<div class="line number3 index2 alt2">
<code class="js spaces"> </code><code class="js keyword">if</code> <code class="js plain">(document.getElementById(fieldname + </code><code class="js string">'_c'</code><code class="js plain">) != </code><code class="js keyword">null</code> <code class="js plain">&& document.getElementById(fieldname + </code><code class="js string">'_d'</code><code class="js plain">) != </code><code class="js keyword">null</code><code class="js plain">) {</code></div>
<div class="line number4 index3 alt1">
<code class="js spaces"> </code><code class="js plain">document.getElementById(fieldname + </code><code class="js string">'_c'</code><code class="js plain">).style.display = displayStyle;</code></div>
<div class="line number5 index4 alt2">
<code class="js spaces"> </code><code class="js plain">document.getElementById(fieldname + </code><code class="js string">'_d'</code><code class="js plain">).style.display = displayStyle;</code></div>
<div class="line number6 index5 alt1">
<code class="js spaces"> </code><code class="js plain">}</code></div>
<div class="line number7 index6 alt2">
<code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<br />
<br />
<b>Disable/Not Disable Field</b><br />
<div>
<div class="syntaxhighlighter js" id="highlighter_927416">
<div class="toolbar">
<span><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">SetDisableField(fieldName, disabled) {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">field = Xrm.Page.getControl(fieldName);</code></div>
<div class="line number3 index2 alt2">
</div>
<div class="line number4 index3 alt1">
<code class="js spaces"> </code><code class="js keyword">if</code> <code class="js plain">(field != </code><code class="js keyword">null</code><code class="js plain">)</code></div>
<div class="line number5 index4 alt2">
<code class="js spaces"> </code><code class="js plain">field.setDisabled(disabled);</code></div>
<div class="line number6 index5 alt1">
<code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<br />
<br />
<b>Set Requirement Level</b><br />
<div>
<div class="syntaxhighlighter js" id="highlighter_719517">
<div class="toolbar">
<span><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">SetRequirementLevel(fieldName, reqLevel) {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">field = Xrm.Page.getAttribute(fieldName);</code></div>
<div class="line number3 index2 alt2">
</div>
<div class="line number4 index3 alt1">
<code class="js spaces"> </code><code class="js keyword">if</code> <code class="js plain">(field != </code><code class="js keyword">null</code><code class="js plain">)</code></div>
<div class="line number5 index4 alt2">
<code class="js spaces"> </code><code class="js plain">field.setRequiredLevel(reqLevel);</code></div>
<div class="line number6 index5 alt1">
<code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<br />
<br />
<b>Set Required Level</b><br />
<div>
<div class="syntaxhighlighter js" id="highlighter_422912">
<div class="toolbar">
<span><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">SetRequirementLevel(fieldName, reqLevel) {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">field = Xrm.Page.getAttribute(fieldName);</code></div>
<div class="line number3 index2 alt2">
</div>
<div class="line number4 index3 alt1">
<code class="js spaces"> </code><code class="js keyword">if</code> <code class="js plain">(field != </code><code class="js keyword">null</code><code class="js plain">)</code></div>
<div class="line number5 index4 alt2">
<code class="js spaces"> </code><code class="js plain">field.setRequiredLevel(reqLevel);</code></div>
<div class="line number6 index5 alt1">
<code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<br />
<br />
<b>Validate Number Field and Character Limit</b><br />
<div>
<div class="syntaxhighlighter js" id="highlighter_749518">
<div class="toolbar">
<span><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">validateNumberField(context, limit) {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">value = context.getEventSource().getValue();</code></div>
<div class="line number3 index2 alt2">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">fieldName = context.getEventSource().getName();</code></div>
<div class="line number4 index3 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">labelName = Xrm.Page.ui.controls.get(fieldName).getLabel();</code></div>
<div class="line number5 index4 alt2">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">valueRegex = </code><code class="js keyword">new</code> <code class="js plain">RegExp(</code><code class="js string">"^\\d{"</code> <code class="js plain">+ limit + </code><code class="js string">"}$"</code><code class="js plain">);</code></div>
<div class="line number6 index5 alt1">
<code class="js spaces"> </code><code class="js keyword">if</code> <code class="js plain">(!value.match(valueRegex)) {</code></div>
<div class="line number7 index6 alt2">
<code class="js spaces"> </code><code class="js plain">event.returnValue = </code><code class="js keyword">false</code><code class="js plain">;</code></div>
<div class="line number8 index7 alt1">
<code class="js spaces"> </code><code class="js plain">alert(</code><code class="js string">"The format of the "</code> <code class="js plain">+ labelName + </code><code class="js string">" is incorrect"</code><code class="js plain">);</code></div>
<div class="line number9 index8 alt2">
<code class="js spaces"> </code><code class="js plain">}</code></div>
<div class="line number10 index9 alt1">
<code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<br />
<br />
<b>Validate Future DateTime</b><br />
<div>
<div class="syntaxhighlighter js" id="highlighter_340641">
<div class="toolbar">
<span><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">ValidateFutureDate(fieldname) {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">today = </code><code class="js keyword">new</code> <code class="js plain">Date();</code></div>
<div class="line number3 index2 alt2">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">dueDate = Xrm.Page.getAttribute(fieldname).getValue();</code></div>
<div class="line number4 index3 alt1">
</div>
<div class="line number5 index4 alt2">
<code class="js spaces"> </code><code class="js keyword">if</code> <code class="js plain">(dueDate != </code><code class="js keyword">null</code> <code class="js plain">&& dueDate < today) {</code></div>
<div class="line number6 index5 alt1">
<code class="js spaces"> </code><code class="js plain">alert(</code><code class="js string">"Date value needs to be in the future"</code><code class="js plain">);</code></div>
<div class="line number7 index6 alt2">
<code class="js spaces"> </code><code class="js plain">Xrm.Page.getAttribute(fieldname).setValue(today);</code></div>
<div class="line number8 index7 alt1">
<code class="js spaces"> </code><code class="js plain">}</code></div>
<div class="line number9 index8 alt2">
<code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<br />
<br />
<b>Example function to hide left navigation item based on a condition</b><br />
<div>
<div class="syntaxhighlighter js" id="highlighter_782885">
<div class="toolbar">
<span><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
<div class="line number12 index11 alt1">
12</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">ShowBankDetails() {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">payeeRole = </code><code class="js string">"new_rolepayee"</code><code class="js plain">;</code></div>
<div class="line number3 index2 alt2">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">payeeChkBox = Xrm.Page.ui.controls.get(payeeRole);</code></div>
<div class="line number4 index3 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">payeeChkBoxValue = payeeChkBox.getAttribute().getValue();</code></div>
<div class="line number5 index4 alt2">
</div>
<div class="line number6 index5 alt1">
<code class="js spaces"> </code><code class="js keyword">if</code> <code class="js plain">(payeeChkBoxValue == </code><code class="js keyword">true</code><code class="js plain">) {</code></div>
<div class="line number7 index6 alt2">
<code class="js spaces"> </code><code class="js plain">Xrm.Page.ui.navigation.items.get(</code><code class="js string">"nav_new_account_new_bankdetail"</code><code class="js plain">).setVisible(</code><code class="js keyword">true</code><code class="js plain">);</code></div>
<div class="line number8 index7 alt1">
<code class="js spaces"> </code><code class="js plain">}</code></div>
<div class="line number9 index8 alt2">
<code class="js spaces"> </code><code class="js keyword">else</code> <code class="js plain">{</code></div>
<div class="line number10 index9 alt1">
<code class="js spaces"> </code><code class="js plain">Xrm.Page.ui.navigation.items.get(</code><code class="js string">"nav_new_account_new_bankdetail"</code><code class="js plain">).setVisible(</code><code class="js keyword">false</code><code class="js plain">);</code></div>
<div class="line number11 index10 alt2">
<code class="js spaces"> </code><code class="js plain">}</code></div>
<div class="line number12 index11 alt1">
<code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<br />
<br />
<b>Avoiding the checkbox OnChange bug so that it fires off immediately (put this in OnLoad event of the form)</b><br />
<div>
<div class="syntaxhighlighter js" id="highlighter_81901">
<div class="toolbar">
<span><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">TriggerCheckBoxClick() {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js plain">crmForm.all.new_checkbox.onclick = </code><code class="js keyword">function</code> <code class="js plain">() { crmForm.all.new_checkbox.FireOnChange(); };</code></div>
<div class="line number3 index2 alt2">
<code class="js spaces"> </code><code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<br />
<br />
<b>Set Lookup Value</b><br />
<div>
<div class="syntaxhighlighter js" id="highlighter_427827">
<div class="toolbar">
<span><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">SetLookupValue(fieldName, id, name, entityType) {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js keyword">if</code> <code class="js plain">(fieldName != </code><code class="js keyword">null</code><code class="js plain">) {</code></div>
<div class="line number3 index2 alt2">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">lookupValue = </code><code class="js keyword">new</code> <code class="js plain">Array();</code></div>
<div class="line number4 index3 alt1">
<code class="js spaces"> </code><code class="js plain">lookupValue[0] = </code><code class="js keyword">new</code> <code class="js plain">Object();</code></div>
<div class="line number5 index4 alt2">
<code class="js spaces"> </code><code class="js plain">lookupValue[0].id = id;</code></div>
<div class="line number6 index5 alt1">
<code class="js spaces"> </code><code class="js plain">lookupValue[0].name = name;</code></div>
<div class="line number7 index6 alt2">
<code class="js spaces"> </code><code class="js plain">lookupValue[0].entityType = entityType;</code></div>
<div class="line number8 index7 alt1">
</div>
<div class="line number9 index8 alt2">
<code class="js spaces"> </code><code class="js plain">Xrm.Page.getAttribute(fieldName).setValue(lookupValue);</code></div>
<div class="line number10 index9 alt1">
<code class="js spaces"> </code><code class="js plain">}</code></div>
<div class="line number11 index10 alt2">
<code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<b>Hide Picklist Item Text</b>
<div class="toolbar">
<span><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr><td class="gutter"><div class="line number1 index0 alt2">
1</div>
<div class="line number2 index1 alt1">
2</div>
<div class="line number3 index2 alt2">
3</div>
<div class="line number4 index3 alt1">
4</div>
<div class="line number5 index4 alt2">
5</div>
<div class="line number6 index5 alt1">
6</div>
<div class="line number7 index6 alt2">
7</div>
<div class="line number8 index7 alt1">
8</div>
<div class="line number9 index8 alt2">
9</div>
<div class="line number10 index9 alt1">
10</div>
<div class="line number11 index10 alt2">
11</div>
</td><td class="code"><div class="container">
<div class="line number1 index0 alt2">
<code class="js keyword">function</code> <code class="js plain">HidePicklistItemWithText(fieldName, withText) {</code></div>
<div class="line number2 index1 alt1">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">picklist = document.getElementById(fieldName);</code></div>
<div class="line number3 index2 alt2">
</div>
<div class="line number4 index3 alt1">
<code class="js spaces"> </code><code class="js keyword">for</code> <code class="js plain">(</code><code class="js keyword">var</code> <code class="js plain">i = picklist.options.length - 1; i >= 0; i--) {</code></div>
<div class="line number5 index4 alt2">
<code class="js spaces"> </code><code class="js keyword">var</code> <code class="js plain">picklistItemText = picklist.options[i].text;</code></div>
<div class="line number6 index5 alt1">
</div>
<div class="line number7 index6 alt2">
<code class="js spaces"> </code><code class="js keyword">if</code> <code class="js plain">(picklistItemText.match(withText) == withText && picklist.selectedIndex != i) {</code></div>
<div class="line number8 index7 alt1">
<code class="js spaces"> </code><code class="js plain">picklist.options.remove(i);</code></div>
<div class="line number9 index8 alt2">
<code class="js spaces"> </code><code class="js plain">}</code></div>
<div class="line number10 index9 alt1">
<code class="js spaces"> </code><code class="js plain">}</code></div>
<div class="line number11 index10 alt2">
<code class="js plain">}</code></div>
</div>
</td></tr>
</tbody></table>
<br />
<br />Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-18244670376201349662015-02-10T10:49:00.002-08:002015-02-10T10:49:41.291-08:00Entity Relationship Diagrams in Microsoft Dynamics CRMYou can also create ERDs for custom entities. The generator is buried
deep inside of the SDK (…\sdk\samplecode\cs\metadata\diagram ). You
will need Visual Studio and Visio 2010 to run the document generator.<br />
1. First, open the above file path and open the file MetadataDiagram.csproj in Visual Studio. <br />2. Next, from the toolbar, click the Build Solution icon.<a href="http://blog.customereffective.com/.a/6a00e54fb34b6f883301675f99bd3e970b-pi"><img alt="meta1" border="0" height="261" src="http://blog.customereffective.com/.a/6a00e54fb34b6f883301675f99bd49970b-pi" style="background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="meta1" width="475" /></a> <br />3.
You could run the program now. However, it will map all of the
entities, their attributes and their relationship to each other. This
will take a very long time, but more importantly, it's complexity may
render it useless to most people. What I have found useful it to map one
entity at a time, or at the most two or three. <br />4. In order to
draw one or more specific entities, click the debug tab, then enter the
logical name in the Command line argument box. You can enter as many
entities as you would like to map here. For instance, if you would like
to map accounts, then simply enter "account". If you would like to map
an custom entity then enter "new_entityname". If you would like to map
the relationships between you custom entity and accounts, then enter
"account new_entityname". Remember, that will map your new entity,
accounts, and the relationships between them. If you want a map for
accounts and another map for your custom entity, you will need to run
the program twice. <br />5. To run the program, hit the Start Debugging button in the toolbar. <br />6.
This will bring up a command prompt. It will ask for a CRM server and a
port. It is very simply orgname.domainname.net (no https:, etc.) Then
you enter your username and password just as you would if you were
logging into CRM as a user.<a href="http://blog.customereffective.com/.a/6a00e54fb34b6f883301675f99bd54970b-pi"><img alt="CP1" border="0" height="210" src="http://blog.customereffective.com/.a/6a00e54fb34b6f88330162fea52b1c970d-pi" style="background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="CP1" width="493" /></a> <br />7.
The program will run (usually a few minutes) and create a Visio
document in the path: (..sdk\samplecode\cs\metadata\diagram\bin\Debug ).
The name of the file will be simply "account.vsd". It is important to
note that if you use the program to create another account diagram, and
there is already a file called "account.vsd" in the Debug file, the
command prompt will issue an error and the document will not be created.
It is a good best practice to move your finished files from the Debug
folder as you finish them. <br /> <br /> <br />A sample of the output is below. This is for the entity 'sharepointsite' in ootb CRM.<br />
<a href="http://blog.customereffective.com/.a/6a00e54fb34b6f88330168e49afcd2970c-pi"><img alt="sp1" border="0" height="349" src="http://blog.customereffective.com/.a/6a00e54fb34b6f88330168e49afcdc970c-pi" style="background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="sp1" width="406" /></a>Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-86564655499708883852014-10-29T19:42:00.002-07:002014-10-29T19:42:22.911-07:00Export / Import Lab Virtual Machines<ol>
<li><strong>De-provision the lab.</strong> Use the <a href="http://msdn.microsoft.com/en-us/library/windowsazure/jj152831.aspx" target="_blank">Stop-AzureVM</a> and <a href="http://msdn.microsoft.com/en-us/library/windowsazure/jj152899.aspx" target="_blank">Export-AzureVM</a> cmdlets in the PowerShell snippet below to shutdown and export lab VMs when they are not being used. <br /> <br /><span style="font-family: Courier New;"><strong><span style="color: green;"># Specify the Name of the VM to Export</span> <br /> <br />$myVM = "XXXlabad01" <br /> <br /><span style="color: green;"># Stop the VM prior to exporting it</span> <br /> <br />Stop-AzureVM -ServiceName $myVM -Name $myVM </strong></span><span style="font-family: Courier New;"><strong><span style="color: green;"> <br /># Set the Export folder path for the VM configuration file. Make sure this folder exists!</span> <br /> <br />$ExportPath = "C:\ExportVMs\ExportAzureVM-$myVM.xml" <br /> <br /><span style="color: green;"># Export the VM to a file</span> <br /> <br />Export-AzureVM -ServiceName $myVM -name $myVM -Path $ExportPath <br /> <br /><span style="color: green;"># After you've confirmed that the Export file exists, delete the VM</span> <br /> <br />Remove-AzureVM -ServiceName $myVM -name $myVM</strong></span> <br /> </li>
<li><strong>Re-provision the lab</strong>. Use the <a href="http://msdn.microsoft.com/en-us/library/windowsazure/jj152820.aspx" target="_blank">Import-AzureVM</a> and <a href="http://msdn.microsoft.com/en-us/library/windowsazure/jj152821.aspx" target="_blank">Start-AzureVM</a> cmdlets in the PowerShell snippet below to import and start lab VMs when needed again. <br /> <br /><span style="font-family: Courier New;"><strong><span style="color: green;"># Specify the Name of the VM to Import</span> <br /><br />$myVM = “XXXlabad01" <br /><br /><span style="color: green;"># Specify the Name of the Virtual Network on which to Import the VM</span><br /><br />$myVNet = "XXXlabnet01"<br /><br /><span style="color: green;"># Specify the Import Path of the VM’s exported configuration file.</span> <br /> <br />$ImportPath = "C:\ExportVMs\ExportAzureVM-$myVM.xml"<br /><br /><span style="color: green;"># Specify the Windows Azure Storage Account to be used.</span> <br /><br />$myStorageAccount = "XXXlabstor01"<br /><br />Get-AzureSubscription | Set-AzureSubscription -CurrentStorageAccount $myStorageAccount <br /> <br /><span style="color: green;"># Import the VM to Windows Azure</span> <br /> <br />Import-AzureVM -Path $ImportPath | New-AzureVM -ServiceName $myVM -VNetName $myVNet <br /> <br /><span style="color: green;"># Start the VM </span> <br />Start-AzureVM -ServiceName $myVM -name $myVM</strong></span></li>
</ol>
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-18068695595094484222014-10-21T19:11:00.001-07:002014-10-21T19:13:33.737-07:00Build SharePoint 2013 in the Cloud with Windows Azure<b> </b><br />
<h2>
Prerequisites</h2>
<b></b><br />
<ol>
<li><b>Login to the Windows Azure Management Portal.</b> <br /> <br />Login to the web-based <a href="http://manage.windowsazure.com/" target="_blank" title="Launch the Windows Azure Management Portal">Windows Azure Management Portal</a>
with the same logon credentials you used to sign-up for the FREE 90-day
Trial above. Once you’ve logged in, you should see the main Windows
Azure Management portal dashboard. <br /> <br /><a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/8512.Portal01_5F00_0936CFA3.png"><img alt="Portal01" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/4478.Portal01_5F00_thumb_5F00_1FF8A7DD.png" height="202" style="background-image: none; display: inline;" title="Portal01" width="244" /></a> <br /><i>Windows Azure Management Portal dashboard</i> <br /> <br />On the Windows Azure Management Portal, you’ll find the options ( highlighted in the image above ) for managing <i>Virtual Machines, Virtual Networks </i>and<i> Storage</i> in the cloud. These are the items we’ll be primarily working with in this article series. <br /> </li>
<li><b>Define a new Windows Azure Affinity Group.</b> <br /> <br /><i>Affinity Groups</i>
in Windows Azure are used to group your cloud-based services together,
such as Virtual Machines, Virtual Networks and Storage, in order to
achieve optimal performance. When you use an affinity group, Windows
Azure will keep all services that belong to your affinity group running
within the same data center as close as possible to each other to reduce
latency and increase performance. <br /> <br /> - Create a new Affinity Group by selecting <b>Settings </b>from the side navigation bar in the Windows Azure Management Portal. <br /> <br /> - On the Settings page, select the <b>Affinity Groups</b> tab on the top navigation bar. <br /> <br /> - Click the <b>+ADD</b> button on the bottom navigation bar.<br /> </li>
<li>On the <b>Create Affinity Group </b>form, enter the following details: <br /> <br /> - <b>Name:</b> Enter a unique name for your new Affinity Group, such as <b>XXXlab01 </b>(where <b>XXX</b> is replaced with your initials) <br /> <br />- <b>Region:</b>
Select the closest Windows Azure data center region to your locale.
This is the data center region in which your services will be
provisioned.<br /> </li>
<li><b>Create a new Windows Azure Storage Account.</b> <br /> <br />Virtual Machines that are provisioned in Windows Azure are stored in the world-wide cloud-based <i>Windows Azure Storage</i>
service. In terms of high availability, the Storage service provides
built-in storage replication capability – where every VM is replicated
to three separate locations within the Windows Azure data center region
you select. In addition, Windows Azure Storage provides a
geo-replication feature for also replicating your VMs to a remote data
center region. <br /> <br />Create a new Storage account by clicking the <b>+NEW</b> button on the bottom toolbar in the Windows Azure Management Portal and then select <b>Data Services | Storage | Quick Create</b>. <br /> <br /><a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/0601.Portal03_5F00_43B46028.png"><img alt="Portal03" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/2335.Portal03_5F00_thumb_5F00_05BACF6A.png" height="109" style="background-image: none; display: inline;" title="Portal03" width="244" /></a> <br /><i>Creating a new Storage account in Windows Azure</i> <br /> <br />Complete the following fields for creating your Storage account: <br /> <br /> - <b>URL:</b> Enter a unique name for your new storage account, such as <b>XXXlabstor01</b> (where <b>XXX</b> is replaced with your initials) <br /> <br /> - <b>Region/Affinity Group:</b> Select the Affinity Group you created in Step 3 above. <br /> <br /> - <b>Enable Geo-Replication: </b>By default, this option is selected. Leave the default option in place. <br /> <br />Click the <b>CREATE STORAGE ACCOUNT</b> button to create your new Windows Azure Storage account. <br /> </li>
<li><b>Download, Install and Configure the Windows Azure PowerShell Management Tools</b> <br /> <br />In addition to managing Windows Azure via the web-based Management Portal, we also provide a <i>Windows Azure PowerShell module</i>
for scripted management of Windows Azure services. We’ll be using both
the Management Portal and PowerShell in this series, so you’ll want to
download, install and configure the Windows Azure PowerShell cmdlets to
get prepared. <br /> <br /> - <a href="http://go.microsoft.com/?linkid=9811175&clcid=0x409">Download and Install</a> the Windows Azure PowerShell cmdlets. Note that a restart may be required after installing this module.<br /><br />- Right-click on <b>Windows PowerShell </b>in your Start Menu or Start Screen and choose <b>Run As Administrator</b>.<br /><br />- Set the PowerShell Execution Policy for scripts by running the following command at the PowerShell command prompt:<br /><br /> <span style="font-family: courier new,courier;">PS C:\> </span><b><span style="font-family: courier new,courier;">Set-ExecutionPolicy RemoteSigned</span><br /><br />- </b>Import
the Windows Azure PowerShell module and supporting cmdlets by running
the following command at the PowerShell command prompt:<br /><br /> <span style="font-family: courier new,courier;">PS C:\> <b>Import-Module Azure</b></span><br /><br />- Download and save your Windows Azure Publish Settings file by running the following command at the PowerShell command prompt:<br /><br /> <span style="font-family: courier new,courier;">PS C:\> <b>Get-AzurePublishSettingsFile</b></span><br /><br />- Import the saved Windows Azure Publish Settings file by running the following command at the PowerShell command prompt:<br /><br /> <span style="font-family: courier new,courier;">PS C:\> <b>Import-AzurePublishSettingsFile<br /> "full_path_to_saved_file.publishsettings"</b></span></li>
</ol>
<br />
<h2>
Exercise 1: Register a DNS Server in Windows Azure</h2>
<span style="font-family: courier new,courier;"><b> </b></span>Register the internal IP address that our domain controller VM will
be using for Active Directory-integrated Dynamic DNS services by
performing the following steps:
<br />
<ol>
<li>Sign in at the <a href="http://manage.windowsazure.com/" target="_blank">Windows Azure Management Portal</a> with the logon credentials used when you signed up for your <a href="http://aka.ms/AzureVMFreeTrial" target="_blank">Free Windows Azure Trial</a>. <br /> </li>
<li>Select <b>Networks </b>located on the side navigation panel on the Windows Azure Management Portal page. <br /> </li>
<li>Click the <b>+NEW </b>button located on the bottom navigation bar and select <b>Networks | Virtual Network | Register DNS Server</b>. <br /> </li>
<li>Complete the DNS Server fields as follows: <br /> <br /> - <b>NAME: </b>XXXlabdns01 <br /> - <b>DNS Server IP Address: </b>10.0.0.4 <br /> </li>
<li>Click the <b>REGISTER DNS SERVER</b> button.</li>
</ol>
<br />
<h2>
Exercise 2: Define a Virtual Network in Windows Azure</h2>
Define a common virtual network in Windows Azure for running Active
Directory, Database and SharePoint virtual machines by performing the
following steps:<br />
<ol>
<li>Sign in at the <a href="http://manage.windowsazure.com/" target="_blank">Windows Azure Management Portal</a> with the logon credentials used when you signed up for your <a href="http://aka.ms/AzureVMFreeTrial" target="_blank">Free Windows Azure Trial</a>. <br /> </li>
<li>Select <b>Networks </b>located on the side navigation panel on the Windows Azure Management Portal page. <br /> </li>
<li>Click the <b>+NEW </b>button located on the bottom navigation bar and select <b>Networks | Virtual Network | Quick Create</b>. <br /> </li>
<li>Complete the Virtual Network fields as follows: <br /> <br /> - <b>NAME: </b>XXXlabnet01 <br /> - <b>Address Space: </b>10.---.---.--- <br /> - <b>Maximum VM Count: </b>4096 [CIDR: /20] <br /> - <b>Affinity Group: </b>Select the Affinity Group defined in the <a href="http://blogs.technet.com/b/keithmayer/archive/2013/01/05/31-days-of-servers-in-the-cloud-getting-started.aspx" target="_blank">Getting Started</a> steps from the <b>Prerequisites</b> section above. <br /> - <b>Connect to Existing DNS: </b>Select <b>XXXlabdns01</b> – the DNS Server registered in <b>Exercise 1</b> above. <br /> </li>
<li>Click the <b>CREATE A VIRTUAL NETWORK </b>button.</li>
</ol>
<br />
<h2>
Exercise 3: Configure Windows Server Active Directory in a Windows Azure VM</h2>
<br />
Provision a new Windows Azure VM to run a Windows Server Active
Directory domain controller in a new Active Directory forest by
performing the following steps:<br />
<ol>
<li>Sign in at the <a href="http://manage.windowsazure.com/" target="_blank">Windows Azure Management Portal</a> with the logon credentials used when you signed up for your <a href="http://aka.ms/AzureVMFreeTrial" target="_blank">Free Windows Azure Trial</a>. <br /> </li>
<li>Select <b>Virtual Machines </b>located on the side navigation panel on the Windows Azure Management Portal page. <br /> </li>
<li>Click the <b>+NEW </b>button located on the bottom navigation bar and select <b>Compute | Virtual Machines | From Gallery</b>. <br /> </li>
<li>In the <i>Virtual Machine Operating System Selection </i>list, select <b>Windows Server 2012 Datacenter </b>and click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/6433.image_5F00_4BDA3F57.png"><img alt="Next" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/3806.image_5F00_thumb_5F00_19766BD8.png" height="14" style="background-image: none; border: 0px currentcolor; display: inline;" title="Next" width="16" /></a> button. <br /> </li>
<li>On the <i>Virtual Machine Configuration </i>page, complete the fields as follows: <br /> <br /> - <b>Version Release Date:</b> Select the latest version release date to build a new VM with the latest OS updates applied.<br />- <b>Virtual Machine Name:</b> XXXlabad01<br />- <b>New User Name:</b> Choose a secure local Administrator user account to provision.<br /> - <b>New Password</b> and <b>Confirm Password</b> fields: Choose and confirm a new local Administrator password. <br /> - <b>Size: </b>Small (1 core, 1.75GB Memory) <br /> <br />Click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/2804.image_5F00_392545A0.png"><img alt="Next" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/3005.image_5F00_thumb_5F00_34AEC4D9.png" height="14" style="background-image: none; border: 0px currentcolor; display: inline;" title="Next" width="16" /></a> button to continue. <br /> <br /><b>Note:</b>
It is suggested to use secure passwords for Administrator users and
service accounts, as Windows Azure virtual machines could be accessible
from the Internet knowing just their DNS. You can also read this
document on the Microsoft Security website that will help you select a
secure password: <a href="http://www.microsoft.com/security/online-privacy/passwords-create.aspx">http://www.microsoft.com/security/online-privacy/passwords-create.aspx</a>. <br /> </li>
<li>On the <i>Virtual Machine Mode </i>page, complete the fields as follows: <br /> <br /> - <b>Standalone Virtual Machine: </b>Selected <br /> - <b>DNS Name: </b>XXXlabad01.cloudapp.net <br /> - <b>Storage Account:</b> Select the Storage Account defined in the <a href="http://blogs.technet.com/b/keithmayer/archive/2013/01/05/31-days-of-servers-in-the-cloud-getting-started.aspx" target="_blank">Getting Started</a> steps from the <b>Prerequisites</b> section above. <br /> - <b>Region/Affinity Group/Virtual Network: </b>Select <b>XXXlabnet01</b> – the Virtual Network defined in <b>Exercise 2</b> above. <br /> - <b>Virtual Network Subnets: </b>Select <b>Subnet-1</b> (10.0.0.0/23) <br /> <br />Click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/6433.image_5F00_024AF15A.png"><img alt="Next" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/3806.image_5F00_thumb_5F00_21F9CB22.png" height="14" style="background-image: none; border: 0px currentcolor; display: inline;" title="Next" width="16" /></a> button to continue. <br /> </li>
<li>On the <i>Virtual Machine Options </i>page, click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/7522.image_5F00_4B709D13.png"><img alt="Checkmark" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/2620.image_5F00_thumb_5F00_6B1F76DB.png" height="17" style="background-image: none; border: 0px currentcolor; display: inline;" title="Checkmark" width="16" /></a> button to begin provisioning the new virtual machine. <br /> <br />As the new virtual machine is being provisioned, you will see the <i>Status</i> column on the <i>Virtual Machines </i>page of the Windows Azure Management Portal cycle through several values including <i>Stopped, Stopped (Provisioning), </i>and <i>Running (Provisioning)</i>. When provisioning for this new Virtual Machine is completed, the <i>Status</i> column will display a value of <i>Running</i> and you may continue with the next step in this guide. <br /> </li>
<li>After the new virtual machine has finished provisioning, click on the name ( <b>XXXlabad01 ) </b>of the new Virtual Machine displayed on the <i>Virtual Machines</i> page of the Windows Azure Management Portal. <br /> </li>
<li>On the virtual machine <i>Dashboard</i> page for <i>XXXlabad01</i>, make note of the <i>Internal IP Address</i> displayed on this page located on the right-side of the page. This IP address should be listed as <b>10.0.0.4</b>. <br /> <br />If
a different internal IP address is displayed, the virtual network
and/or virtual machine configuration was not completed correctly. In
this case, click the <b>DELETE</b> button located on the bottom toolbar of the virtual machine details page for <i>XXXlabad01, </i>and go back to Exercise 2 and Exercise 3 to confirm that all steps were completed correctly. <br /> </li>
<li>On the virtual machine <i>Dashboard</i> page for <i>XXXlabad01</i>, click the <b>Attach</b> button located on the bottom navigation toolbar and select <b>Attach Empty Disk</b>. Complete the following fields on the <i>Attach an empty disk to the virtual machine</i> form: <br /> <br /> - <b>Name: </b>XXXlabad01-data01 <br /> - <b>Size: </b>10 GB <br /> - <b>Host Cache Preference:</b> None <br /> <br />Click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/6445.image_5F00_468DE957.png"><img alt="Checkmark" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/3480.image_5F00_thumb_5F00_142A15D8.png" height="17" style="background-image: none; border: 0px currentcolor; display: inline;" title="Checkmark" width="16" /></a> button to create and attach the a new virtual hard disk to virtual machine <i>XXXlabad01</i>. <br /> </li>
<li>On the virtual machine <i>Dashboard</i> page for <i>XXXlabad01</i>, click the <b>Connect </b>button located on the bottom navigation toolbar and click the <b>Open</b>
button to launch a Remote Desktop Connection to the console of this
virtual machine. Logon at the console of your virtual machine with the
local Administrator credentials defined in <b>Step 5</b> above. <br /> </li>
<li>From the Remote Desktop console of <i>XXXlabad01</i>, create a new partition on the additional data disk attached above in <b>Step 10</b> and format this partition as a new <b>F: </b>NTFS<b> </b>volume. This volume will be used for NTDS DIT database, log and SYSVOL folder locations. <br /> <br />If you need additional guidance to complete this step, feel free to leverage the following study guide for assistance: <a href="http://aka.ms/EEStorage" target="_blank">Windows Server 2012 “Early Experts” Challenge – Configure Local Storage</a> <br /> </li>
<li>Using the <b>Server Manager </b>tool, install Active
Directory Domain Services and promote this server to a domain controller
in a new forest with the following parameters: <br /> <br /> - <b>Active Directory Forest name: </b>contoso.com <br /> - <b>Volume Location for NTDS database, log and SYSVOL folders: </b>F: <br /> <br />If you need additional guidance to complete this step, feel free to leverage the following study guide for assistance: <a href="http://aka.ms/EEAD" target="_blank">Windows Server 2012 “Early Experts” Challenge – Install and Administer Active Directory</a><br /> </li>
<li>After Active Directory has been installed, create the following user
accounts that will be used when installing and configuring SharePoint
Server 2013 later in this step-by-step guide: <br /> <br /> - <b>CONTOSO\sp_farm</b> – SharePoint Farm Data Access Account <br /> -<b> CONTOSO\sp_serviceapps</b> – SharePoint Farm Service Applications Account <br /> <br />If you need additional guidance to complete this step, feel free to leverage the following study guide for assistance: <a href="http://aka.ms/EEAD" target="_blank">Windows Server 2012 “Early Experts” Challenge – Install and Administer Active Directory</a></li>
</ol>
The configuration for this virtual machine is now complete, and you
may continue with the next exercise in this step-by-step guide.<br />
<h2>
Exercise 4: Configure SQL Server 2012 in a Windows Azure VM</h2>
<br />
Provision a new Windows Azure VM to run SQL Server 2012 by performing the following steps:<br />
<ol>
<li>Sign in at the <a href="http://manage.windowsazure.com/" target="_blank">Windows Azure Management Portal</a> with the logon credentials used when you signed up for your <a href="http://aka.ms/AzureVMFreeTrial" target="_blank">Free Windows Azure Trial</a>. <br /> </li>
<li>Select <b>Virtual Machines </b>located on the side navigation panel on the Windows Azure Management Portal page. <br /> </li>
<li>Click the <b>+NEW </b>button located on the bottom navigation bar and select <b>Compute | Virtual Machines | From Gallery</b>. <br /> </li>
<li>In the <i>Virtual Machine Operating System Selection </i>list, select <b>SQL Server 2012 SP1 Enterprise </b>and click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/5140.image_5F00_6F988853.png"><img alt="Next" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/7028.image_5F00_thumb_5F00_3D34B4D4.png" height="14" style="background-image: none; border: 0px currentColor; display: inline;" title="Next" width="16" /></a> button. <br /> </li>
<li>On the <i>Virtual Machine Configuration </i>page, complete the fields as follows:<br /> <br />- <b>Virtual Machine Name:</b> XXXlabdb01<br />- <b>New User Name:</b> Choose a secure local Administrator user account to provision.<br /> - <b>New Password</b> and <b>Confirm Password</b> fields: Choose and confirm a new local Administrator password. <br /> - <b>Size: </b>Medium (2 cores, 3.5GB Memory) <br /> <br />Click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/3302.image_5F00_5CE38E9C.png"><img alt="Next" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/3480.image_5F00_thumb_5F00_586D0DD5.png" height="14" style="background-image: none; border: 0px currentColor; display: inline;" title="Next" width="16" /></a> button to continue. <br /> </li>
<li>On the <i>Virtual Machine Mode </i>page, complete the fields as follows: <br /> <br /> - <b>Standalone Virtual Machine: </b>Selected <br /> - <b>DNS Name: </b>XXXlabdb01.cloudapp.net <br /> - <b>Storage Account:</b> Select the Storage Account defined in the <a href="http://blogs.technet.com/b/keithmayer/archive/2013/01/05/31-days-of-servers-in-the-cloud-getting-started.aspx" target="_blank">Getting Started</a> steps from the <b>Prerequisites</b> section above. <br /> - <b>Region/Affinity Group/Virtual Network: </b>Select <b>XXXlabnet01</b> – the Virtual Network defined in <b>Exercise 2</b> above. <br /> - <b>Virtual Network Subnets: </b>Select <b>Subnet-1</b> (10.0.0.0/23) <br /> <br />Click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/5140.image_5F00_26093A56.png"><img alt="Next" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/1643.image_5F00_thumb_5F00_45B8141E.png" height="14" style="background-image: none; border: 0px currentColor; display: inline;" title="Next" width="16" /></a> button to continue. <br /> </li>
<li>On the <i>Virtual Machine Options </i>page, click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/3302.image_5F00_41419357.png"><img alt="Checkmark" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/3312.image_5F00_thumb_5F00_79EC3D64.png" height="17" style="background-image: none; border: 0px currentColor; display: inline;" title="Checkmark" width="16" /></a> button to begin provisioning the new virtual machine. <br /> <br />As the new virtual machine is being provisioned, you will see the <i>Status</i> column on the <i>Virtual Machines </i>page of the Windows Azure Management Portal cycle through several values including <i>Stopped, Stopped (Provisioning), </i>and <i>Running (Provisioning)</i>. When provisioning for this new Virtual Machine is completed, the <i>Status</i> column will display a value of <i>Running</i> and you may continue with the next step in this guide. <br /> </li>
<li>After the new virtual machine has finished provisioning, click on the name ( <b>XXXlabdb01 ) </b>of the new Virtual Machine displayed on the <i>Virtual Machines</i> page of the Windows Azure Management Portal. <br /> </li>
<li>On the virtual machine <i>Dashboard </i>page for <i>XXXlabdb01</i>, make note of the <i>Internal IP Address</i> displayed on this page. This IP address should be listed as <b>10.0.0.5</b>. <br /> <br />If
a different internal IP address is displayed, the virtual network
and/or virtual machine configuration was not completed correctly. In
this case, click the <b>DELETE</b> button located on the bottom toolbar of the virtual machine details page for <i>XXXlabdb01, </i>and go back to Exercise 2 and Exercise 3 to confirm that all steps were completed correctly. <br /> </li>
<li>On the virtual machine <i>Dashboard</i> page for <i>XXXlabdb01</i>, click the <b>Attach</b> button located on the bottom navigation toolbar and select <b>Attach Empty Disk</b>. Complete the following fields on the <i>Attach an empty disk to the virtual machine</i> form: <br /> <br /> - <b>Name: </b>XXXlabdb01-data01 <br /> - <b>Size: </b>50 GB <br /> - <b>Host Cache Preference:</b> None <br /> <br />Click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/4382.image_5F00_03480299.png"><img alt="Checkmark" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/8512.image_5F00_thumb_5F00_22F6DC61.png" height="17" style="background-image: none; border: 0px currentColor; display: inline;" title="Checkmark" width="16" /></a> button to create and attach the a new virtual hard disk to virtual machine <i>XXXlabdb01</i>. <br /> </li>
<li>On the virtual machine <i>Dashboard</i> page for <i>XXXlabdb01</i>, click the <b>Connect </b>button located on the bottom navigation toolbar and click the <b>Open</b>
button to launch a Remote Desktop Connection to the console of this
virtual machine. Logon at the console of your virtual machine with the
local Administrator credentials defined in <b>Step 5</b> above. <br /> </li>
<li>From the Remote Desktop console of <i>XXXlabdb01</i>, create a new partition on the additional data disk attached above in <b>Step 10</b> and format this partition as a new <b>F: </b>NTFS<b> </b>volume. After formatting this new volume, create the following folders:<br /> </li>
<ol>
<li>Create F:\MSSQL folder<br /> </li>
<li>Create F:\MSSQL\DATA folder<br /> </li>
<li>Create F:\MSSQL\LOGS folder<br /> </li>
<li>Create F:\MSSQL\BACKUP folder</li>
</ol>
<li>
Open <i>SQL Server Management Studio</i> from <b>Start | All Programs | Microsoft SQL Server 2012 | SQL Server Management Studio </b>and update default folder locations to the F: volume.<br />
</li>
<ol>
<li>Connect to the SQL Server 2012 default instance using your Windows Account. <br /> </li>
<li>Now, you will update the database's default locations for DATA, LOGS
and BACKUP folders. To do this, right click on your SQL Server instance
and select <b>Properties</b>. <br /> </li>
<li>Select <b>Database Settings</b> from the left side pane. <br /> </li>
<li>Locate the <b>Database default locations</b> section and update the default values for each path to point to the new folder paths defined above in <b>Step 12</b>. <br /> </li>
<li>Close <b>SQL Server Management Studio</b>.</li>
</ol>
<li>
In order to allow SharePoint to connect to the SQL Server, you will need to add an <b>Inbound Rule</b> for the SQL Server requests in the <b>Windows Firewall</b>. To do this, open <b>Windows Firewall with Advanced Security</b> from <b>Start | All Programs | Administrative Tools</b>.<br />
</li>
<ol>
<li>
Select <b>Inbound Rules</b> node, right-click it and select <b>New Rule</b> to open the <b>New Inbound Rule Wizard</b>.<br />
</li>
<li>
In the <b>Rule Type</b> page, select <b>Port</b> and click <b>Next</b>.<br />
</li>
<li>
In <b>Protocols and Ports</b> page, leave TCP selected, select <b>Specific local ports,</b> and set its value to <i>1433</i>. Click <b>Next</b> to continue.<br />
</li>
<li>
In the <b>Action</b> page, make sure that <b>Allow the connection</b> is selected and click <b>Next</b>.<br />
</li>
<li>
In the <b>Profile</b> page, leave the default values and click <b>Next</b>.<br />
</li>
<li>
In the <b>Name</b> page, set the Inbound Rule's <b>Name</b> to <i>SQLServerRule</i> and click <b>Finish</b><br />
</li>
<li>
Close <b>Windows Firewall with Advanced Security</b> window.<br />
</li>
</ol>
<li>Using the <b>Server Manager </b>tool, join this server to the <b>contoso.com</b> domain and restart the server to complete the domain join operation.</li>
<li>
After the server restarts, connect again via Remote Desktop to the
server’s console and login with the local Administrator credentials
defined above in <b>Step 5</b>.<br />
</li>
<li>
Open <i>SQL Server Management Studio</i> from <b>Start | All Programs | Microsoft SQL Server 2012 | SQL Server Management Studio </b>and add the <b>CONTOSO\Administrator</b> user to SQL Server with the Sysadmin server role selected.<br />
</li>
<ol>
<li>
Expand <b>Security</b> folder within the SQL Server instance. Right-click <b>Logins</b> folder and select <b>New Login</b>.<br />
</li>
<li>
In the <b>General</b> section, set the <b>Login name</b> to <b>CONTOSO\Administrator</b>, and select the <b>Windows Authentication</b> option.<br />
</li>
<li>
Click <b>Server Roles </b>on the left pane. Select the checkbox for the <b>Sysadmin</b> server role.<br />
</li>
<li>
Click the <b>OK </b>button and close <b>SQL Server Management Studio</b>.<br />
</li>
</ol>
</ol>
The configuration for this virtual machine is now complete, and you
may continue with the next exercise in this step-by-step guide.<br />
<br />
<br />
<h2>
Exercise 5: Configure SharePoint Server 2013 in a Windows Azure VM</h2>
<br />
Provision a new Windows Azure VM to run SharePoint Server 2013 by performing the following steps:<br />
<ol>
<li>Sign in at the <a href="http://manage.windowsazure.com/" target="_blank">Windows Azure Management Portal</a> with the logon credentials used when you signed up for your <a href="http://aka.ms/AzureVMFreeTrial" target="_blank">Free Windows Azure Trial</a>. <br /> </li>
<li>Select <b>Virtual Machines </b>located on the side navigation panel on the Windows Azure Management Portal page. <br /> </li>
<li>Click the <b>+NEW </b>button located on the bottom navigation bar and select <b>Compute | Virtual Machines | From Gallery</b>. <br /> </li>
<li>In the <i>Virtual Machine Operating System Selection </i>list, select <b>SharePoint Server 2013 Trial </b>and click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/7610.image_5F00_5077FC24.png"><img alt="Next" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/5140.image_5F00_thumb_5F00_4C017B5D.png" height="14" style="background-image: none; border: 0px currentColor; display: inline;" title="Next" width="16" /></a> button. <br /> </li>
<li>On the <i>Virtual Machine Configuration </i>page, complete the fields as follows:<br /><br /> - <b>Virtual Machine Name:</b> XXXlabapp01<br />- <b>New User Name:</b> Choose a secure local Administrator user account to provision.<br /> - <b>New Password</b> and <b>Confirm Password</b> fields: Choose and confirm a new local Administrator password. <br /> - <b>Size: </b>Large (4 cores, 7GB Memory) <br /> <br />Click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/4314.image_5F00_32997823.png"><img alt="Next" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/3302.image_5F00_thumb_5F00_6493A95E.png" height="14" style="background-image: none; border: 0px currentColor; display: inline;" title="Next" width="16" /></a> button to continue. <br /> </li>
<li>On the <i>Virtual Machine Mode </i>page, complete the fields as follows: <br /> <br /> - <b>Standalone Virtual Machine: </b>Selected <br /> - <b>DNS Name: </b>XXXlabapp01.cloudapp.net <br /> - <b>Storage Account:</b> Select the Storage Account defined in the <a href="http://blogs.technet.com/b/keithmayer/archive/2013/01/05/31-days-of-servers-in-the-cloud-getting-started.aspx" target="_blank">Getting Started</a> steps from the <b>Prerequisites</b> section above. <br /> - <b>Region/Affinity Group/Virtual Network: </b>Select <b>XXXlabnet01</b> – the Virtual Network defined in <b>Exercise 2</b> above. <br /> - <b>Virtual Network Subnets: </b>Select <b>Subnet-1</b> (10.0.0.0/23) <br /> <br />Click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/6052.image_5F00_04428327.png"><img alt="Next" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/2335.image_5F00_thumb_5F00_51DEAFA7.png" height="14" style="background-image: none; border: 0px currentColor; display: inline;" title="Next" width="16" /></a> button to continue. <br /> </li>
<li>On the <i>Virtual Machine Options </i>page, click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/4314.image_5F00_718D896F.png"><img alt="Checkmark" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/7534.image_5F00_thumb_5F00_3F29B5F0.png" height="17" style="background-image: none; border: 0px currentColor; display: inline;" title="Checkmark" width="16" /></a> button to begin provisioning the new virtual machine. <br /> <br />As the new virtual machine is being provisioned, you will see the <i>Status</i> column on the <i>Virtual Machines </i>page of the Windows Azure Management Portal cycle through several values including <i>Stopped, Stopped (Provisioning), </i>and <i>Running (Provisioning)</i>. When provisioning for this new Virtual Machine is completed, the <i>Status</i> column will display a value of <i>Running</i> and you may continue with the next step in this guide. <br /> </li>
<li>After the new virtual machine has finished provisioning, click on the name ( <b>XXXlabapp01 ) </b>of the new Virtual Machine displayed on the <i>Virtual Machines</i> page of the Windows Azure Management Portal. <br /> </li>
<li>On the virtual machine <i>Dashboard</i> page for <i>XXXlabapp01</i>, make note of the <i>Internal IP Address</i> displayed on this page. This IP address should be listed as <b>10.0.0.6</b>. <br /> <br />If
a different internal IP address is displayed, the virtual network
and/or virtual machine configuration was not completed correctly. In
this case, click the <b>DELETE</b> button located on the bottom toolbar of the virtual machine details page for <i>XXXlabapp01, </i>and go back to Exercise 2, Exercise 3 and Exercise 4 to confirm that all steps were completed correctly.<br /> </li>
<li>On the virtual machine <i>Dashboard</i> page for <i>XXXlabapp01</i>, click the <b>Connect </b>button located on the bottom navigation toolbar and click the <b>Open</b>
button to launch a Remote Desktop Connection to the console of this
virtual machine. Logon at the console of your virtual machine with the
local Administrator credentials defined in <b>Step 5</b> above.<br /> </li>
<li>In the <b>Server Manager </b>tool, click on <b>Local Server </b>in the left navigation pane and click on the <b>Workgroup </b>option. Join this server to the <b>contoso.com</b> domain and restart the server to complete the domain join operation. <br /> </li>
<li>After the server restarts, re-establish a Remote Desktop connection to the server and logon with the <b>CONTOSO\Administrator</b> domain user credentials defined earlier in <b>Exercise 3</b>.</li>
<li>
In the <b>Server Manager</b> tool, click on <b>Local Server</b> in the left navigation pane and select <b>IE Enhanced Security Configuration. </b>Turn <b>off</b> enhanced security for <b>Administrators </b>and click the <b>OK</b> button. <br /> <br /><b>Note:</b> Modifying <b>Internet Explorer Enhanced Security</b>
configurations is not good practice for production environments and is
only for the purpose of this particular step-by-step lab guide.<br />
</li>
<li>
On the <b>Desktop</b>, double-click on the <b>SharePoint 2013 Products Configuration Wizard</b> shortcut to launch the configuration wizard. Click the <b>Next</b> button to continue. If prompted to start or reset services, click the <b>Yes</b> button.<br />
</li>
<li>In the SharePoint Products Configuration Wizard, when prompted on the <i>Connect to server farm </i>dialog, select the option to <b>Create a new server farm</b>. <br /> </li>
<li>On the <i>Specify Configuration Database Settings</i>, specify the following values for each field: <br /> <br /> - <b>Database Server:</b> XXXlabdb01 <br /> - <b>Username:</b> CONTOSO\sp_farm <br /> - <b>Password:</b> Type the password specified when the sp_farm domain user account was created earlier in <b>Exercise 3, Step 14</b>. <br /> </li>
<li>Click the <b>Next ></b> button and accept all other default values in the SharePoint Products Configuration Wizard. Click the <b>Finish</b> button when prompted to complete the wizard. <br /> </li>
<li>The <b>SharePoint 2013 Central Administration</b> web page should launch automatically. When prompted, click the <b>Start the Wizard</b> button to begin the <i>Initial Farm Configuration Wizard.</i> <br /> </li>
<li>When prompted for <b>Service Account</b>, type the CONTOSO\sp_serviceapps domain username and password specified when this account was created earlier in <b>Exercise 3, Step 14</b>. <br /> </li>
<li>Accept all other default values and click the <b>Next ></b> button to continue. <br /> </li>
<li>On the <i>Create a Site Collection</i> page, create a new top-level Intranet site collection using the following field values: <br /> <br /> - <b>Title and Description: </b>Enter your preferred Title and Description for the new site collection <br /> - <b>URL: </b>Select the root URL path – <b>http://XXXlabapp01/ <br /> - Select experience version: </b>2013 <br /> - <b>Select a template: </b>Publishing | Publishing Portal <br /> <br />Click the <b>OK</b> button to provision a new top-level Intranet site collection. <br /> <br />After
the new top-level Intranet site collection is provisioned, test
navigating to the URL for this site collection from within the Remote
Desktop session to the server. <br /> </li>
<li>On the <i>SharePoint 2013 Central Administration </i>site,
configure a Public URL alternate access mapping for accessing the new
top-level Intranet site collection from the Internet. <br /> </li>
<ol>
<li>On the <i>Central Administration </i>site home page, click the <b>Configure alternate access mappings </b>link. <br /> </li>
<li>On the <i>Alternate Access Mappings </i>page, click the <b>Edit Public URLs </b>link. <br /> </li>
<li>On the <i>Edit Public Zone URLs</i> page, select and specify the following values: <br /> <br /> - <b>Alternate Access Mapping Collection:</b> SharePoint - 80 <br /> -<b> Internet: </b>http://XXXlabapp01.cloudapp.net <br /> <br />Click the <b>Save</b> button to complete the Alternate Access Mapping configuration. <br /> </li>
</ol>
<li>Close the Remote Desktop session to the server. <br /> </li>
<li>Sign in at the <a href="http://manage.windowsazure.com/" target="_blank">Windows Azure Management Portal</a> with the logon credentials used when you signed up for your <a href="http://aka.ms/AzureVMFreeTrial" target="_blank">Free Windows Azure Trial</a>. <br /> </li>
<li>Select <b>Virtual Machines </b>located on the side navigation panel on the Windows Azure Management Portal page. <br /> </li>
<li>On the <i>Virtual Machines </i>page, click on the name of the SharePoint virtual machine – <b>XXXlabapp01</b>. <br /> </li>
<li>On the <i>XXXlabapp01 </i>virtual machine details page, click on <b>Endpoints </b>in the top navigation area of the page. <br /> </li>
<li>Click the <b>+Add Endpoint </b>button in the bottom
navigation bar of the page to define a new virtual machine endpoint that
will permit HTTP web traffic inbound to the SharePoint virtual
machine. <br /> </li>
<li>On the <i>Add an endpoint to a virtual machine</i> form, select the <b>Add Endpoint</b> option and click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/1273.image_5F00_43A2C768.png"><img alt="Next" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/6557.image_5F00_thumb_5F00_113EF3E9.png" height="14" style="background-image: none; border: 0px currentColor; display: inline;" title="Next" width="16" /></a> button to continue. <br /> </li>
<li>On the <i>Specify the details of the endpoint </i>form, specify the following field values: <br /> <br /> - <b>Name:</b> WebHTTP <br /> - <b>Protocol:</b> TCP <br /> - <b>Public Port:</b> 80 <br /> - <b>Private Port:</b> 80 <br /> <br />Click the <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/3821.image_5F00_49E99DF6.png"><img alt="Checkmark" border="0" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-09-metablogapi/6471.image_5F00_thumb_5F00_7E89FA31.png" height="17" style="background-image: none; border: 0px currentColor; display: inline;" title="Checkmark" width="16" /></a> button to create a new endpoint definition that will permit inbound web traffic to the SharePoint virtual machine. <br /> </li>
<li>After the endpoint configuration has been successfully applied, test
browsing to the following public URL to confirm that you are able to
access the Intranet site collection that is configured on SharePoint: <br /> <br />- <b>URL: </b>http://XXXlabapp01.cloudapp.net</li>
</ol>
The configuration for this virtual machine is now complete, and you
may continue with the next exercise in this step-by-step guide. Be sure
to shutdown your lab VMs from the Windows Azure Management Portal when
not in use to save on compute charges.<br />
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-73077063254788851492014-07-10T11:22:00.003-07:002014-07-10T11:22:51.722-07:00CRM 2013 Exchange SynchronizationUntill version 2013 of Dynamics CRM we had two ways to processing incoming and outgoing email on CRM: <br />
<ul>
<li>CRM Email Router</li>
<li>CRM Outlook Client</li>
</ul>
With Dynamics CRM 2013 the Asynchronous service now provides server-side Exchange Synchronization so there is no need for the old component, even due they are still exists. The Exchange Synchronization allowing users to: <ul>
<li>Process outgoing emails</li>
<li>Process incoming emails</li>
<li>Synchronize contacts, tasks and appointments</li>
<li>Automatically tracking emails based on Correlation rules (smart matching or/and tracking token)</li>
</ul>
On this post I will walk-through how to set up Exchange synchronization with Dynamics CRM 2013, here is an overview of the steps: <ol>
<li>Set up an IIS self-signed certificate (it requires SSL)</li>
<li>Configure Exchange Impersonation</li>
<li>Create and configure a CRM 2013 Exchange profile</li>
<li>Configure User Mailboxes</li>
<li>Configure CRM global Email Settings</li>
<li>Test synchronization</li>
<li>Design Overview</li>
<li>known issues</li>
<li>Summary and References</li>
</ol>
Before we start configuring CRM 2013 with exchange we need to have in-place HTTPS. We just need a self-signed certificate generated by IIS to get us going. <br /><br /><strong><span style="color: red;">Step 1 :</span></strong> <br /> Self-signed Certificate To generate the certificate open IIS and highlight the server name and double click Certificates <ul>
<li>On the right-hand side click on Self-signed certificate</li>
<li>Give it a Name (I call it MyCertificate) leave Personal and click OK</li>
<li>You should see the certificate listed on the list:</li>
<li><img alt=" " height="344" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQeXeJqzC2CaQkopIjPCNFvrASUYwY35zRWRFFkZn2Vf41f6QfE9GSTVDomFCfE5_u0rnw5orTPbdRHWwxvEn8Rw3Fc_neRQYblbn7ckBrasRhLmkiLslsi1x1jnsb0_Gge28O611_mg/s1600/IISSelfSignedCertificate1.png" width="428" /></li>
</ul>
<ul>
<li>Next step is to bind the Dynamics CRM website to HTTPS (443) Highlight the Dynamics CRM web site under sites and on the right-hand side chose Bindings. The below window opens and on the type field you choose HTTPS this will enable the SSL certificate field to choose a certificate and we choose the MyCertificate, click OK</li>
<li><img alt=" " height="317" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0QrVdREfb5gUm7dS6cXjmyocAUU4wLy-fLf6cXpfxezhRivBHY1QarK_8OBojv77E9IfqPRkTPP8Y37VyWXxl94xK2fTBSIhQZKSJ2UXkQhpiq-66qknBMKcMx8ygBx2TNzQdQ-eNoA/s1600/IISSelfSignedCertificate4.png" width="532" /></li>
</ul>
<br /><strong><span style="color: red;">Step 2: Exchange Account Impersonation </span></strong> <br /> Before we start Configuring profiles in CRM we want to make sure CRM service account has impersonation rights on the Exchange side to do this we run the following PowerShell command: <span style="color: #339966;"><b>Exchange 2010</b> </span> New-ManagementRoleAssignment -Name “” -Role:ApplicationImpersonation -User “<service_account>” For example: New-ManagementRoleAssignment -Name “CRM ExServiceAcc” -Role:ApplicationImpersonation -User crm13.service <span style="color: #339966;"><b>Exchange 2007</b></span> Get-MailboxServer “<mailbox_server_name>” | Add-AdPermission -User “<service_account>” -AccessRights ExtendedRight -ExtendedRights ms-Exch-EPI-May-Impersonate, ms-Exch-EPI-Impersonation The second PowerShell command requires the Distinguished Name (DN) of the Microsoft Client Access Server (CAS). To enable impersonation rights on a single Microsoft CAS server use the following command: Get-ClientAccessServer -Identity “<cas_server_name>” | Add-AdPermission -User “<service_account>” -ExtendedRights ms-Exch-EPI-Impersonation <br /><strong><span style="color: red;">Step 3 :</span> </strong> <br /> Configuring CRM Exchange Profile With the https binding in-place navigate to CRM using https://server/organization and settings > Email Configuration Click on <b>Email Server Profiles</b> and then New <b>Exchange Profile</b>: <ul>
<li><img alt=" " border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Z2eI-L67Ewr5znTP8PiO5PKRVJUk66IhD-lhMaE0nowdLWdNWJyB_LjvuW5TVnYK96PnQp_aPxtv4Hh28qUzi6cKrWE9UA8xJ0PfaDCkU5nNPhVIoIZbp34uzDuyjFtxABWrAjS_Ew/s1600/CrmExchangeProfileMenu.png" width="725" /></li>
</ul>
<ul>
<li><img alt=" " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu7HM9QLy2DzjRPheB-LKSDs4jEoiteOzxvWlyWYQUlfXll4sj9y3pCEFJZToT7VK9sxNvsRqHbXYGnbpM8ld7c4d6L8un34mfbDBZQi2JxQY6hSul4DZ8iBxrCj-mBKaxvzAXajdtOg/s1600/CrmExchangeProfileCreateNew.png" /></li>
</ul>
Fill in the details as per the below screenshot, you could use auto-discovery if it’s working okay for you, I have tested in my environment and worked perfectly. The service account we specified has been given server-wide impersonation. I’ve named the profile UK Mailboxes if you have users across different countries and exchange servers located on these sites you should create multiple profiles with the corresponding Exchange servers. <ul>
<li><img alt=" " border="0" height="458" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx5jFLLSx3qHBAe4T9KU2ClG5PJcAjmptbdwxYIB5Xyb4tADBU-SSv-JuQkgGl-wOLqT5QahvV5JB6R3zOurqJWcxRIbcoEofJYMz7PEnrQLoIOuFOsTG6ZS1B1WrNchW8CgbbCGg8Hg/s1600/CrmExchangeProfile2.png" width="634" /></li>
</ul>
Leave the Advanced settings as they are: Navigate to Mailboxes and on the Ribbon choose <b>Add Existing Mailbox</b>, by default every user created or imported during an organization import it’s automatically generated a mailbox in the system, so when you click add existing mailbox the system will list all available user accounts. <ul>
<li> <img alt=" " height="263" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8ouHs42oyy3P01q-lLExwdg7p6pxEOEQOqbCmXq6uW5D2_U4IMdzjM9y8wiuUcIoFYqrCKmDObngWx843lxm61lsr6673_7-MFudjoU-T7V51jI0DEs53AJW3BHutTGYe9FQMr_2coQ/s1600/CrmExchangeProfile5.png" width="387" /></li>
<li> <img alt=" " border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuo0m25YstEGrkqarBrF5YSK3FQWgjjrVUwSWvwmqqFVaU-LNOFwjmJkLnjuqaKuyjm7JMZHBOmq1nvUzsiCRPC_2rksV8YZtYz43OX3CuFq6vCw58zY1BAfstRX5TiZjOSKA8l2VBfQ/s1600/CrmExchangeProfile1.png" width="752" /></li>
</ul>
<br /><strong><span style="color: red;"> Step 4 :</span></strong> <br />Configuring Mailboxes At this stage we have created an Email Server Profile and added 2 mailboxes, lets double click on one of the mailboxes: <b>Change the:</b> <span style="text-decoration: underline;">Server Profile:</span> UK Mailboxes (the profile we just created) <span style="text-decoration: underline;">Incoming Email:</span> Server-Side Synchronization or Email Router <span style="text-decoration: underline;">Outgoing Email:</span> Server-Side Synchronization or Email Router Note: on the configuration test results you should see Not Run instead of Success the screenshot was taken after the configuration was completed <ul>
<li> <img alt=" " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpt0t2530YNjYiH938btvjnFqCYFZCOt-lXoh_usnwayVp5SeBDIrBFuKXTnS15cB9gtjVYO3bS2bIWbPX-DUo4ZobZ3IC-I8qq6lU-VRF7wC4-ubW_J0jkw1Xj7OTpYPqo3CYIDOtuw/s1600/CrmMailboxConfiguration.png" /></li>
</ul>
<b>Approve the Email</b> and then click on <b>Test & Enable Mailbox</b>: You then get the following alert message on the mailbox profile: <ul>
<li><img alt=" " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2KDWAJrIWhdaMqAIP-rMfc9pwRPleQD9Bkgt6ss6RpYGm-KLo48F-HyQ1JNmBHJzxddSHXjwlNR1dWMgd9Hlgu6PIpdAbE4jxCKMao4UTslx0SMsDs7SsRjsICX87Yt6xwBIV8z7chQ/s1600/CrmExchangeTestMailbox6.png" /></li>
</ul>
Click on <b>Alerts</b> and in a few seconds you will see the following messages coming up: <ul>
<li> <img alt=" " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9AevxcckF5Kd1MszeEdpswolpHVZwOTeabjDAnrnTGcifbSGJWKHUVW-Xlc5hcA563hMSHsegIuysOm4Emsn9sDZh1yGR3-ZG5vsNizG7tpW7AGrwv6wwhvV8X7Wzq9E8T3sIsVrBrg/s1600/CrmExchangeTestMailbox7.png" /></li>
</ul>
This means all checks completed successfully and you ready to test it in Outlook. If you look back at the Mailbox General tab you should now see the Configuration test results as Success. During this test a test email is sent to your Inbox: <i>This is a test message to check the outgoing email configuration for [User].</i> <br /><strong><span style="color: red;">Step 5 :</span></strong> <br /> CRM Global Email settings Before we start the Outlook test, lets first look at the CRM Global Email settings navigate to: Settings > Administration > System Settings Go to the Email Tab, on this section there are a number of important settings that you should think from a design phase rather than implementation. <span style="text-decoration: underline;">Configure email processing:</span> here you define which default method you want to process users email as it says if you choose Server-Side it will block Email Router. As we want to test server-side synchronization choose server-side instead of Email router. <span style="text-decoration: underline;">Configure default synchronization method:</span> This will define users profile preferences and this is very important from a design perspective because will avoid duplicating work. If all your users are in UK you can default a server profile to UK Mailboxes, if you have users across different countries you could still define a default Email Server Profile using auto-discovery and then workout manually any specific users that require a manual Server Profile. On the incoming, outgoing email and appointments, contacts and tasks default this to Server-Side synchronization or Email Router this will make sure it can use both. <ul>
<li> <img alt=" " border="0" height="229" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBl_98Bu6VIN8pQqGW-X3As_-w65SnmVcpYz9wS9lqtqMNDYav53IgC3WIY4mnLaqYa0LiI8RcN7krYQcuzBbumToN-qfYYP2Om5NpdI4CgtQEPoXCtNTwAtcx9rx0e9bth1VgHH3IIg/s1600/ExchangeEmailGlobalSettings1.png" width="748" /></li>
</ul>
Below you define if you should only process emails for approved users, this means if email processing is not a sensible subject in your implementation then I would recommend you untick this boxes because it removes an extra click on the configuration steps as we have seen above. <ul>
<li> <img alt=" " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-d6DuKntjyUH5LEQ-BD2i97PogGtiso3_TwaZW89BphANWcuQsp-wJQ0M_04prOy2vl2CuFmj2yjw82Efy7GccSU_WL-m2eqmAwEZj1QBMtcaQjXh8IE0Cz9uFvtd_oKTJJKuD5SAkQ/s1600/ExchangeEmailGlobalSettings2.png" /></li>
</ul>
<br /><strong><span style="color: red;">Step 6 : Test Synchronization</span> </strong> <br /> You ready to test the exchange synchronization create one appointment in CRM and include as required yourself and another CRM user fill in the other details and SAVE in a few minutes if all works well a meeting request is received in Outlook by all users. <ul>
<li><img alt=" " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3RTvAsv3cTKthVSfJumrdPTf6ENJZWXh829le4B5tUiRlFqlZ0H8i3NP9vCJnkQhMjS4U6OVlR2af2L2gBP6tdMhTFrDZH3YhCQDfo9kQ5xUTgIBkPgguDmQ8SCLdIX5fIl2th6v9hQ/s1600/OutlookListCRMExchangeSynch.png" /></li>
<li><img alt=" " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguAGA3dhqWelryu6i0E8kZoiRHOsdYDyTa6m55Xds2PjOT0wLD2s-70Jq50C_vn5QTnQQ-oXQyveUvPQpiVcnUCa7mUsj24Ywu3rvWpQGEsBXO1FszYV1nve49m9R9hsBjErFMEbPmeA/s1600/OutlookReminderCRMExchangeSynch.png" /></li>
</ul>
To test sending emails confirm that on the <b>Configure Email processing</b> in the Global email settings is set to server-side synch, send an email to someone from CRM and ask that person to reply back, you should see the email tracked automatically in CRM.Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-21399599486399944642014-04-21T20:15:00.001-07:002014-04-21T20:15:23.007-07:00 CRM 2011 IFD Multi-Tenency Migration Tips<article class="post-1203 post type-post status-publish format-standard hentry category-crm category-dotnetnuke-6 category-server-tips tag-crm-2011" id="post-1203"><div class="entry-content">
<br />Following on from that we tested the migration from CRM 4.0 hosted
CRM instillations to the newly configured test environment for CRM 2011.<br />
We ran into a few problems (and a few things we did not know) and thought others may benefit from this.<br />
<h4>
CRM Migration</h4>
The process was reasonably simple for us and for that reason we will just list the steps.<br />
<ol>
<li>Backup the CRM 4.0 database to file.</li>
<li>On the new CRM 2011 SQL server, perform a normal SQL database restore from the backup file.</li>
<li>Use the CRM 2011 deployment tool to “Import and Organisation”.
Specifying the obvious settings for the database selection and user
mapping. (In our case, we were on the same domain, so user mapping was
easy).</li>
</ol>
All this worked well, but there were a few problems when we went to
browse the new Org from outside the server. In other words, using the
IFD to access the org.<br />
Internally the org was accessible with <a href="https://internalcrm.domain.com/orgname">https://internalcrm.domain.com/orgname</a> but external access: <a href="https://www.blogger.com/null">https://orgname.domain.com:xxx</a> failed.<br />
<h4>
The Problems</h4>
<h5>
First one</h5>
Was simple but only because we have seen it before. Originally we had accessed the org from our IE 9 browser with <a href="https://org.domain.com/">https://org.domain.com</a> and accessed the CRM 4.0 IFD. Actually we used it for over a year.<br />
Now we wanted to use the new IFD on CRM 2011, but on the same browser. We found when going to: <a href="https://org.domain.com:444/">https://org.domain.com:444</a> that the browser was not even rendering the request for user name and pass that we expected:<br />
<img alt="" border="0" src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-78-55/2555.PIC9.png" /><br />
The IE failure gave no message or indication of why. Basically a 404 failure to hit anything useful.<br />
Yet in another “real browser” (not IE) we could at least get prompted for user and pass info.<br />
<h5>
The Cause</h5>
IE really sucks with clearing old data. The delete all / clear cache /
remove cookies appears on the outset to dump everything, but it does
not. In our case, it cached something from the previous connection to
CRM 4.0 that was killing our access. We then also deleted data in
“C:\Windows\Temp” Can’t explain what the cause is… I would just rather
put it down to the fact that IE 9 “blow chunks” (big ones).<br />
The solution is to manually navigate to the Temporary Internet Files
directory under Windows, and manually delete everything you find in
there. That fixes the page rendering issue.<br />
More information here: <a href="http://www.interactivewebs.com/blog/index.php/crm/crm-2011-server-error-404-file-or-directory-not-found/">http://www.interactivewebs.com/blog/index.php/crm/crm-2011-server-error-404-file-or-directory-not-found/</a><br />
The Second One<br />
Second, we entered a user name and pass, and received a message:<br />
<blockquote>
There was a problem accessing the site. Try to browse to
the site again. If the problem persists, contact the administrator of
this site and provide the reference number to identify the problem.
Reference number: numbers</blockquote>
There was a matching set of AD FS 2.0 Event Logs that looked like this:<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image102.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb101.png" height="123" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<blockquote>
A token request was received for a relying party identified by the key ‘<a href="https://org.domain.com:444/default.aspx%27">https://org.domain.com:444/default.aspx’</a>, but the request could not be fulfilled because the key does not identify any known relying party trust.<br />
Key: <a href="https://org.domain.com:444/default.aspx">https://org.domain.com:444/default.aspx</a><br />
This request failed.<br />
User Action<br />
If this key represents a URI for which a token should be issued, verify
that its prefix matches the relying party trust that is configured in
the AD FS configuration database.</blockquote>
and<br />
<blockquote>
Encountered error during federation passive request.<br />
Additional Data<br />
Exception details:<br />
Microsoft.IdentityServer.Web.InvalidScopeException: MSIS7007: The requested relying party trust ‘<a href="https://org.domain.com:444/default.aspx%27">https://org.domain.com:444/default.aspx’</a>
is unspecified or unsupported. If a relying party trust was specified,
it is possible that you do not have permission to access the trust
relying party. Contact your administrator for details.<br />
at Microsoft.IdentityServer.Web.FederationPassiveAuthentication.SubmitRequest(MSISRequestSecurityToken request)<br />
at
Microsoft.IdentityServer.Web.FederationPassiveAuthentication.RequestBearerToken(MSISSignInRequestMessage
signInRequest, SecurityTokenElement onBehalfOf, SecurityToken
primaryAuthToken, String desiredTokenType, Uri& replyTo)<br />
at
Microsoft.IdentityServer.Web.FederationPassiveAuthentication.RequestBearerToken(MSISSignInRequestMessage
signInRequest, SecurityTokenElement onBehalfOf, SecurityToken
primaryAuthToken, String desiredTokenType, MSISSession& session)<br />
at
Microsoft.IdentityServer.Web.FederationPassiveAuthentication.BuildSignInResponseCoreWithSerializedToken(String
signOnToken, WSFederationMessage incomingMessage)<br />
at
Microsoft.IdentityServer.Web.FederationPassiveAuthentication.BuildSignInResponseCoreWithSecurityToken(SecurityToken
securityToken, WSFederationMessage incomingMessage)<br />
at
Microsoft.IdentityServer.Web.FederationPassiveAuthentication.BuildSignInResponseForProtocolRequest(FederationPassiveContext
federationPassiveContext, SecurityToken securityToken)<br />
at Microsoft.IdentityServer.Web.FederationPassiveAuthentication.BuildSignInResponse(SecurityToken securityToken)</blockquote>
<h4>
The solution</h4>
An easy one, but something we did not know. With CRM 2011 in IFD.
Each time you add an org, you need to update your Relying Party Trusts
from Federation Metadata. Big words that mean…<br />
<ol>
<li>Open AD FS Management Tool</li>
<li>Expand Trust Relationships</li>
<li>Click on Relying Party Trusts</li>
<li>Click on you IFD Trust, Right Click and Select Update From Federation Metadata</li>
</ol>
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image103.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb102.png" height="88" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
I have no idea why this is not automatically updated every time the
service starts, or even every time the service is called upon….<br />
<br />
</div>
<footer class="entry-meta"><span class="tag-links"> </span></footer><footer class="entry-meta"><span class="tag-links"><a href="http://www.interactivewebs.com/blog/index.php/tag/crm-2011/" rel="tag"> </a></span></footer></article>Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-57481200633281229832014-04-21T20:08:00.000-07:002014-04-21T20:08:06.431-07:00CRM 2011 Email Router Setup and Settings<br />
<br />
<article class="post-2166 post type-post status-publish format-standard hentry category-crm category-server-tips tag-crm-2011" id="post-2166"><header class="entry-header"><div class="entry-meta">
<span class="comments-link"><a href="http://www.interactivewebs.com/blog/index.php/server-tips/crm-2011-email-router-setup-and-settings/#comments" title="Comment on CRM 2011 Email Router Setup and Settings"></a></span>
</div>
</header>
<div class="entry-content">
Often with the setup of CRM 2011. Users experience messages about
Pending e-mail warning and sometimes email messages are not sending.<br />
<div class="GARD gard_advanced_mode ad_unit ad_unit_468x60_1" id="google-ads-hMAQ">
<ins style="background-color: transparent; border: none; display: inline-table; height: 60px; margin: 0; padding: 0; position: relative; visibility: visible; width: 468px;"><ins id="aswift_1_anchor" style="background-color: transparent; border: none; display: block; height: 60px; margin: 0; padding: 0; position: relative; visibility: visible; width: 468px;"></ins></ins></div>
This can be especially frustrating as both the CRM email queuing and
tracking system and the Email router application are terrible to help
you understand exactly what is going on with your CRM e-mail.<br />
We mentioned some of the issues we have experience here:<br />
<a href="http://www.interactivewebs.com/blog/index.php/server-tips/crm-2011-email-router-problemsshes-a-fickle-bitch/" title="http://www.interactivewebs.com/blog/index.php/server-tips/crm-2011-email-router-problemsshes-a-fickle-bitch/">http://www.interactivewebs.com/blog/index.php/server-tips/crm-2011-email-router-problemsshes-a-fickle-bitch/</a><br />
<h2>
Here are some basic setup tips for email in Microsoft CRM 2011</h2>
1. Out of the box, CRM does not send email messages. You need to
configure an application known as CRM 2011 Email Router to have email
messages send.<br />
2. You also need a working SMTP (email server) that is configured to
allow the relay of email messages from email accounts at your domain
name. This can be achieved with Amazon SES message service or your own
servers. We can assist you setup Amazon SES if you need assistance with
this.<br />
3. You should install and configure your Email Router. Some notes to help you may include these: <a href="http://www.interactivewebs.com/blog//?s=email+router" title="http://www.interactivewebs.com/blog//?s=email+router">http://www.interactivewebs.com/blog//?s=email+router</a><br />
<h2>
Recommended email settings in CRM 2011</h2>
1. Out of the box. CRM will only be able to send email messages to
leads, contacts, and accounts. Until you change this setting found in
the Admin / System Settings in CRM.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image1.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb1.png" height="144" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
2. Avoid delayed email messages in CRM by Approve Email Address. In
the Administration / Users. Go into each user and approve the configured
email address.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image2.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb2.png" height="157" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
There is a view of users who are Pending Email address approval to help identify who is needing approval.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image3.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb3.png" height="244" style="background-image: none; display: inline; margin: 0px;" title="image" width="235" /></a><br />
Also uncheck the option for Process emails only for approved users
and process email only for approved queues. Administration / System
Settings.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image4.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb4.png" height="94" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
<br />
3. Configure users email settings to use the email router for outbound email messages. (optionally inbound configuration too).<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image5.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb5.png" height="87" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
Our recommendation is to set the outbound processing for the email
router. This will allow emails generated by the crm system to be
delivered right away via the email router. This also means that you do
need to install and configure the email router.<br />
The above settings can be set automatically for all users by the use
of a simpler out of the box workflow that runs on create of new users.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image6.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb6.png" height="129" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
4. The next setting is recommended. Knowing that email can be tracked in CRM with the outlook client:<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image7.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb7.png" height="79" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
Email messages can automatically be tracked too.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image8.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb8.png" height="101" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
5. The all powerful features of creating contacts in CRM when and email address is not known.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image9.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb9.png" height="196" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
This is a great way to automatically get more leads or contacts
(depending on your business) in crm. And depending on your business can
also be a great way to pollute your crm full of contacts or leads that
you don’t want.<br />
<h2>
Troubleshooting Tips</h2>
To troubleshoot an E-mail Router outgoing profile configuration, follow these steps:<br />
<ol>
<li>Make sure that you follow the incoming profile configuration procedures in the E-mail Router Configuration Manager Help.</li>
<li>For more information about how to configure an incoming profile, see
the E-mail Router configuration information in the latest version of
the Installing Guide that is included in the <a href="http://go.microsoft.com/fwlink/?LinkID=104413">Microsoft Dynamics CRM 4.0 Implementation Guide</a>.</li>
<li>Refer to the following sections for information about how to resolve commonly encountered outgoing profile issues.</li>
</ol>
Test Access error<br />
If there is a problem with your outgoing e-mail configuration, you
may receive the following error message when you click Test Access on
the E-mail Router Configuration Manager:<br />
“Outgoing status: Failure – An error occurred while checking the
connection to e-mail server EXSERVERNAME. The requested address is not
valid in its context”<br />
If you receive this message, follow these steps to troubleshoot the problem:<br />
<ol>
<li>Run a telnet command to verify that connectivity is functioning
between the computer that is running CRM Router and the Exchange Server.
For example, start the TELNET utility and enter the following
command:TELNET EXSERVERNAME PORT</li>
<li>Make sure that you have no antivirus services running on the Exchange Server computer that prevent connection by using port 25.</li>
<li>For information about how to configure the SMTP server to allow relay messages from Microsoft Dynamics CRM, see KB article <a href="http://go.microsoft.com/fwlink/?LinkId=140399">915827</a>.</li>
</ol>
E-mail error when message sent from the Web application<br />
<b>Symptom:</b> When a user sends an e-mail message by using the Web application, the user might receive one of the following messages:<br />
This message has not yet been submitted for delivery. 1 attempts have been made so far.<br />
The message delivery failed. It must be resubmitted for any further processing.<br />
<b>Resolution:</b> For information about how to resolve this issue, see KB article <a href="http://go.microsoft.com/fwlink/?LinkId=140399">915827</a>.<br />
Load Data error<br />
When you click Load Data in the E-mail Router Configuration Manager, you receive the following error:<br />
The E-mail Router Configuration Manager was unable to retrieve user
and queue information from the Microsoft Dynamics CRM server. This may
indicate that the Microsoft Dynamics CRM server is busy. Verify that URL
‘http://<i>OrganizationName</i>‘ is correct. Additionally, this
problem can occur if the specified access credentials are insufficient.
To try again, click Load Data. (The request failed with HTTP status 404:
Not Found.)<br />
To resolve this problem, follow these steps:<br />
<ol>
<li>Make sure that the user account that is running the E-mail Router
Configuration Manager service is a member of the Active Directory
PrivUserGroup security group.</li>
<li>The account that is specified in the Access Credentials field on the
General tab of the E-mail Router Configuration Manager must be a
Microsoft Dynamics CRM administrative user. If the access credentials
are set to Local System Account, the computer account must be a member
of the Active Directory PrivUserGroup security group.</li>
<li>Make sure that the URL is spelled correctly. The organization name
in the URL field is case-sensitive and must be spelled exactly as it
appears in the Microsoft Dynamics CRM server. To view the organization
name as it appears in the Microsoft Dynamics CRM server, start the Web
application. The organization name appears in the upper-right corner of
the application window.</li>
<li>The DeploymentProperties table may have incorrect values if you have
modified the port or hostheaders on your Web site. To update the
DeploymentProperties table see, KB article <a href="http://go.microsoft.com/fwlink/?LinkId=140392">950248</a>.</li>
</ol>
<h2>
Pending Email warning</h2>
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image10.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb10.png" height="145" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
On the Email Router, configure:<br />
1. Check event view for Email Router related errros<br />
2. Change the send email<br />
3. Restart CRM email Router service<br />
4. Reduce the pooling time and conneciton timeout<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image11.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb11.png" height="244" style="background-image: none; display: inline; margin: 0px;" title="image" width="241" /></a><br />
<br />
<h2>
Automatically Resending Failed Email Messages</h2>
The Advanced find can be used to find email messages that have not
sent. A workflow can also be created to resend messages automatically.
However constant failures is going to indicate a problem some other
place. So the use of this automatic workflow should not be introduced in
place of fixing your sending issues.<br />
<b>Steps to create the workflow to re-send failed e-mails:</b><br />
1. Create a new Workflow in CRM | Processes on the E-mail entity<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image12.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb12.png" height="97" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
2. Set the workflow to be Available to Run “As an on-demand process”,
Change the scope to Organization and uncheck “Record is created”. This
will make the workflow available to run On-Demand, function for all
e-mails in the organization and also not run when every time a new
e-mail is created as we just want to use this when needed on specific
e-mails.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image13.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb13.png" height="63" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
3. Click “Add Step” and choose “Change Status”<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image14.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb14.png" height="244" style="background-image: none; display: inline; margin: 0px;" title="image" width="152" /></a><br />
4. Set the E-mail to a status of “Pending Send”<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image15.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb15.png" height="105" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
5. Click Save and then Activate in the toolbar. Click ”OK” to the
message to confirm you want to Activate the workflow and then click
“Close” on the workflow.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image16.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb16.png" height="28" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
<b>Advanced Find to see how many e-mails are in a failed status:</b><br />
1. Open Advanced Find by clicking the “Advanced Find” button in the CRM ribbon<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image17.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb17.png" height="161" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
2. Select “E-mail Messages” in the Look For option set and then
select “Status Reason” and set it equal to “Failed”. Then click the
Results button in the Advanced Find ribbon.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image18.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/2013/01/image_thumb18.png" height="50" style="background-image: none; display: inline; margin: 0px;" title="image" width="244" /></a><br />
3. You can refine the results using the filter criteria from here as
well in case you do not want to re-send all of the e-mails. Once you are
done, multi-select the e-mails you want to re-send and then click the
“Run Workflow” button in the CRM ribbon.<br />
4. Select the e-mail workflow that you created using the steps above and click OK.<br />
The workflow will then run and change the status of all the e-mails
you had selected back to “Pending Send”. This is an asynchronous
process, so it may take a few minutes depending on your current
asynchronous workload in CRM. Then the CRM e-mail router will process
them again and send them out through SMTP as expected.<br />
<h2>
</h2>
</div>
</article>Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-29169258681051940222014-04-21T19:59:00.000-07:002014-04-21T20:05:19.347-07:00Microsoft CRM IFD SSL Certificate RenewalThe time will come around where you need to <b>renew</b> the SSL <b>certificate</b> for your CRM IFD configuration.<br />
This will include the renewal of the SSL certificate as used by IIS
and and ADFS. Couple of steps we followed based exactly on the
configuration outlined in our above linked blog post.<br />
<h2>
Generate a new SSL Request.</h2>
1. Open IIS Manager and click on server certificates.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb.png" height="131" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
2. Create certificate request<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_3.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_3.png" height="205" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
3. Fill in the data:<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_4.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_4.png" height="186" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a> Next<br />
4. Change to 2048 Bit<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_5.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_5.png" height="186" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
5. Give it a name:<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_6.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_6.png" height="193" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Finish and you are done.<br />
Now Open the certificate text file and copy the text to your clip
board, or use this with your certificate authority to issue you a new
Wild Card Certificate. *.interactivewebs.com is what we use.<br />
To get the certificate we use a service called “startssl.com” who
allow you to issue certificates like this for 2 years for free once you
are validated as a user.<br />
<h2>
Complete the Certificate Request</h2>
Once the new certificate has been issued to you you need to complete the request on IIS.<br />
1. In IIS Manager click on Complete Certificate Request<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_7.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_7.png" height="213" style="background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
2. Browse to the certificate from your issuer provider and give it a
friendly name. We like to use a year in the name to help distinguish
from the old one.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_8.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_8.png" height="212" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Finish the import.<br />
<h2>
Change the certificate used by IIS</h2>
1. Expand the two sites on the CRM server and click on <b>Default Website</b> first then <b>Bindings / https</b><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_9.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_9.png" height="148" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Then EDIT<br />
2. Select the new certificate that you just imported and click on <b>OK</b><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_10.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_10.png" height="128" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
3. Repeat this process fro the Microsoft Dynamics CRM website<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_11.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_11.png" height="89" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
selecting the new certificate here and <b>OK</b>.<br />
4.<b> Restart IIS</b><br />
<h2>
Set Permissions on SSL Certificate</h2>
<blockquote>
1. Click <b>Start</b>, and then click <b>Run</b>.<br />
2. Type <b>MMC</b>.<br />
3. On the <b>File </b>menu, click <b>Add/Remove Snap-in</b>.<br />
4. In the <b>Available snap-ins </b>list, select <b>Certificates</b>, and then click <b>Add</b>. The Certificates Snap-in Wizard starts.<br />
5. Select <b>Computer account</b>, and then click <b>Next</b>.<br />
6. Select <b>Local computer: (the computer this console is running on)</b>, and then click <b>Finish</b>.<br />
7. Click <b>OK</b>.<br />
8. Expand <b>Console Root\Certificates (Local Computer)\Personal\Certificates</b>.<br />
9. Right-click <b>Certificates</b>, click <b>All Tasks</b>, and then click <b>Import</b>.</blockquote>
Step 2: Add to the ADFS service account the permissions to access the
private key of the new certificate. To do this, follow these steps:<br />
<blockquote>
1. With the local computer certificate store still open, select the certificate that was just imported.<br />
2. Right-click the certificate, click <b>All Tasks</b>, and then click <b>Manage Private Keys</b>.<br />
3. Add the account that is running the ADFS Service, and then give the
account at least read permissions. (for us this is the Network Service)</blockquote>
<h2>
Run the Deployment Manager with new Certificate</h2>
1. Run the CRM deployment manager:<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_12.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_12.png" height="58" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="183" /></a><br />
2. Run the <b>Configure Claims-based Authentication</b><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_13.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_13.png" height="166" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Select the default settings.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_14.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_14.png" height="233" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_15.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_15.png" height="236" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Which should be the default from your IFD setup<br />
But when you get to the Certificate, you need to select the new certificate.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_16.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_16.png" height="230" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_17.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_17.png" height="244" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="204" /></a><br />
Which should be visible from the list after importing it in the steps above.<br />
3. Run the <b>Configure Internet Facing Deployment</b> action and just step though it with the default settings.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_18.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_18.png" height="244" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="213" /></a><br />
4. Restart the AD FS 2.0 Windows Service<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_19.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_19.png" height="180" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Configure AD<br />
<h2>
Set the Service Communication Certificate</h2>
1. Start AD FS 2.0 Management<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_20.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_20.png" height="112" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
2. Expand certificates and select Set Service Communications Certificate<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_21.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_21.png" height="191" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
3. Select the new certificate that will be listed here.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_22.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_22.png" height="161" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Update Relying Party Trusts<br />
1. From the AD FS 2.0 Management, Select your replying party trusts and update from the federation metadata one by one.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_23.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_23.png" height="53" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Update both listed. They will likely have a red cross before you do this.<br />
Restart Services<br />
Restart AD FS Service:<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_24.png"><img alt="image" border="0" src="http://www.interactivewebs.com/blog/wp-content/uploads/livewriterftp/Microsoft-CRM-IFD-SSL-Certificate-Renewa_1255F/image_thumb_24.png" height="65" style="background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
and restart IIS the usual way.<br />
And you should be done. Login to your CRM IFD again and enjoy.<br />
<br />
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-52999177534584948672014-04-21T19:49:00.001-07:002014-04-21T19:49:25.495-07:00Microsoft CRM 2011 How to Configure IFD Hosted SetupSingle Server<br />
On an existing domain<br />
Running true IFD ready for customer access.<br />
The last point it telling, as all the Microsoft examples give a self
generated SSL cert, that really is an example of a DEV environment only.
We want to test the “real deal”, and don’t mind spending a few $ on a
real Certificate to see this in a true working environment.<br />
<h4>
The Existing Setup</h4>
Because this is a test environment, we are running the server on a
Hyper V server. A single VM machine, that is running a fully patched
version of:<br />
<ul>
<li>Windows 2008 R2 SP1 64 Bit</li>
<li>SQL 2008 R2 64 Bit</li>
<li>Microsoft CRM 2011 64 Bit</li>
</ul>
Interesting enough, something that always takes me 15 min, it
ensuring I download the correct version of the ISO files from MSDN. I
get it that I am somewhat lame, but if you get a wrong version you can
waste a load of time and energy later.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image19.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb18.png" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="174" /></a><br />
With a list looking like this it can be painful. Anyway, these are the files we used for install:<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image20.png"><img alt="image" border="0" height="34" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb19.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
For those who care, the VM was set to run with 6000 MB ram, and fold out to use more.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image21.png"><img alt="image" border="0" height="151" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb20.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<h5>
Importantly</h5>
When we setup CRM, we selected the option to NOT use the default
website, but configure a new one with the default settings of port 5555.
This is necessary as you will see later.<br />
<br />
<h4>
Backup First</h4>
In all things Microsoft world, it is vital what you establish a
working point to avoid unnecessarily installing things all over again.
To get things working we have started fresh over 4 times.<br />
Hyper V is great for this, as we just stopped the server, and made a
copy of the VHD file. Then when it is time to start all over, it is just
a matter of restoring from copy/backup.<br />
<br />
<h4>
Test First</h4>
Test that your CRM setup is working. Go to the local computer name (ours is VSERVER08) on the correct port: <a href="http://vserver08:5555/">http://vserver08:5555</a><br />
We called our Deployment of CRM – “CRM2011″ So the URL redirects to: <a href="http://vserver08:5555/CRM2011/main.aspx" title="http://vserver08:5555/CRM2011/main.aspx">http://vserver08:5555/CRM2011/main.aspx</a><br />
and after being prompted for login, we are in and testing.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image22.png"><img alt="image" border="0" height="192" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb21.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<h4>
Apply a Wildcard SSL Certificate</h4>
In CRM, the accessing of deployments is handled by the sub domains.
So if we call a deployment “business1″ we will access that as: <a href="https://business1.domain.com/">https://business1.domain.com</a><br />
For testing, we purchased a standard Wildcard SSL certificate that applied that to the IIS7 server.<br />
We will let you work out that bundle of joy, but a few tips.<br />
1. Godaddy was about as cheap as you find on the net.<br />
2. Setup involves creating a certificate request from within IIS,
then pasting that text into the online providers order system. They then
generate the certificates that you then import back into IIS and the
server.<br />
3.<br />
<strong>Application for a certificate</strong><strong></strong><br />
Here, I will be a wildcard certificate, for example, describes how to create a certificate:<br />
1) Open IIS Manager<br />
2) Click the server name in the main screen double click Server Certificates<br />
3) In the right panel, click Create Certificate Request…<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image23.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb22.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="222" /></a><br />
4) fill in the following diagram each column, click Next<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image24.png"><img alt="image" border="0" height="186" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb23.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
5) Cryptographic Service Provider Properties page to keep the default, click Next.<br />
6) In the File Name page, enter C: \ req.txt , and then click Finish.<br />
7) Run cmd , run<br />
certreq-submit -attrib “CertificateTemplate: WebServer” C: \ req.txt<br />
8) Select the CA , click OK.<br />
9) the certificate is stored as C: \ Wildcard.cer . ( 7-9 can also be in the CA to complete)<br />
10) back to the IIS Manager, click No. 3) Step graph Complete Certificate Request …<br />
11) Select the C: \ Wildcard.cer , Friendly name named *. contoso.com , of course, you can take a different name.<br />
12) Click OK.<br />
13) so that we completed the wildcard certificate request.<br />
<br />
<h4>
Additional SSL Certificate Imports</h4>
1) RUN MMC at the start / search<br />
2) Select File / Add Remove Snapin – Select Certificates – ADD<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image25.png"><img alt="image" border="0" height="169" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb24.png" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Computer Account<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image26.png"><img alt="image" border="0" height="180" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb25.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a> NEXT / Finish<br />
3) Expand the first two folders, and Right Click on the Certificates Folder and select: All Tasks / Import.<br />
4) Browse to your wildcard SSL certificate file, and import that into the Personal and Trusted Root Certification Authorities.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image27.png"><img alt="image" border="0" height="63" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb26.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<br />
Ensure that you<br />
<br />
<h4>
<strong>Binding site for the default </strong><strong>SSL </strong><strong>certificate</strong></h4>
1) Open IIS Manager.<br />
2) In the Connections panel, expand Sites , click Default Web Site.<br />
3) In the Actions pane, click Bindings.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image28.png"><img alt="image" border="0" height="129" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb27.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
4) In the Site Bindings dialog box, click Add.<br />
5) Type select HTTPS.<br />
6) SSL Certificate , select the certificate you just created *. contoso.com , and then click OK.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image29.png"><img alt="image" border="0" height="131" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb28.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a> Ours is interactivewebs.com<br />
7) Click Close.<br />
8) Repeat for the Personal certificate folder.<br />
<br />
<h4>
<strong>For the </strong><strong>CRM 2011 </strong><strong>binding site </strong><strong>SSL </strong><strong>certificate</strong><strong></strong></h4>
1) Open IIS Manager.<br />
2) In the Connections panel, expand Sites , click CRM Web Site.<br />
3) In the Actions pane, click Bindings.<br />
4) In the Site Bindings dialog box, click Add.<br />
5) Type select HTTPS.<br />
6) SSL Certificate , select the certificate you just created *. contoso.com .<br />
7) Port to select a different 443 (e.g. 444 ) and port number, and then click OK<br />
8) Click Close.<br />
<br />
<h4>
<strong>DNS </strong><strong>configuration</strong></h4>
For MS CRM 2011 configuration Claims-based authentication, you need
the DNS to add some records to make CRM 2011 for each breakpoint can be
resolved correctly.<br />
There are two ways you can achieve the desired result. But first lets understand the desired result.<br />
<ol>
<li>We make the assumption that your server is running at least one static IP address.</li>
<li>Because this is Internet Facing, that IP needs to be accessible to the world.</li>
<li>That same IP can be used for access to your server both internally
on the matching we are playing with, and externally form anyone on the
net.</li>
</ol>
<h5>
Lets Get Basic</h5>
Start a Command Prompt, and work out what your IP address of the server is.<br />
Click START > RUN > CMD<br />
Type IPCONFIG – Enter<br />
Under the name: IPv4 Address is a number that looks like: 66.34.204.220<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image105.png"><img alt="image" border="0" height="152" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb104.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
That is Your IP Address of the Server.<br />
<h4>
The DNS Goal</h4>
Make sure that when you <a href="http://www.mediacollege.com/internet/troubleshooter/ping.html">PING</a> xxx.domain.com that it points to that IP address. Both for the world and for you when you do that on your server.<br />
<em>(xxx is the sub domain that we are about to configure.)</em><br />
To configure CRM, we need some sub domains to point to the server IP.<br />
<ol>
<li>sts.domain.com</li>
<li>auth.domain.com</li>
<li>dev.domain.com</li>
<li>Your ORG name. org.domain.com (Where ORG is the CRM deployment name of your organization or organizations), e.g.</li>
</ol>
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image106.png"><img alt="image" border="0" height="44" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb105.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
We have two setup here: CRM and CRM2011. So we need to configure crm.interactivewebs.com and crm2011.interactivewebs.com.<br />
<h4>
Hosting Your Own DNS</h4>
If you host your own Domain Name Server (DNS) and you host the domain
name that you are using to setup IFD. Then configuring an A record for
the above mentioned sub domains is easy.<br />
<strong>START</strong> > <strong>Administrative Tools</strong> > <strong>DNS</strong><br />
Find your Domain Name<br />
<strong>Right Click</strong> and select <strong>NEW HOST A</strong><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image107.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb106.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="223" /></a><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image108.png"><img alt="image" border="0" height="229" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb107.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Add an A record that points to your servers IP address.<br />
Repeat this process for all of the above mentioned sub domains. auth, sts1, dev, and your own organization names.<br />
<h4>
Test DNS</h4>
You must be able to ping all of those names and get the correct
server IP address. Both from computers on the internet, and from the
server.<br />
<strong>Note:</strong> If you have added the DNS records, but still
encounter name resolution problems, you can try running on the client
ipconfig / flushdns to clean up the cache. You can also click the DNS
server root and click CLEAR CACHE so that the server is responding with
the latest updates.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image109.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb108.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="233" /></a><br />
<em>Note: Don’t bother proceeding past this step if you cannot ping your sub domains internally and externally correctly.</em><br />
<br />
<h4>
<strong>Firewall configuration</strong><strong></strong></h4>
You need to set the firewall to allow the CRM 2011 and the AD FS 2.0
port used by the incoming data stream. HTTPS (SSL) is the default port
443.<br />
For Initial setup testing etc. We recommend just turning the thing
off. Better start from a place where it does not muck you around, then
turn it all back on after you are successful.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image46.png"><img alt="image" border="0" height="221" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb45.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<br />
<h2>
<strong>Configuration </strong><strong>Claim-based </strong><strong>authentication </strong><strong>-</strong><strong>internal access</strong><strong></strong></h2>
Configure the internal access Claim-based authentication requires the following steps:<br />
<ul>
<li>Install and configure AD FS 2.0 .</li>
<li>Set Claims-based authentication configuration CRM 2011 server.</li>
<li>Set the Claims-based authentication configuration AD FS 2.0 server.</li>
<li>Test claims-based authentication within the access.</li>
</ul>
<h4>
<strong>Install and configure AD FS 2.0</strong></h4>
CRM 2011 with a variety of STS provider ( STS Provider ) together.
This article uses Active Directory Federation Services (AD FS) 2.0 to
provide a security token service (security token service ).<br />
Note: AD FS 2.0 will be installed to the default site, so install AD FS 2.0 , you must have CRM 2011 installation in the <strong><span style="background-color: yellow;">new site</span></strong>. (Remember we said that earlier)<br />
IIS Looks like this if it is correctly installed: <a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image30.png"><img alt="image" border="0" height="140" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb29.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
If you only see the default website with CRM installed in that. Start AGAIN!<br />
<br />
<h4>
<strong>Download the </strong><strong>AD FS 2.0</strong></h4>
From the following link to download the AD FS 2.0<br />
Active Directory Federation Services 2.0 RTW<a href="https://www.blogger.com/null" name="H_56280"></a>( <a href="http://go.microsoft.com/fwlink/?LinkID=204237">http://go.microsoft.com/fwlink/?LinkID=204237</a> ).<br />
<br />
<h4>
<strong>Install </strong><strong>AD FS 2.0</strong></h4>
In the installation wizard, select the federation server role installed, for more information refer to<br />
Install the AD FS 2.0 Software<a href="https://www.blogger.com/null" name="H_57205"></a>( <a href="http://go.microsoft.com/fwlink/?LinkId=192792">http://go.microsoft.com/fwlink/?LinkId=192792</a> ).<br />
<h4>
<strong>Configure </strong><strong>AD FS 2.0</strong></h4>
1 in the AD FS 2.0 server, click Start , then click <strong>AD FS 2.0 Management</strong> .<br />
2 In the <strong>AD FS 2.0 Management</strong> page , click <strong>AD FS 2.0 Federation Server Configuration Wizard</strong> .<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image31.png"><img alt="image" border="0" height="99" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb30.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
3 In the <strong>Welcome</strong> page , select <strong>Create a new Federation Service</strong> , and then click <strong>Next</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image32.png"><img alt="image" border="0" height="198" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb31.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
4 In the <strong>Select Deployment Type</strong> page , select <strong>Stand-alone Federation Server</strong> , and then click <strong>Next</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image33.png"><img alt="image" border="0" height="195" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb32.png" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
5 Choose your SSL certificate (the choice of a certificate created *.
contoso.com ) ,add a Federation Service name ( for example ,
sts1.contoso.com), and then click <strong>Next</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image34.png"><img alt="image" border="0" height="194" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb33.png" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<strong>Note:</strong> Only you as the AD FS 2.0 sites when using the wildcard certificate, only need to add the Federation Service name.<br />
6 Summary page, click <strong>Next</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image35.png"><img alt="image" border="0" height="200" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb34.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
7 Click <strong>Close</strong> to close the AD FS 2.0 Configuration Wizard.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image36.png"><img alt="image" border="0" height="195" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb35.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<strong>Note:</strong> If you have not added ( sts1.contoso.com ) to add DNS records, then do it now.<br />
<br />
<h4>
<strong>Verify the </strong><strong>AD FS 2.0 </strong><strong>is working</strong><strong></strong></h4>
Follow the steps below to verify that the AD FS 2.0 is working :<br />
1 Open Internet Explorer.<br />
2 Enter the federation metadata of the URL , for example:<br />
https://sts1.contoso.com/<span style="background-color: yellow;">federationmetadata/2007-06/federationmetadata.xml</span><br />
3. to ensure that no certificate associated with the warning appears.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image37.png"><img alt="image" border="0" height="104" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb36.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<br />
<h2>
<strong>Claims-based authentication configuration CRM 2011server</strong></h2>
After you install and configure the AD FS 2.0 , we need to configure
the Claims-based authentication before setting CRM 2011 binding types (
Binding type ) and the root domain (root Domains) .<br />
According to the following steps to set up CRM 2011 bound for the HTTPS and configure the root domain address :<br />
1 Open the CRM Deployment Manager.<br />
2 In the <strong>Actions</strong> pane , click <strong>Properties</strong> .<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image38.png"><img alt="image" border="0" height="178" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb37.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
3 Click the <strong>Web Address</strong> page .<br />
4 In the <strong>Binding Type</strong> , select <strong>HTTPS</strong> .<br />
5. Ensure that the network address for the binding CRM 2011 site SSL
certificate and SSL ports. Because you configured for internal access to
Claims-based authentication, so the address of the host for the root
domain name. Port number must IIS in CRM 2011 is set in the port the
same site.<br />
6 For example, *. contoso.com wildcard certificate, you can useinternalcrm.contoso.com: 444 as the network address.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image39.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb38.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="216" /></a><br />
7 Click <strong>OK</strong> .<br />
<strong>Note:</strong> If the CRM Outlook client configuration using
the old binding value, then the need to be updated to use the new value.
+ Make sure you have a DNS entry for: internalcrm.<br />
From the CRM 2011 is passed to the AD FS 2.0 of Claims data you need
to use the Claims-Based Authentication Configuration Wizard (described
below) specified in the certificate for encryption. Therefore, CRM Web
application CRMAppPool account must have read the certificate’s private
key encryption ( Read ) permissions.According to the following steps to
give this permission:<br />
1 in CRM 2011 server , run the Microsoft Management Console (Start => Run MMC).<br />
2 Click Files => Add / Remove Snap-in …<br />
3 left panel, select Certificates , click Add to add to the right panel.<br />
4 In the pop-up window, select Computer account .<br />
5 next page, select Local Computer , click Finish .<br />
6 Click OK .<br />
7 Expand the Certificates ( Local Computer ) => Personal, select Certificates .<br />
8. In the middle panel, right-click you will be in the Claims-Based
Authentication Configuration Wizard to specify the encryption
certificate (in this case *. contoso.com ), click All Tasks => Manage
Private Keys.<br />
<img alt="" border="0" src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-78-55/1108.pic5.PNG" /><br />
9 Click Add , add CRMAppPool account (if you are using Network
Service , select the account directly), and then give Read permissions.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image40.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb39.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="198" /></a><br />
<strong>Note: </strong>You can use IIS Manager to view CRMAppPool what account to use. In the <strong>Connections </strong>panel , click <strong>Application Pools</strong> , and then see CRMAppPool <strong></strong>under <strong>Identity</strong> .<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image41.png"><img alt="image" border="0" height="226" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb40.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
10 Click OK .<br />
<br />
<h2>
Configure Claims-Based Authentication</h2>
Below, we setup <strong>Claims-Based </strong><strong>Authentication Configuration Wizard</strong>
( Configure Claims-Based Authentication Wizard ) to configure the
Claims-Based Authentication. To learn how PowerShell to configure
Claims-Based Authentication, refer to the English original.<br />
1) Open the Deployment Manager.<br />
2) on the left navigation panel, right-click <strong>Microsoft Dynamics CRM</strong> , and then click <strong>Configure Claims-Based Authentication</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image42.png"><img alt="image" border="0" height="162" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb41.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
3) click <strong>Next</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image68.png"><img alt="image" border="0" height="229" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb67.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
4) In the <strong>Specify the security token service</strong> page , enter the Federation metadata URL, such as<br />
<a href="https://sts1.interactivewebs.com/federationmetadata/2007-06/federationmetadata.xml" title="https://sts1.interactivewebs.com/federationmetadata/2007-06/federationmetadata.xml">https://sts1.interactivewebs.com/federationmetadata/2007-06/federationmetadata.xml</a><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image43.png"><img alt="image" border="0" height="121" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb42.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<strong>Note:</strong> The data is usually in the AD FS 2.0 website.
Can this URL copied into IE to seeFederation metadata , to ensure that
this is the correct URL . Using IE to access the URL can not have a
certificate-related warnings (Ignore that crap!)<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image69.png"><img alt="image" border="0" height="236" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb68.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
5) Click <strong>Next</strong> .<br />
6) In the <strong>Specify the encryption certificate</strong> page , click on Select…<br />
7) select a certificate, where we choose *.interactivewebs.com.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image44.png"><img alt="image" border="0" height="202" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb43.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image45.png"><img alt="image" border="0" height="232" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb44.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
8) This certificate is used to encrypt the transmitted AD FS 2.0 authentication security token service security token.<br />
<strong>Note: </strong>Microsoft Dynamics CRM service account must have the private key encryption certificate Read permission.<br />
10 Click <strong>Next</strong> . Claims-Based Authentication Configuration Wizard validates the token and certificate you specified.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image70.png"><img alt="image" border="0" height="239" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb69.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
11 In the <strong>System Checks</strong> page, if the test passed, click <strong>Next</strong> .<br />
12 In the <strong>Review your selections and then click Apply</strong> page , just to confirm the input, and then click <strong>Apply</strong> .<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image71.png"><img alt="image" border="0" height="234" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb70.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
13. On this page, note which of the URL , because then, you will use
this URL to add a trusted party ( Relying Party ) to the security token
service.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image47.png"><img alt="image" border="0" height="231" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb46.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image72.png"><img alt="image" border="0" height="234" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb71.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
14 <span style="color: red;">IMPORTANT</span> – Click View Log File<br />
15 Scroll to the end, and Copy the URL from the bottom of the file.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image73.png"><img alt="image" border="0" height="44" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb72.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a>-
This will be used in the next configuration. Note that this is
different to the URL used in step 4 above, as it represents the internal
URL. Subtle but vital (and the cause of frustration the first 10 times
we tried this).<br />
16 Click <strong>Finish</strong>.<br />
17 Validate that you can browse to the URL above. If you cannot view
this in a browser, then have a look again at your permissions on the
certificate in relation to the account on the application pool in IIS
for CRM. Read above: <strong>Claims-based authentication configuration CRM 2011server.</strong><br />
18. Once you can browse this URL, you are done here.<br />
<br />
<h2>
<strong>Claims-based authentication configuration AD FS 2.0server</strong></h2>
After completion of the previous step, the next step we need AD FS
2.0 to add and configure the statement provider trust ( claims Provider
trusts ) and the relying party trust ( Relying Party trusts ).<br />
<h4>
<strong>Configure </strong><strong>claims provider trusts</strong></h4>
You need to add a claims rule come from Active Directory to obtain
user ‘s UPN (user principal name) and then as a UPN delivered to MS CRM .
Follow these steps to configure the AD FS 2.0 to UPN LDAP attribute as a
claim is sent to the relying party ( Relying Party ):<br />
1 installed in the AD FS 2.0 on the server , open AD FS 2.0 Management.<br />
2 In the <strong>Navigation Pane</strong> , expand the <strong>Trust Relationships</strong> , and then click the <strong>Claims Provider Trusts</strong>.<br />
3 In the <strong>Claims Provider Trusts </strong><strong>under</strong> , right-click <strong>Active Directory</strong> , and then click <strong>Edit Claims Rules</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image49.png"><img alt="image" border="0" height="93" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb48.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
4 in the Rules Editor , click <strong>Add Rule.</strong><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image50.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb49.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="228" /></a><br />
5. In <strong>Claim rule template</strong> list , select the <strong>Send LDAP Attributes as Claims</strong> template ,and then click <strong>Next</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image51.png"><img alt="image" border="0" height="196" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb50.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
6 Create the following rule:<br />
<ul>
<li>Claim rule name: <em>UPN Claim Rule</em> ( or other descriptive name )</li>
</ul>
· Add the following mapping:<br />
<ul>
<li>Attribute Store: <strong>Active Directory</strong></li>
<li>LDAP Attribute: <strong>User Principal Name</strong></li>
<li>Outgoing Claim Type: <strong>UPN</strong> <a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image52.png"><img alt="image" border="0" height="193" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb51.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a></li>
</ul>
7 Click <strong>Finish</strong> , then click <strong>OK</strong> close the Rules Editor.<br />
<br />
<h4>
<strong>Configuration </strong><strong>relying party trusts</strong></h4>
In the open claims-based authentication, you must ensure CRM 2011
server configured as a relying party to use from the AD FS 2.0 statement
to internal access claims certification.<br />
1 Open AD FS 2.0 Management.<br />
2 In the <strong>Actions</strong> menu, click <strong>Add Relying Party Trust</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image53.png"><img alt="image" border="0" height="124" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb52.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
3 In the <strong>Add Relying Party Trust Wizard</strong> , click <strong>Start</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image54.png"><img alt="image" border="0" height="196" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb53.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
4 In the <strong>Select Data Source</strong> page , click <strong>Import Data about the Relying Party Online or published on a local Network</strong> , enter the positioning federation metadata.xml file URL.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image74.png"><img alt="image" border="0" height="197" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb73.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Federation metadata is set Claims when created. Use <strong>Claims-Based </strong><strong>Authentication Configuration Wizard. </strong>The URL used here is <span style="color: red;">IMPORTANT</span>
– Read point 14 in the above section. It is the URL retrieved from the
VIEW LOG FILE That we did when from configuration of Claims Based
Authentication: In this case<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image75.png"><img alt="image" border="0" height="30" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb74.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<a href="https://internalcrm.interactivewebs.com:444/FederationMetadata/2007-06/FederationMetadata.xml" title="https://internalcrm.interactivewebs.com:444/FederationMetadata/2007-06/FederationMetadata.xml">https://internalcrm.interactivewebs.com:444/FederationMetadata/2007-06/FederationMetadata.xml</a><br />
<span style="color: red;">Note:</span> Ensure that no certificate-related warnings appear when hitting the URL.<br />
5 Click <strong>Next</strong> .<br />
6 In the <strong>Specify Display Name</strong> page , enter a display name, such as <em>CRM Claims Relying Party</em> , and then click <strong>Next.</strong><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image56.png"><img alt="image" border="0" height="196" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb55.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
7 In the <strong>Choose Issuance Authorization Rules</strong> page , choose <strong>Permit All users to access this Relying Party</strong> , and then click <strong>Next.</strong><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image57.png"><img alt="image" border="0" height="197" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb56.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
8 In the <strong>Ready to Add Trust</strong> page , click <strong>Next</strong> , then click <strong>Close</strong> .<br />
9. When the Rule Editor appears , click <strong>Add Rule</strong> . Otherwise , the <strong>Relying Party Trusts </strong>list , right-click you create a relying party objects, click the <strong>Edit Claims Rules</strong> , and then click <strong>Add Rule.</strong><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image58.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb57.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="218" /></a><br />
10. In <strong>Claim rule template</strong> list , select the <strong>Pass Through or Filter an Incoming Claim </strong>template, and then click <strong>Next.</strong><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image59.png"><img alt="image" border="0" height="196" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb58.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
11 create the following rule:<br />
· Claim rule name: <em>Pass Through UPN</em> ( or other descriptive name )<br />
· Add the following mapping:<br />
<ul>
<li>Incoming claim type: <strong>UPN</strong></li>
<li><strong>Pass through All claim values</strong></li>
</ul>
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image114.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb113.png" style="background-image: none; border: 0px currentcolor; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="233" /></a><br />
12 Click <strong>Finish</strong> .<br />
13 In the <strong>Rule</strong> Editor , click <strong>Add Rule</strong> , in <strong>Claim rule template</strong> list , select the <strong>Pass Through or Filter an Incoming Claim</strong> template , and then click <strong>Next</strong> :<br />
· Claim rule name: Pass Through Primary SID ( or other descriptive name )<br />
· Add the following mapping:<br />
<ul>
<li> Incoming claim type: Primary SID</li>
<li> Pass through All claim values</li>
</ul>
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image61.png"><img alt="image" border="0" height="196" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb60.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
14 Click <strong>Finish</strong> .<br />
15 In the <strong>Rule</strong> Editor , click <strong>Add Rule</strong><br />
16. In <strong>Claim rule template</strong> list , select the <strong>Transform an Incoming Claim</strong> template , and then click <strong>Next.</strong><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image62.png"><img alt="image" border="0" height="197" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb61.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
17 create the following rule:<br />
· Claim rule name: <em>Transform Windows Account Name to Name</em> ( or other descriptive name )<br />
<ul>
<li>Incoming claim type: <strong>Windows account name</strong></li>
<li>Outgoing claim type: <strong>Name</strong></li>
<li><strong>Pass through All claim values</strong></li>
</ul>
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image63.png"><img alt="image" border="0" height="197" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb62.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
18 Click <strong>Finish</strong> , to create a good three rule later , click <strong>OK</strong> close the Rule Editor<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image64.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb63.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="227" /></a><br />
<br />
<br />
<h4>
<strong>Test claims-based authentication within the access</strong></h4>
You should now be able to use the claims certified to the internal access CRM 2011 a<br />
1 Open the Deployment Manager.<br />
2 Expand the <strong>Deployment Manager</strong> node , and then click on <strong>Organizations</strong> .<br />
3 Right-click your organization , and then click <strong>Browse</strong> . so you can open the CRM web page of ( for example: <a href="https://internalcrm.contoso.com:444/">https://internalcrm.contoso.com:444</a> ).<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image65.png"><img alt="image" border="0" height="133" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb64.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<h4>
Trouble Shooting</h4>
If the CRM web page can not be displayed, then run the following iisreset and then try again.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image66.png"><img alt="image" border="0" height="75" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb65.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
If the CRM web page still does not show, then you may need to setup
AD FS 2.0 server setup a SPN (Service Principal Name) . Re-run the
Claims-Based Authentication Wizard, and then browse to the <strong>Specify the security token service</strong> page, note the AD FS 2.0 server in the Federation metadata URL in the name. (In this case sts1.interactivewebs.com )<br />
<a href="http://blogs.msdn.com/b/crm/archive/2009/08/06/configuring-service-principal-names.aspx">http://blogs.msdn.com/b/crm/archive/2009/08/06/configuring-service-principal-names.aspx</a><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image67.png"><img alt="image" border="0" height="72" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb66.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
1 Open a command line tool .<br />
2 Enter the following command : ( application, in your own environment, substitute the name of the name of the command line )<br />
c: \> <em>setspn -a http/sts1.interactivewebs.com fserver4\VSERVER08$</em><br />
<em>fserver4\VSERVER08 = the domain and machine name of the server.</em><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image76.png"><img alt="image" border="0" height="38" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb75.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
c: \> <em>iisreset</em><br />
3 and then re-access the Microsoft Dynamics CRM Server 2011 site, so
you should be able to successfully access to the CRM 2011 Web page.<br />
<a href="http://technet.microsoft.com/en-us/library/gg188614.aspx">http://technet.microsoft.com/en-us/library/gg188614.aspx</a><br />
If you receive ADFS – sts1 errors.<br />
There was a problem accessing the site. Try to browse to the site again.<br />
If the problem persists, contact the administrator of this site and provide the reference number to identify the problem.<br />
Reference number: xxx<br />
And or if you look in your log files under ADFS 2.0 You will see errors like this.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image77.png"><img alt="image" border="0" height="184" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb76.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
In our case, this was because we used the external Metadata URL and
not the Internal URL that we should have copied from the “View Log File”
When configuring the Claims Based Authentication. Step 14 in the
section above.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image78.png"><img alt="image" border="0" height="236" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb77.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image79.png"><img alt="image" border="0" height="19" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb78.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
Note the difference between this:<br />
<a href="https://internalcrm.interactivewebs.com:444/FederationMetadata/2007-06/FederationMetadata.xml" title="https://internalcrm.interactivewebs.com:444/FederationMetadata/2007-06/FederationMetadata.xml">https://internalcrm.interactivewebs.com:444/FederationMetadata/2007-06/FederationMetadata.xml</a><br />
and the original meta data check we did with:<br />
<a href="https://sts1.interactivewebs.com/federationmetadata/2007-06/federationmetadata.xml" title="https://sts1.interactivewebs.com/federationmetadata/2007-06/federationmetadata.xml">https://sts1.interactivewebs.com/federationmetadata/2007-06/federationmetadata.xml</a><br />
We incorrectly figured it would be pulling the same XML data. It does NOT!<br />
<br />
<h2>
<strong>Configuration </strong><strong>Claim-based </strong><strong>authentication </strong><strong>-</strong><strong>external access</strong><strong></strong></h2>
Open to the CRM 2011 Data Claims-based authentication of external access, you need to do the following steps:<br />
1 complete contents of the previous section: Configuring Claim-based authentication- internal access.<br />
2 for the IFD configuration CRM 2011 server.<br />
3 for the IFD configuration AD FS 2.0 server.<br />
4 Test claims-based authentication external access.<br />
<h4>
<strong>The IFD configuration CRM 2011 server</strong></h4>
<strong></strong>When opening Claims certified internal access, you can open by IFD external claims visited. The following describes using the <strong>IFD </strong><strong>Configuration Wizard</strong> to configure, if you want to learn how to use PowerShell to be configured, refer to the English original.<br />
1 Open the Deployment Manager.<br />
2 In the tree structure , right-click <strong>Microsoft Dynamics CRM</strong> , and then click <strong>Configure Internet-Facing Deployment</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image80.png"><img alt="image" border="0" height="183" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb79.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
3 Click <strong>Next</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image81.png"><img alt="image" border="0" height="236" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb80.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
4 Fill in the correct domain information for the Web Application,
Org, and Discovery Web services. Remembering here that in our case:
*.interactivewebs.com was the name of the wildcard certificate used, and
that PORT 444 was the port we configured for the CRM Web Instance in
the bindings for IIS.<br />
Thus we use:<br />
<ul>
<li>Web Application Server Domain: <strong>interactivewebs.com:444</strong></li>
<li>Organization Web Service Domain: <strong>interactivewebs.com:444</strong></li>
<li>Web Service Discovery Domain: <strong>dev.interactivewebs.com:444</strong> <a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image82.png"><img alt="image" border="0" height="235" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb81.png" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a></li>
</ul>
<strong>Note – </strong>Enter the domain name, rather than the server name .<br />
<ul>
<li>If the CRM installed on the same server or servers are installed in
the same domain, then the Web Application Server Domain and Organization
Web Service Domain should be the same .</li>
<li>Web Service Discovery Domain must be a Web Application Server Domain
as a subdomain like the “dev.” that we setup in DNS earlier.</li>
<li>domain name must be on the SSL certificate name</li>
</ul>
Domain examples :<br />
<ul>
<li>Web Application Server Domain: <strong>contoso.com: 444</strong></li>
<li>Organization Web Service Domain: <strong>contoso.com: 444</strong></li>
<li>Web Service Discovery Domain: <strong>dev.contoso.com: 444</strong></li>
</ul>
<em>For more information on the website, please refer to Install Microsoft Dynamics CRM Server 2011 on multiple computers</em><a href="https://www.blogger.com/null" name="H_57269"></a><em>( </em><a href="http://go.microsoft.com/fwlink/?LinkID=199532"><em>http://go.microsoft.com/fwlink/?LinkID=199532</em></a><em> )</em><br />
5 In the <strong>Enter the external domain where your Internet-facing servers are located</strong> input box , enter for your internet to CRM 2011 server located outside the domain of information, and then click <strong>Next</strong> .<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image83.png"><img alt="image" border="0" height="235" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb82.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
You must specify the domain specified in the previous step Web
Application Server Domain sub-domains . default , will be “auth.” added
to the Web Application Server Domain before.<br />
Domain examples :<br />
<ul>
<li>External Domain: <strong>auth.contoso.com: 444</strong></li>
</ul>
6 In the <strong>System Checks</strong> page , if there is no problem, click <strong>Next</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image84.png"><img alt="image" border="0" height="235" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb83.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
7 In <strong>Review your selections and then click Apply</strong> page , confirm your input , and then click <strong>Apply</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image85.png"><img alt="image" border="0" height="233" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb84.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
8 Click <strong>Finish</strong> .<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image86.png"><img alt="image" border="0" height="233" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb85.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
9. Open a command line tool, run: <em><strong>iisreset</strong></em><br />
<br />
<h4>
<strong>The IFD configuration AD FS 2.0 server</strong></h4>
To open CRM 2011 on the IFD , you need to add AD FS 2.0 server for
the IFD to create a relying party endpoints. Follow these steps:<br />
1 open AD FS 2.0 Management .<br />
2 In the <strong>Actions</strong> menu, click <strong>Add Relying Party Trust</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image87.png"><img alt="image" border="0" height="63" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb86.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
3 In the <strong>Add Relying Party Trust Wizard</strong> , click <strong>Start</strong> .<br />
4 In the <strong>Select Data Source</strong> page , click <strong>Import Data about the Relying Party Online or published on a local Network</strong> , enter the positioning federation metadata.xml file URL.<br />
Note – This is almost the same URL as we used previously, but has the
.auth sub domain that we used in point 4 above. For use the Federation
metadata is configured IFD when created. In this case <a href="https://auth.interactivewebs.com:444/FederationMetadata/2007-06/FederationMetadata.xml">https://auth.interactivewebs.com:444/FederationMetadata/2007-06/FederationMetadata.xml</a> .<br />
Check in your browser the URL, to ensure that no certificate-related warnings appear.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image88.png"><img alt="image" border="0" height="194" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb87.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
5 Click <strong>Next</strong>.<br />
6 In the <strong>Specify Display Name</strong> page , enter the display name , such as <em>CRM IFD Relying Party</em> , and then click <strong>Next</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image89.png"><img alt="image" border="0" height="198" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb88.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
7 In the <strong>Choose Issuance Authorization Rules</strong> page , select the <strong>Permit all users to access this relying party</strong> options , and then click <strong>Next</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image90.png"><img alt="image" border="0" height="197" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb89.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
8 In the <strong>Ready to Add Trust</strong> page , click <strong>Next</strong> , then click <strong>Close</strong> .<br />
9. If the Rule Editor appears , click Add Rule. Otherwise , the
Relying Party Trusts list ,right-click you create a relying party
objects, click the Edit Claims Rules, and then click <strong>Add Rule</strong>.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image91.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb90.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="224" /></a><br />
10. In Claim rule template list , select the <strong>Pass Through or Filter an Incoming Claim template</strong>, and then click Next.<br />
<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image92.png"><img alt="image" border="0" height="195" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb91.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a><br />
11 create the following rule:<br />
· Claim rule name: <em>Pass Through UPN</em> ( or other descriptive name )<br />
· Add the following mapping:<br />
<ul>
<li> Incoming claim type: <strong>UPN</strong></li>
<li> <strong>Pass through All claim values</strong> <a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image93.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb92.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="233" /></a></li>
</ul>
12 Click <strong>Finish</strong> .<br />
13 In the <strong>Rule </strong><strong>Editor</strong> , click <strong>Add Rule</strong> , in <strong>Claim rule template</strong> list , select the <strong>Pass Through or Filter an Incoming Claim</strong> template , and then click <strong>Next</strong> :<br />
· Claim rule name: <em>Pass Through Primary SID</em> ( or other descriptive name )<br />
· Add the following mapping:<br />
<ul>
<li> Incoming claim type: <strong>Primary SID</strong></li>
<li> <strong>Pass through All claim values</strong> <a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image94.png"><img alt="image" border="0" height="244" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb93.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="233" /></a></li>
</ul>
14 Click <strong>Finish</strong> .<br />
15 in the <strong>Rules </strong><strong>Editor</strong> , click <strong>Add Rule</strong> ,<br />
16. In <strong>Claim rule template</strong> list , select the <strong>Transform an Incoming Claim</strong> template , and then click <strong>Next</strong> .<br />
17 create the following rule:<br />
· Claim rule name: <em>Transform Windows Account Name to Name</em> ( or other descriptive name )<br />
<ul>
<li> Incoming claim type: <strong>Windows account name</strong></li>
<li> Outgoing claim type: <strong>Name</strong></li>
<li> <strong>Pass through All claim values</strong></li>
</ul>
<br />
18 Click <strong>Finish</strong> , you have created three rule later , cl<a href="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image95.png"><img alt="image" border="0" height="195" src="http://www.interactivewebs.com/blog/wp-content/uploads/2011/07/image_thumb94.png" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></a>ick <strong>OK</strong> close the Rule Editor .<br />
<strong>Test claims-based authentication to access external</strong><br />
Now, you should use the claims certified external access CRM 2011 a.
In IE the browser CRM 2011 external address (for example:
https://org.contoso.com:444 ), you will see the following pages:<br />
<img alt="" border="0" src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-78-55/2555.PIC9.png" /><br />
Enter the user name password, log CRM 2011.<br />
<br />
<h4>
Final Notes</h4>
<br />Like anything Microsoft, this was not easy. It took us over 10
attempts drawing on over a dozen resources to get this worked out. For
us, the main tripping points related the the meta data URL’s used in
configuring the endpoints. Our fault, but it also appears to be a common
error to other administrators on the net.<br />
To Microsoft – you documentation sucks badly! If I never read another White Paper it will be too soon!Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-61546659423792404622014-04-01T19:13:00.002-07:002014-04-01T19:13:30.370-07:00MS CRM 2011 Plugin Sandbox Mode <br />
Sandbox Mode: <br />
<ol>
<li>It runs as a separate service, so it has got its own space to execute the process </li>
<li>It has reduced functionality and a Partial Trust process<br /> </li>
<li>On-premise CRM will allow you to run plugins in or out of sandbox mode (none), where as Online (Microsoft's hosted solution) will only run in sandbox mode<br /> </li>
<li>Access to the file system, system event log, certain network protocols, registry, Active Directory are prevented in the sandbox. However, sandbox plug-ins do have access to external endpoints like the Windows Azure cloud</li>
<li>Using any of the following cause a security exception (not an exhaustive list):</li>
</ol>
<ul>
<li>Attempting to use the AppDomain.CurrentDomain.AssemblyResolve event</li>
<li>System.IO.Path.GetTempPath() [System.Security.Permissions.EnvironmentPermissionException]</li>
<li>Any filesystem access code [System.Security.Permissions.FileIOPermissionException]</li>
<li>Attempting to use the EventLog [System.Diagnostics.EventLogPermissionException]</li>
<li>Attempting to use IsolatedStorage [System.Security.Permissions.IsolatedStoragePermissionException]</li>
<li>Any references to Thread.CurrentThread caused a security failure. </li>
</ul>
<div style="padding-left: 20px;">
<b> </b></div>
<div style="padding-left: 20px;">
<b> </b></div>
<div style="padding-left: 20px;">
<b>Sandbox (recommended option)</b><br /><table cellpadding="3" cellspacing="0" class="conspros" style="width: 100%;"><tbody>
<tr style="background-color: #f58e5c;"><td><b>pros</b></td><td><b>cons</b></td></tr>
<tr><td>Supported by all types of CRM deployment</td><td rowspan="4">You haven’t got access to the file system, system event log, certain network protocols, registry</td></tr>
<tr><td>Supports run-time monitoring and statistics reporting</td></tr>
<tr><td>Secure approach</td></tr>
<tr><td>MS CRM monitors sandbox worker process and handles situations of CPU/memory/handle limits exceeding.</td></tr>
</tbody></table>
<br /><b>None</b><br /><table cellpadding="3" cellspacing="0" class="conspros" style="width: 100%;"><tbody>
<tr style="background-color: #f58e5c;"><td><b>pros</b></td><td><b>cons</b></td></tr>
<tr><td rowspan="2">All power of .NET framework is in your hands</td><td>Not supported by CRM online</td></tr>
<tr><td>Doesn’t support monitoring and statistic</td></tr>
</tbody></table>
</div>
<br /><br />
<br />
http://msdn.microsoft.com/en-us/library/gg334752.aspx <br />
<br />
<br />
<br />
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-88217549393523435442014-01-21T19:46:00.000-08:002014-01-21T19:46:19.070-08:00Decision Making<h1 align="center">
</h1>
<div align="center">
<br /></div>
<div align="center">
<em>"When you arrive at a fork in the road, take it!</em>"<br />
Yogi Berra </div>
<div align="left">
</div>
<div align="left">
Decision making skills can be very important in a
careers context: Which career should I choose? Which university should I
go to? Which course should I
study? Of course they are also valuable in many other contexts in
life.</div>
<h2 align="left">
The key steps in decision making are:</h2>
<h3 align="left">
<strong>1. Clarify the nature of the problem before deciding action.</strong><br />
</h3>
<div align="left">
What is the purpose of the decision?<br />
What is the expected outcome?<br />
<strong>What are the key priorities:</strong> time, money, quality?
Will a quick, cheap and cheerful solution do or do you need to invest
time and cash to get things absolutely right?</div>
<h3>
<strong>2. Collect and summarise the data systematically.</strong><br />
</h3>
Decisions can't be made in a vacuum! <strong>Gather, collate, classify and organise the information you need</strong>
to make a decision. You need to analyse and evaluate all the important
factors in making the decision. Analyse the various factors involved in
the problem and identify the key ones.<br />
<strong>Highlight any critical factors</strong> upon which the success on the decision will hinge.<br />
Sound out the views and opinions of others: they may see something you have missed.<br />
<h3>
<strong>3. Use creativity/initiative in the generation of alternative solutions to the problem.<br />
</strong></h3>
<strong>Produce a list of all the courses of action you can think of </strong>without
trying to narrow these down. At this stage just produce a list of
possible courses of action without trying to evaluate these. <strong>Brainstorming </strong>may help here (see below)<strong><br />
</strong>Think outside the box: don't just look at the obvious and tried and tested options. Don't be afraid to challenge the status quo.<br /><br />
<br />
<table bgcolor="#FFFFCC" style="width: 100%px;">
<tbody>
<tr>
<td><h4>
How to brainstorm</h4>
<ul>
<li><strong>The purpose of brainstorming is to produce as many possible options as possible without evaluating them. </strong></li>
<li>Get a blank sheet of paper and write down any idea or possible solution which may help<strong>. </strong></li>
<li><strong>Don't censor your ideas. </strong>Write down everything, no matter how silly or insignificant to keep the flow going as once idea might lead to another. </li>
<li><strong>Only once all the ideas have dried up, </strong>cross out or adapt all the weaker ideas: this should still leave you with a number of possible solutions.</li>
<li><strong>Brainstorming can be done in a group</strong>, in which case no comments should be made about the decisions proposed or group members put down for proposing unusual ideas.</li>
</ul>
</td>
</tr>
</tbody></table>
<h3>
<strong>4. Produce
a SHORT list of the best options. </strong> </h3>
<strong>Remove any obviously poorer choices. </strong>Don't have too many options in your final list or it will be too confusing.<br />
Differentiate between practical and impractical solutions.
<h3>
<strong>5. Make your decision<br />
</strong></h3>
For each of your shortlist of options consider its advantages and disadvantages<strong>. </strong>Try to recognise any inconsistencies in your reasoning and question any assumptions you have made.<strong><br />
Evaluate each option against the key factors</strong> to consider the combined effect of all the factors. <strong>Weight each factor in terms of importance </strong>paying particular attention to any critical factors. See the <span style="color: black;"><a href="http://www.kent.ac.uk/careers/sk/decisionmaking.htm#DECISION"><strong>decision matrix</strong></a> below to help you do this.<br />
Sometimes you may get so immersed that you may not be able to see the
wood for the trees: if this happens sleep on it and postpone the
decision until the next day. This may give you a fresh perspective.</span><br />
<h4>
Using a <a href="https://www.blogger.com/null" id="DECISION" name="DECISION"></a> DECISION MATRIX to help you to decide between alternatives:</h4>
Make a short list of your key options and look at the positives and
negatives for each item. Below is a very simple example. You could
include many more factors.
<table bgcolor="#FFFFCC" border="1" style="width: 100%px;">
<tbody>
<tr>
<td colspan="5"><h4>
<strong>Which career would be most appropriate for me: teacher, youth worker or sales executive?</strong></h4>
</td>
</tr>
<tr>
<td><strong>Factors important to me in my career choice</strong></td>
<td><div align="center">
<strong>Factor <br />
Weighting</strong></div>
</td>
<td><div align="center">
<strong>Teacher</strong></div>
</td>
<td><div align="center">
<strong>Youth <br />
Worker</strong></div>
</td>
<td><div align="center">
<strong>Sales <br />
Executive</strong></div>
</td>
</tr>
<tr>
<td>Job security</td>
<td><div align="center">
high (x 3)</div>
</td>
<td><div align="center">
9 (x3=27)</div>
</td>
<td><div align="center">
7 (x3=21)</div>
</td>
<td><div align="center">
4 (x3=12)</div>
</td>
</tr>
<tr>
<td>Informal working environment</td>
<td><div align="center">
medium (x2)</div>
</td>
<td><div align="center">
4 (x2=8)</div>
</td>
<td><div align="center">
9 (x2=18)</div>
</td>
<td><div align="center">
3 (x2=6)</div>
</td>
</tr>
<tr>
<td>9 to 5 work</td>
<td><div align="center">
low (x1)</div>
</td>
<td><div align="center">
6 (x1=6)</div>
</td>
<td valign="top"><div align="center">
1 (x1=1)</div>
</td>
<td valign="top"><div align="center">
5 (x1=5)</div>
</td>
</tr>
<tr>
<td>Good salary</td>
<td><div align="center">
low (x1)</div>
</td>
<td><div align="center">
4 (x1=4)</div>
</td>
<td valign="top"><div align="center">
3 (x1=3)</div>
</td>
<td valign="top"><div align="center">
8 (x1=8)</div>
</td>
</tr>
<tr>
<td>Job satisfaction</td>
<td><div align="center">
low (x1)</div>
</td>
<td><div align="center">
6 (x1=6)</div>
</td>
<td valign="top"><div align="center">
7 (x1=7)</div>
</td>
<td valign="top"><div align="center">
5 (x1=5)</div>
</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td> </td>
<td><div align="center">
<strong>51</strong></div>
</td>
<td valign="top"><div align="center">
<strong>50</strong></div>
</td>
<td valign="top"><div align="center">
<strong>36</strong></div>
</td>
</tr>
</tbody></table>
This suggests that for this particular person teaching and youth work
would both be good alternatives, but a career in sales probably
wouldn't suit them. Of course intuition (gut reaction) can also play a
major part in making decisions, but a decision matrix may at least give
you an idea of which is the most logical choice.<br />
<table align="right" bgcolor="#FFFFCC" cellpadding="8" style="width: 45%px;">
<tbody>
<tr>
<td><em>Stay committed to your decisions, but stay flexible in your approach.</em> Tom Robbins<br />
<em>In a moment of decision, the worst thing you can do is nothing. </em>Theodore Roosevelt<br />
<em>A peacefulness follows any decision, even the wrong one. </em>Rita Mae Brown<br />
<em>When you have to make a choice and don't make it, that is in itself a choice.</em> William James<br />
<em>Some persons are very decisive when it comes to avoiding decisions.</em> Brendan Francis<br />
<em>You've got a lot of choices. If getting out of bed in the
morning is a chore and you're not smiling on a regular basis, try
another choice.</em> Steven Woodhull<br />
<em>Decision is a sharp knife that cuts clean and straight;
indecision, a dull one that hacks and tears and leaves ragged edges
behind it.</em> Gordon Graham<br />
<em>Whether you decide you can or you can't, you're right!</em><br />
<em>Good decisions come from experience, and experience comes from bad decisions. </em><em><br />
</em></td>
</tr>
</tbody></table>
<strong><br />
</strong><br />
<h3>
<strong>6. Implement your decision</strong></h3>
<strong> See our page on <a href="http://www.kent.ac.uk/careers/sk/skillsactionplanning.htm"><strong>action planning</strong></a></strong><br />
Try to <strong>have a backup (contingency) plan</strong> in case your first option doesn't work out.<br />
<br />
<h4>
<strong>Learn to argue your solution if there is opposition from others</strong></h4>
If it is a group decision, consider the implications for the other members of the team.<br />
Communicate your ideas to the other team members, <strong>explain your reasoning and make sure they understand the logic behind it</strong> and get their commitment to carry it out.<br />
See our page on <span style="color: black;"><a href="http://www.kent.ac.uk/careers/sk/teamwork.htm"><strong>effective group work</strong></a></span><br />
<br />
<br />
<h3>
<strong>7. Evaluate how well things went</strong><br />
</h3>
Learn from the experience especially if your solution does not prove successful!<br />
<h2>
SWOT <a href="https://www.blogger.com/null" id="SWOT" name="SWOT"></a>Analysis<em><strong><br />
</strong></em></h2>
A SWOT analysis is a subjective<strong> method used to evaluate the S</strong>TRENGTHS<strong>, W</strong>EAKNESSES<strong>, O</strong>PPORTUNITIES<strong>, </strong>and<strong> T</strong>HREATS<strong> involved in trying to attain an objective</strong>.
It involves specifying the objective and identifying the internal and
external factors that are favourable and unfavourable to achieving the
objective. It can be used as a business tool or on a personal level
where it can help you take advantage of your
talents, abilities and opportunities. It can help to <strong>clarify and summarise the key issues and opportunities </strong>facing you and thereby to <strong>set objectives and develop new strategies</strong>. It should help you to to <strong>maximise strengths</strong> and <strong>minimise weaknesses</strong> in order to take advantage of opportunities and reduce threats.<br />
<br />
<br />
<h3>
SWOT Analysis for an unemployed graduate looking to gain employment</h3>
<table bgcolor="#FFFFCC" border="2" style="width: 100%px;">
<tbody>
<tr>
<td bgcolor="#FFFFFF" valign="middle"> </td>
<td bgcolor="#FFFF99" valign="top"><div align="center">
<h4>
<strong>Helpful</strong></h4>
</div>
</td>
<td bgcolor="#FFFF99" valign="top"><div align="center">
<h4>
Harmful</h4>
</div>
</td>
</tr>
<tr>
<td bgcolor="#FFFF99" valign="middle" width="12%"><h3>
INTERNAL<br />
FACTORS</h3>
</td>
<td valign="top" width="42%"><h3>
<strong>Strengths<br />
</strong></h3>
<strong>Attributes that help you to achieve your objective.</strong>
<ul>
<li>What <strong>skills</strong> do you have that others don't have? Our <span style="color: black;"><a href="http://www.kent.ac.uk/careers/ask/skillsinventory.html"><strong>Skills Inventory</strong></a> with help here. </span></li>
<li>What skills have you gained in your <span style="color: black;"><a href="http://www.kent.ac.uk/careers/sk/skillstest.html"><strong>degree</strong></a>?</span></li>
<li>Have you any <span style="color: black;"><a href="http://www.kent.ac.uk/careers/sk/CJ.htm"><strong>contacts</strong></a> who may be able to help you?</span></li>
<li>What personal<strong> resources</strong> do you have access to? </li>
<li>Is <strong>where you live</strong> an advantage or disadvantage?</li>
<li>What do you do better than most other people? </li>
<li>How can you utilise each strength?</li>
<li>What do other people see as your strengths?<br />
<br />
</li>
<li><em>I have a good degree from a good university</em></li>
<li><em>I have good team working and organising skills</em></li>
<li><em>I have good support from my family, friends & the Careers Service</em></li>
</ul>
</td>
<td valign="top" width="42%"><h3>
<strong>Weaknesses</strong></h3>
<strong>Limitations that are harmful to achieving your objective.</strong>
<ul>
<li>What skills could you improve? </li>
<li>What can you avoid?<br />
<br />
</li>
<li><em>I have no significant employment experience</em></li>
<li><em>My computing skills are weak: take a course to improve this</em></li>
<li><em>Not much money to do things</em>.</li>
<li><em>Have to live at home with my parents: can't afford to move away because of lack of money.</em></li>
</ul>
</td>
</tr>
<tr>
<td bgcolor="#FFFF99" valign="middle" width="12%"><h3>
EXTERNAL <br />
FACTORS</h3>
</td>
<td valign="top" width="42%"><h3>
<strong>Opportunities</strong></h3>
<strong>Favourable situations that help you achieve your objective.</strong>
<ul>
<li>Where opportunities are available to you? </li>
<li>How can you exploit these?</li>
<li>What opportunities do your strengths give you?</li>
<li>What trends might help you?<br />
<br />
</li>
<li><em>I have lots of free time to pursue things I haven't had time for before</em></li>
<li><em>I can do voluntary work & learn new skills to enhance my CV</em></li>
<li><em>It's a good chance to reevaluate where I'm heading in life</em></li>
</ul>
</td>
<td valign="top" width="42%"><h3>
<strong>Threats</strong></h3>
<strong>External conditions which could create problems. </strong>
<ul>
<li>What obstacles do you face? </li>
<li>How can you lessen these?</li>
<li>Could any of your weaknesses create problems? <br />
<br />
</li>
<li><em>If I stay unemployed for too long it could be difficult to get a job</em></li>
<li><em>Tough job market at present</em><br />
</li>
</ul>
</td>
</tr>
</tbody></table>
<br />
Having said all the above, you also need to take into account your
subconscious - your gut reaction will often make better decisions than
any amount of analysis:<br />
<div align="center">
<em>We live in a world that assumes that the quality
of a decision is directly related to the time and effort that went into
making it...We believe that we are always better off gathering as much
information as possible an depending as much time as possible in
deliberation. We really only trust conscious decision making. But there
are moments, particularly in times of stress, when haste does not make
waste, when our snap judgments and first impressions can offer a much
better means of making sense of the world. The first task of Blink is to
convince you of a simple fact: decisions made very quickly can be every
bit as good as decisions made cautiously and deliberately.</em><br />
Malcolm Gladwell from his book <em>"Blink"</em></div>
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-31336088332596548132014-01-21T19:27:00.000-08:002014-01-21T19:27:09.438-08:00How to reduce the costs of IT support<h1 class="omc-post-heading-standard">
</h1>
<em>Cutting costs is an all too familiar requirement, but the
article argues that you can do so without reducing staff
numbers or sacrificing quality.</em><span id="more-3188"></span><br />
<br />
The question of reducing support costs is a seriously touchy one with
big implications. Merely to consider it puts jobs at risk, which can
damage morale and department stability. Questions arise about the
effect on service quality and so the wider impact on the corporation as a
whole. In all, the entire cost reduction issue is a bed of hot coals
covered in tripwires. Nevertheless, in the present climate, it is one
that most managers – especially, one might argue, in the public sector –
must at least be seen to have addressed, even if it is only to affirm
that the department is lean, slick, running at maximum possible
efficiency and meeting all business IT support needs for reasonable
cost.<br />
<strong><span style="color: purple;">Accounting Value</span></strong><br />
The pressure on costs is purely financial. It is not about service
but value for money. A core truth is that most IT support costs are
already justified, or your department wouldn’t exist. All we have to
find out is ‘by how much’. Therefore, the cost reduction programme must
have two outputs. The identification of excess expenditure is one, but
that itself is only an arithmetic product of the main output, which is
the accounting justification of the necessary costs.<br />
Note I said ‘accounting’ justification – namely, what actually is the
delivered monetary value of the services provided by IT support. Most
IT departments don’t know that number, or where to look for it. This is
why they often have difficulty convincing those who think only about
money to invest in IT support. If you want to convince a bean-counter,
talk about beans, not ‘service benefits’.<br />
Your next decision is whether you wish to increase, maintain or
decrease service quality. It’s OK to think about decreasing it by the
way – once the target level of quality has been identified, any residual
over-delivery is a waste that legitimately can be eliminated.<br />
<strong><span style="color: purple;">Two choices</span></strong><br />
Ultimately, there are really only two ways of reducing the cost of IT
support. One is to push the charge onto another cost centre and the
other is to reduce resource expenditure. For the first of these, the
other cost centre may be internal, for instance where ‘user
self-support’ pushes the support cost back onto the users. The
financial result is that some of the costs of IT support leave the IT
budget and land instead in the budget of other departments.<br />
However, unless this move is accompanied by a deliberate strategy for
also reducing resource expenditure, then rather than change the costs
of IT support, it simply transfers them elsewhere. Ultimately, the
organisation as a whole still bears the costs.<br />
In addition, this mere transferral carries with it considerable
risks. Because the costs are now distributed among various centres, the
total is now masked and effectively cannot be measured. Thus it may
rise invisibly and thus uncontrollably. Furthermore, IT support
responsibility has been passed to functions that do not specialise in
this area – so there is a risk to quality. Incidentally, this is why,
in any consideration of support costs, you should also look at all those
private support desks hosted and paid for by users, even if they don’t
report to you. It’s still all support cost, after all.<br />
<strong><span style="color: purple;">Outsourcing</span></strong><br />
Another form of support cost transferral is outsourcing, as an
attempt to force the costs onto another company entirely. In fact, this
is ultimately an internal transfer as well, as the organisation still
has to pay the outsourcer. Furthermore, that external provider now has
an even bigger challenge than you had – namely to produce at least as
good a service as you did, but also make a profit on what you pay him
for doing it. Of course, he can only do that by spending less to
produce the service. So either he must be supremely more efficient than
you were or the service must be reduced in terms of scope and/or
quality.<br />
Outsourcing can also be a false solution overall. One of the main
pitfalls with this option stems from quantifying the support in the
first place. There is a very strong possibility that an inefficient
support service has no accurate measure of the actual amount of support
work to be done. This is because poor support causes users to find
other, more reliable ways of getting IT support, so not all the work
ever reaches the official channel. But when this is outsourced, all
that demand may go to the outsourcing company, and because of the
original statistical inaccuracy, the demand is unexpected. So the
charges go up.<br />
The irony is that the accurate workload and demand measurement
necessary for outsourcing would be the first step in any service
improvement, for cost reduction or any other purpose. Which brings me
to the second way to decrease support costs, namely reducing resource
expenditure. In other words, the work necessary to prepare for
outsourcing, may make outsourcing itself unnecessary.<br />
<strong><span style="color: purple;">First steps</span></strong><br />
When the programme starts, don’t be taken in by software companies
suggesting you buy their product to save money in the long run. That’s
as may be, but at this stage it’s a distraction. Find your procedural
and structural waste first. You can cement it with new tools as
appropriate later.<br />
There is a simple rule of thumb I like to use. To find cost savings
and efficiency improvements, the first place to look, in any
organisation, is in the functions whose activity and output are least
effectively measured. In the first line, unlogged calls is a good place
to start. In the second and third lines, unquantified projects and
query resolution times are rocks that can be interesting to lift.
Across support, activities that produce a recognisable result but are
not formally identified as services, can also look very different under
closer numerical scrutiny.<br />
<strong><span style="color: purple;">Resistance</span></strong><br />
In the search for the smoking gun of waste, you have to do this
looking behind the cupboards, at least to eliminate various suspects
from your enquiries. This can be extremely difficult as the work in
some support sections may not be of the ‘McGregor Theory X’ type and so
cannot easily be quantified. How long and how many people does a
‘project’ take? How do you compare the delivery of an installation with
that of a user training course? But of course that’s just detail.
You’re looking at bigger pictures, so what you need here are patterns
rather than mere units of resource consumption.<br />
One problem I’ve sometimes encountered is resistance to measurement.
This can take numerous forms – rarely is it active defiance, but it can
manifest itself as fear or ignorance. Soldier on – you can’t ignore it
just because it’s difficult. Sooner or later, somebody will probably
whisper the dreaded pejorative ‘Time and Motion’. Of course this is
just a cliché that people often use without fully understanding. It
comes from an industrial environment and an era before knowledge was a
common product, so it’s not universally applicable to IT support. You
may find yourself having to explain this to some of the more fearful of
those potentially affected.<br />
As W E Deming said and I paraphrase, “if you cannot measure it you
cannot manage it”, and by extraction it therefore lies outside your
control and may thus be running up costs that are not necessarily
justified. Any inefficiency is also costing in terms of service quality
to the end users, while perturbing and confusing managers. You have to
get these costs out into the open, even though you may thereby disturb
the comfortable niches of some who have hitherto had no cause to take
into account the cost-justifiability of their function. If you can’t
identify the costs, you can’t justify them.<br />
<strong><span style="color: purple;">Objectivity</span></strong><br />
The fear can often make it extremely difficult to find the
objectivity essential to any such exercise. You may be asking managers
who have never measured their departments to produce statistics by which
their cost value may be judged. Even if they want to help with the
exercise, they may simply not know how, and their objectivity may be
clouded by the apparent or imagined risk to themselves or their
departments. This casts doubt on the accuracy and usefulness of the
answers you may get. For real objectivity, you might have to call in
external assistance from one who has the techniques, expertise and
experience to measure and propose cuts while understanding and
maintaining IT support services, and no political or historical crosses
to bear nor job of his own to protect (who might that be? Give me a ring
and I’ll tell you).<br />
One thing you can be sure of is that in the end, everybody benefits
from a cost-measurement exercise, despite the possibility of heartache
while it’s happening. It’s more gratifying for the staff to work in a
well-honed support service. Where the exercise finds unpleasant truths
like waste and protectionism that serves the self rather than the
organisation, take pleasure in eradicating them, because that is a
success, not a failure. At the end, the users are happier, because the
service is slicker. You are indeed producing the best service you can
for the investment made in it and you can prove it because you now have
two figures – the cost of your department and the value it brings to the
company, and the latter is decidedly and satisfyingly greater than the
former. It’s a relaxing feeling to know that on the bean-counter’s
list, your department’s name has a tick of completion against it.<br />
<br />
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-9955044638742053972013-11-06T09:07:00.000-08:002013-11-06T09:07:41.760-08:00CRM 2011 support multiple browsersMicrosoft Dynamics CRM 2011 Update Rollup 12 or the December 2012
Service Update has introduced additional browser compatibility for
Firefox, Chrome, and Safari. <br /><br />Browser flexibility will apply to
all functions within Microsoft Dynamics CRM for both end users and
administrators alike. The list of devices, operating systems and
specific browser versions is detailed in the table below. <br /><br /><br />
<div class="kb_nowrapper">
<table cellspacing="0" class="table" id="MT2"><tbody>
<tr><td><b>Platform</b></td><td><b>Internet Explorer</b></td><td><b>Firefox</b></td><td><b>Chrome</b></td><td><b>Safari</b></td></tr>
<tr><td>Windows XP</td><td>Version 7* and 8</td><td>Latest Version</td><td>Latest Version</td><td>Not Supported</td></tr>
<tr><td>Windows Vista</td><td>Version 7, 8, and 9</td><td>Latest Version</td><td>Latest Version</td><td>Not Supported</td></tr>
<tr><td>Windows 7</td><td>Version 8, 9, and 10</td><td>Latest Version</td><td>Latest Version</td><td>Not Supported</td></tr>
<tr><td>Windows 8</td><td>Version 10 for the desktop**</td><td>Latest Version</td><td>Latest Version</td><td>Not Supported</td></tr>
<tr><td>Apple OS X 10.7 (Lion)</td><td>Not Supported</td><td>Not Supported</td><td>Not Supported</td><td>Latest Version</td></tr>
<tr><td>Apple OS X 10.8 (Mountain Lion)</td><td>Not Supported</td><td>Not Supported</td><td>Not Supported</td><td>Latest Version</td></tr>
</tbody></table>
</div>
<br />*Internet
Explorer 7 is not supported for Microsoft Dynamics CRM Online. Windows
XP users must use Internet Explorer 8 for Microsoft Dynamics CRM
Online.<br /><br />**Internet Explorer 10 compatibility is limited to the desktop browser and does not extend to the touch-based version.<br /><br />***Windows RT is not currently supported. <br /><br />
<br />
<br />
<br />
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-37027129365683098422013-10-10T10:07:00.000-07:002013-10-10T10:07:04.493-07:00 Why Dynamics CRM Complements SharePoint<a href="http://blog.appliedis.com/wp-content/uploads/2013/09/Dynamics_crm_logo.png"><img alt="" class="alignleft size-thumbnail wp-image-4152" height="150" src="http://blog.appliedis.com/wp-content/uploads/2013/09/Dynamics_crm_logo-150x150.png" title="Dynamics_crm_logo" width="150" /></a>Dynamics CRM 2013 is about to be released and if you have already made a large investment into <a href="http://marketing.appliedis.com/sharepoint-application-platform-service-offerings/" target="_blank">SharePoint as a development platform</a>,
you may be asking yourself why Dynamics CRM matters. After all, you
are already using a wildly successful platform that underpins
collaboration tools, intranets, your ‘corporate’ social media and quite
likely a base of custom applications and tools. Why would you need yet
another platform if SharePoint is capable of handling everything you
throw at it?<div class="entry-content">
<br />
First
off, let’s clear up a misconception that everyone generally has the
first time they hear about Dynamics CRM: it’s not “Dynamics versus
SharePoint,” it’s “Dynamics AND SharePoint.” Dynamics CRM offers some
pretty significant benefits that are not available when using the
SharePoint platform alone. Likewise, SharePoint has capabilities that
Dynamics CRM simply wasn’t designed to even begin to replicate. <strong>The trick is knowing when and how to best leverage the benefits of each tool. </strong>Simply
put, both tools need each other to offer a truly complete platform that
offers you the best of everything: a collaboration tool, an intranet
and content management tool, a repository for unstructured data, an
application platform, and a quick and easy way to rapidly and
efficiently build applications to manage structured data.<span id="more-4145"></span>Let’s look at the benefits of each tool to see how they complement each other:<br />
<a href="http://blog.appliedis.com/wp-content/uploads/2013/09/Screen-Shot-2013-09-27-at-8.40.26-AM.png"><img alt="" class="aligncenter size-full wp-image-4147" height="286" src="http://blog.appliedis.com/wp-content/uploads/2013/09/Screen-Shot-2013-09-27-at-8.40.26-AM.png" title="Screen Shot 2013-09-27 at 8.40.26 AM" width="787" /></a>A
quick summary would boil down to: SharePoint is great at managing
unstructured data; Dynamics CRM is great at managing structured data.
Both systems quickly run into limitations when you try to force either
one to interact with the type of data that they were not designed to
manage. When trying to manage structured data with complex relationships
in SharePoint, you often need to resort to writing custom code and
standing up external (non-SharePoint) databases. While this is still
quicker than writing a completely custom application, the fact is that
you are now engaged in software development and all the risks and costs
that development entails.<br />
Dynamics CRM is not intended to support the constant rapid
provisioning of separate ‘sites’ like SharePoint and in fact, it simply <em>relies</em>
on SharePoint to manage any unstructured data. Knowing the
fundamentally different type of data that each system is meant to
manage, we can establish when and how we would use both together to
provide us with the best combination – a platform which meets our all of
our needs as efficiently as possible.<br />
<strong></strong><br />
<br />
<strong>Common Scenarios for SharePoint</strong><br />
<br />
<strong>Intranet</strong>: Your organization needs to provide
controlled and secured access to private information, such as policies,
standard operating procedures, guides, wikis, knowledge bases, etc.
SharePoint easily adapts to the wide variety and types of data and is
the best solution in this case.<br />
<strong>Collaboration Portal</strong>: Teams in your organization
need to work with each other by sharing documents, information and
strategies, all while ensuring that team members do not step on each
other’s toes. SharePoint allows you to quickly provision these portals,
configure them for each team, and subsequently manage the data that they
generate.<br />
<strong>Aggregating and Exposing Information</strong>: Most
organizations have data stored over multiple systems, with no common way
to expose it for users to interact with. SharePoint provides advanced
data aggregation, manipulation and exposure capabilities by interacting
with SQL Server, Microsoft Excel Services, and other data management
solutions.<br />
<div class="callout-links">
<div class="callout-links-row">
<div class="callout-link">
</div>
<div class="callout-link">
</div>
</div>
</div>
<strong>Common Scenarios for Dynamics CRM</strong><br />
<strong><em><br />
</em>Building Agile Applications</strong>: One of the most significant
risks of software development is the fact that most applications are
built against outdated or incorrect requirements because it takes too
long between gathering requirements and producing the application. Agile
methodologies attempt to address this, but they often rely on the same
tools that necessitate a lengthy development cycle before the user can
see anything that looks remotely like the application. Dynamics CRM
allows developers to incrementally build applications, with
functionality added over time, yet constantly remain in a ‘usable’ state
which users can review.<br />
<strong><em></em></strong><br />
<strong>Building Data Management Applications</strong>: Every
organization has to manage some complex data. Example of these
applications include HR/Employee Management tools, Asset and Inventory
Tracking, Case Management, Tasker Management, and Activity Tracking,
among many, many others. Dynamics CRM allows these tools to be built
using a “point and click” interface, eliminating the need for dedicated
developers.<br />
<strong>Rewriting Legacy Applications</strong>: Every organization
has a legacy application that “needs” to be re-written. This need is
often ignored because these applications are complex, were developed
over years of evolving requirements, and are still limping along. Rather
than waiting until the need is critical, organizations can use Dynamics
CRM to re-write the application in a small fraction of the time
required to completely re-write the tool from scratch.<br />
</div>
<div class="entry-content">
It’s not a question of which system is best – it’s a question of
which system is right for a particular job. Both SharePoint and Dynamics
CRM have their strengths, but they ultimately end up complementing one
another and provide balance and support for the weaknesses that each
tool has under varying scenarios.
Building a holistic platform that combines both Dynamics CRM and
SharePoint is the first step. Using each tool to gain the utmost
advantage from the combined platform is the second step. How well
organizations do that depends on how well they appreciate the respective
strengths of each component, how mature their governance process is for
choosing the solution for each problem, and how comfortable their
solution architects are using both platforms. Once an organization
successfully implements both SharePoint and Dynamics CRM, they will find
that they have a platform that allows them to further reduce
development costs and risk, and also provides solutions that their users
<em>genuinely want to use.</em><br />
</div>
<div class="entry-content">
</div>
<div class="entry-content">
</div>
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com1tag:blogger.com,1999:blog-847413858566642421.post-89306111161284788232013-10-08T18:00:00.003-07:002013-10-08T18:00:56.502-07:00E-mail to Case/Lead Using CRM 4 Workflow<br /><div class="post-content user-defined-markup">
A frequently asked question is about converting an incoming email into a case (or a lead). If you open an email activity, it has actions to convert it into a case or a lead or opportunity. More commonly, there is a need to automate this process. <br />
In this blog, I’ll give a walkthrough’ of how you can use CRM 4.0’s workflow capabilities to automatically convert emails into cases. Say you want to automatically create a case for every email sent to: <a href="mailto:support@mycompany.com">support@mycompany.com</a> <br />
At a high level, you need to: <br />
<blockquote>
1) Create a queue and map it to the email address at which email messages will be received (<a href="mailto:support@mycompany.com">support@mycompany.com</a> in this example) <br />
2) Configure the queue to automatically create email activities for incoming email. <br />
3) Create a workflow rule on email activity create. This workflow rule will be defined to create a case based on the email activity being created. </blockquote>
<h3>
Create/Configure a Queue</h3>
You can create a queue by going to Settings -> Business Management -> Queues. For email integration to work with Queues, it is important that email integration be setup correctly. <a href="http://blogs.msdn.com/crm/archive/2008/02/07/crm-4-0-e-mail-integration-overview.aspx">http://blogs.msdn.com/crm/archive/2008/02/07/crm-4-0-e-mail-integration-overview.aspx</a> has a good overview of how to do this. <br />
In my example, I’ve named the queue ‘MyCompany Support Issues’ and configured it to automatically create email activities for all emails received at support@mycompany.com <br />
<a href="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image002_2.jpg"><img alt="clip_image002" border="0" height="484" src="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image002_thumb.jpg" style="border: 0px currentColor;" width="621" /></a> <br />
<h3>
Define Workflow Rule</h3>
For this blog, I want to use only the workflow UI to define the workflow rule and avoid having to use custom workflow assemblies. Here is an outline of the logic we want to execute in the workflow: <br />
<blockquote>
<span style="font-family: Courier New;">When an email activity is created </span> <br />
<span style="font-family: Courier New;">{</span> <br />
<span style="font-family: Courier New;">If the email is sent to: ‘support@mycompany.com’ then</span> <br />
<span style="font-family: Courier New;">{</span> <br />
<span style="font-family: Courier New;">Create a case. Set fields on the case based on the fields of the email activity.</span> <br />
<span style="font-family: Courier New;">Update the email activity – set the email activity as regarding the case that was created above.</span> <br />
<span style="font-family: Courier New;">}</span> <br />
<span style="font-family: Courier New;">}</span></blockquote>
Here is how to do this thru’ the workflow UI editor: <br />
1. From settings -> Workflow, select create a new blank workflow and select the Entity as E-mail <br />
<a href="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image004_2.jpg"><img alt="clip_image004" border="0" height="484" src="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image004_thumb.jpg" style="border: 0px currentColor;" width="644" /></a> <br />
2. Configure properties of the workflow – I’ve set the scope to be organization and made it available for on-demand execution. If the workflow is marked as available to run on-demand, On-demand execution makes it easy for me to test the workflow <br />
3. Add a check condition step and configure the step. This step will check if the email was sent to the support queue. <br />
<blockquote>
a. Select Email from the first drop-down list. <br />
b. The 2<sup>nd</sup> drop-down now lists all the fields available on the Email activity. You can select the To field or the To Recipients field. The To Recipients field is useful if the email is sent to multiple recipients. <br />
c. Select the Equals operator for the 3<sup>rd</sup> drop-down <br />
d. To set the value that the To field should equal, click on the lookup, select ‘Queue’ for the Look For drop-down and search. You should find the queue that you created.</blockquote>
<a href="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image006_2.jpg"><img alt="clip_image006" border="0" height="388" src="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image006_thumb.jpg" style="border: 0px currentColor;" width="644" /></a><br />
<blockquote>
e. If you decided to use the To Recipients field, simply type in the email address as shown below. <br />
f. Save and Close the condition.</blockquote>
<a href="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image008_2.jpg"><img alt="clip_image008" border="0" height="388" src="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image008_thumb.jpg" style="border: 0px currentColor;" width="644" /></a><br />
4. Add a create record step if the above condition is true and configure it. This step will create a case and properties of the case will be set based on the incoming email. <br />
<blockquote>
a. Select ‘Case’ as the entity to be created and use the ‘Set Properties’ button to configure how the case should be created. <br />
b. For the case title, I used the workflow editor’s ‘Dynamic Values’ capability to set the title of the case to be the same as that of the incoming email activity’s subject. The online help for the workflow page has more details on how to use dynamic values. <br />
c. Creating a case requires at least a customer and a subject to be specified. If the email is from someone who isn’t already in the system, you might want to have the workflow rule create a contact for the sender. To keep the example simple, I’ve opted to use a default contact (a contact named Test) if the sender is not recognized. <br />
d. Save and close the create case step.</blockquote>
<a href="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image010_2.jpg"><img alt="clip_image010" border="0" height="375" src="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image010_thumb.jpg" style="border: 0px currentColor;" width="644" /></a><br />
5. To link the email activity to the case created, add an update step on Email entity. Update the email’s regarding field to be the case that was created in the previous step. <br />
<blockquote>
a. On the form assistant, select ‘Create Case (Case)’ for the LookFor drop-down. The next drop down will now show the fields on the case record that are available (such as the case itself, or the customer with which the case is associated etc). Select ‘case’ for the second drop down, hit the ‘Add’ button and ‘ok’ to finish the association.</blockquote>
<a href="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image012_2.jpg"><img alt="clip_image012" border="0" height="375" src="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image012_thumb.jpg" style="border: 0px currentColor;" width="644" /></a><br />
6. Hit the ‘Publish’ button to publish the workflow. <br />
<a href="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image014_2.jpg"><img alt="clip_image014" border="0" height="412" src="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image014_thumb.jpg" style="border: 0px currentColor;" width="644" /></a> <br />
7. Test the workflow by creating an email activity. Set the To field on the email to be the queue. You should find that a case has been created for the email and the email activity is now regarding the case that has been created as shown below. <br />
<a href="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image016_2.jpg"><img alt="clip_image016" border="0" height="484" src="http://blogs.msdn.com/blogfiles/crm/WindowsLiveWriter/3e1d1a0c26a9_6998/clip_image016_thumb.jpg" style="border: 0px currentColor;" width="604" /></a> <br />
The above workflow is an example of a simple email to case conversion. If you have more complex conversion requirements, you might find that you might need to write a custom workflow assembly to implement your requirements.<br />
<br />
</div>
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-8067307923801165742013-10-07T10:42:00.001-07:002013-10-07T10:42:44.425-07:00CMS or ECM – What is the difference?<h1 class="documentFirstHeading">
<br /></h1>
<div class="documentDescription">
The whole world often seems full
of unfathomable jargon, and no one tops the information technology
industry for its love of the Three Letter Acronym (TLA). Two TLAs that
cause much confusion in our industry are CMS and ECM. Although there
are similarities between the two, there are crucial differences that
should be cleared up. </div>
Despite what your web content management system (CMS) vendor may tell
you about their ‘enterprise’ capabilities, rest assured that there is a
huge difference between having an ‘enterprise content management’ (ECM) <strong>strategy</strong>
and implementing a CMS. Unfortunately, despite considerable vendor and
analyst literature on the subject, it appears that many CIO’s, CTO’s and
IT Directors dive straight into CMS procurement without considering the
bigger picture.<br /><br />
<h3>
<strong>Definitions</strong></h3>
Let us start of with some definitions before we head into a more in depth examination:<br />
<div class="MsoListParagraphCxSpMiddle">
<strong>CMS Content Management System</strong><br />
Software used to create, edit, manage, and publish content in a <br />
consistently organized fashion.</div>
<div align="right" class="MsoListParagraphCxSpMiddle" style="text-align: right;">
(Source: <span class="link-external"><a href="http://en.wikipedia.org/wiki/Content_management_system">Wikipedia</a></span>)</div>
<div class="MsoListParagraphCxSpMiddle">
<strong>ECM Enterprise Content Management</strong><br />
The technologies used to capture, manage, store, preserve, and deliver <br />
content and documents related to organizational processes. ECM tools <br />
and strategies allow the management of an organization's unstructured <br />
information, wherever that information exists.</div>
<div align="right" class="MsoListParagraphCxSpLast" style="text-align: right;">
(Source: <span class="link-external"><a href="http://www.aiim.org/">AIIM</a></span>)</div>
The first obvious difference we see here is that the CMS definition
explicitly mentions software; it’s a software system (or systems) for a
specific use (managing and publishing content – whatever that is!). On
the other hand, the ECM definition mentions both <em>strategies </em>and<em> tools</em>. So let us take a look at the roots and history of our two TLA’s.<br /><br />
<h3>
Etymology <strong>and history</strong></h3>
CMS as a term has been around longer, and its use is generally
considered to address a system which manages content that requires
publishing ‘to the web,’ be that the public Internet, or an internal
company intranet. So in this context, ‘content’ can refer to news
items, marketing collateral, employee handbooks, etc. Usually (but not
always) this web publishing role means that the content is in
web-focused formats, such as HTML, XHTML, etc., although as the web
evolves, audio and video formats are becoming more prevalent.<br />
A CMS can possibly provide many different features and tools, mostly
around the ‘management’ part of the equation, but we will return to this
later. More recently, the term <strong>Web</strong> Content Management System (WCMS) has been used to differentiate these systems from the other CMSs, but more on that later too.<br />
ECM as a term is much younger, but it has a more convoluted history. As we have seen from the <span class="link-external"><a href="http://www.aiim.org/">AIIM</a></span>
definition, ECM is as much about strategy as software, and you can have
a strategy that addresses the creation (or capture), storage,
management, preservation, and delivery of your content and documents
without having a particular software system (or systems) to help you do
it.<br />
Notice that the AIIM definition also explicitly states ‘<em>documents</em>’
as well as content. This is where the history comes into play, as many
of the big ECM vendors have their roots in document capture (scanning)
and document management rather than web content.<br /><br />
<h3>
<strong>Content or documents?</strong></h3>
Although this is really semantics, most experts would suggest that
within the overall heading of ‘information’ the term ‘content’ usually
applies to any form of ‘unstructured’ information ( as opposed to
structured information which is the stuff held in nicely ordered rows
and columns in a database). So to apply some hierarchy to this the
following can be seen as ‘sub-types’ of content:<br />
<ul type="disc">
<li>Web content (HTML / XHTML / DHTML / Flash files)</li>
<li>XML (of various flavors, including its pre-cursor SGML)</li>
<li>Documents (MS Office, PDF, etc.)</li>
<li>Records (as in official documents, not old fashioned vinyl!)</li>
<li>Digital assets (audio, video files)</li>
</ul>
But of course all of these definitions are just meant to help us
categorize our ‘stuff’ and are interchangeable to one extent or another.
For example MS Office can save files in an XML format which can be
‘published’ on a web site or in print.<br /><br />
<h3>
<strong>ECM and CMS similarities and differences</strong></h3>
Let us look at some of the similarities between a CMS and an
enterprise content management system (ECMS): They will both provide
facilities generally termed ‘library services’ (i.e., check in/out,
version control, workflow etc.) so let us use the categories from the
AIIM definition:<br />
<table class="MsoNormalTable">
<tbody>
<tr>
<td align="center">
<strong>AIIM category</strong><br />
</td>
<td align="center">
<strong>CMS</strong><br />
</td>
<td align="center">
<strong>ECMS</strong><br />
</td>
</tr>
<tr>
<td>
Capture / Create<br />
</td>
<td>
Built in editors and integration with MS Office<br />
</td>
<td>
Built in editors and integration with MS Office, plus integrated scanning or imaging<br />
</td>
</tr>
<tr>
<td>
Manage<br />
</td>
<td>
Library services and metadata management, approval or editorial workflows<br />
</td>
<td>
Library services and metadata management, plus records retention
and disposal. Complex workflow as part of Business Process Management<br />
</td>
</tr>
<tr>
<td>
Store<br />
</td>
<td>
Work in progress, staging and ‘live’ environments may all hold copies of same version<br />
</td>
<td>
Sophisticated storage management including integration with storage
hardware plus ‘single instance’ storage or other de-duplication
technologies<br />
</td>
</tr>
<tr>
<td>
Preserve<br />
</td>
<td>
Snapshots of websites and content<br />
</td>
<td>
Long term archiving and digital preservation, more integrated with storage<br />
</td>
</tr>
<tr>
<td>
Deliver<br />
</td>
<td>
To the web including mobile devices<br />
</td>
<td>
To the web, to the desktop client, to other software and systems, to print, etc.<br />
</td>
</tr>
</tbody>
</table>
<br />
So, as we can see, generally a CMS provides features to manage web
content, and an ECMS will take these features and facilities further by
extending them into different areas such as:<br />
<ul type="disc">
<li>Document imaging</li>
<li>Document management</li>
<li>Records management</li>
<li>Digital asset management</li>
<li>Workflow management / Business process management</li>
<li>Web content management </li>
<li>Knowledge management </li>
<li>Collaboration </li>
</ul>
You will note that there are point solutions that each major on
managing a single one of these content types, whereas an EMCS is a
‘suite’ of software aiming to manage them all. One of the major
differences between a CMS and an ECMS is in the area of Business Process
Management (or BPM) or ‘workflow’. While a web-focused CMS may have
workflows ranging from simple to quite complex based around editorial
processes and authorization of what reaches the live web site, an ECMS
is likely to have a full visual workflow design tool and a much heavier
weight feature set for designing whole business processes.<br />
Finally, on the Web 2.0 / enterprise 2.0 / social media front, a CMS
might offer you the ability to build such features into a site, whereas
an ECM system usually offers web or ‘fat’ clients to allow users to
collaborate around the content in the ECM repository.<br /><br />
<h3>
<strong>Summary and conclusions</strong></h3>
In the end it all comes down to your particular context, and what
your business requirements are. If you’re a small to medium company
manufacturing widgets and you want a better website to sell more
widgets, and a better intranet to improve employee communications, then
your probably in the market for a CMS.<br />
If you’re a medium to large enterprise, and most of your staff come
under the heading of ‘knowledge workers,’ and terms such as Enterprise
Information Management, or Information Lifecycle Management are not
completely alien to you, then you probably need a ECM <strong>strategy </strong>as part of your wider information management efforts <strong>– </strong>you
may buy a an ECM suite from one of the big vendors, or you may
implement your strategy using multiple ‘best of breed’ products (some of
which you may already have), including a CMS. However, all content
management requires planning; see the article by Toby Ward, <em><a href="http://www.prescientdigital.com/articles/content-management/content-management-proves-costly-without-planning" title="Content Management Proves Costly Without Planning">Content Management Proves Costly Without Planning</a></em> for some more information on that topic.<br />
The main point here is to think holistically about your requirements.
If you think you need a new CMS, check around and see if other
departments need a document management solution, and ask your legal and
compliance people if they are investigating records management. Think
strategically about information management and cast a wide net. This
does not mean you have to ‘bite it all off’ in one go and have a
massively complex implementation. ‘Think globally, act locally’ is a
good analogy; a phased implementation with pilot projects is established
good practice.<br />
In conclusion, implementing ECM is more about strategy, it will
require more work than implementing a point solution using a CMS, but in
the long run its ‘more pain, for more gain’ – in this digital age,
competitive advantage awaits those organizations which realize
information is a key asset, and manage it accordingly.<br />
Whichever journey you’re on, Prescient Digital Media has the
expertise and experience to help you to both understand your
requirements and fulfill them. See our <a href="http://www.prescientdigital.com/services/intranet%20services/cms-blueprint" title="CMS Blueprint © 2008">CMS Blueprint</a> for some more information on our services.Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-30174944398201113292013-10-02T18:27:00.001-07:002013-10-02T18:27:08.740-07:00Control Architectures<br />The spectrum of control architectures (Figure 1) goes from centralized to decentralized structures. Movement in any direction implies a trade-off between oversight and efficiency, on the one hand, and local autonomy and operational flexibility, on the other. The following are the most common control architectures.<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRfDtOMO66wp-DEQNDWtoVL-wHljkIExDETB0AjzR-dcuqWNk5V-tMZbd45iIWigFPUaEy9ntLY1lkxuORZiomDafzgkqxfnghLJIdj6AITRCH7wuCAlwR_bJBeOSj-i43qCa0ybIT54E/s1600/ca.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="321" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRfDtOMO66wp-DEQNDWtoVL-wHljkIExDETB0AjzR-dcuqWNk5V-tMZbd45iIWigFPUaEy9ntLY1lkxuORZiomDafzgkqxfnghLJIdj6AITRCH7wuCAlwR_bJBeOSj-i43qCa0ybIT54E/s640/ca.PNG" width="640" /></a></div>
<br />Figure 1: The spectrum of control architectures<br />
<br />
<br />
<br /><b>Centralized </b>– Has the advantage of relatively simple control; however, if the situation for which it is configured changes, then a massive effort is required to reconfigure it. Is characterized by a single point of failure, resulting in a lack of general robustness.<br /><b>Heterarchical </b>(or fully decentralized) – Relatively robust because there is very little to break, but this lack of structure also makes it very difficult to control and makes undesirable chaotic behaviour possible.<br /><b>Hierarchical </b>– Consists in a top-down decomposition of control. Is efficient in that it forces an expected behavior; but is inflexible and branches can become uncontrollable if an intermediate element is incapacitated. Autonomy of nodes is quite limited.<br /><b>Federated </b>– A compromise between hierarchical and heterarchical structures. Like the latter, the nodes have a high degree of autonomy but communicate through specialized middle nodes. Has improved robustness and flexibility over the other architectures, but does not allow for dynamic restructuring.<br /><b>Holarchical </b>(or holonic) – A hybrid, recursive and hierarchical structure which is able to generate dynamic linkages to form an impromptu control structure. Couples the flexibility of fully decentralized architecture with the stability and predictability of a centralized and hierarchical control.<br />
<br />The control structure defines the performance of an organization to the extent that it defines its authority structure; it affects task and resource allocation (MacMillan et al. 2002); it indirectly affects performance by influencing collaborative processes; and it defines the external fit of the organization, that is, its adaptability to changing situations (Hollenbeck 2000). Given that they involve several organizations, MOS preclude control structures that assume a single chain of command, such as centralized, hierarchical, or holarchical architectures. In fact, MOS are constituted of autonomous and sovereign organizations that try to exploit a networked environment, and this entails the use of a decentralized architecture, where generally an administration board is used as means of governance. However, when a new entity is created, the latter, as a new organization, can have a centralized or hierarchical command, which can sometimes become problematic. Control structure in MOS must be rather defined in terms of the intensity of control (partial or full) of partner organizations on their representatives in the collaboration space, endowing it with more or less autonomy as a new organization. Another issue is the power relationships between the partner organizations, which can give one party more decision making authority and thus more global control over the mission of the newly created MOS.Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-56301996933391768342013-10-02T17:18:00.002-07:002013-10-02T17:18:30.087-07:00Microsoft Dynamics CRM Upgrade Vs. Re-Implementation<br />As a veteran of many Dynamics CRM upgrades, I’ve come to
identify and expect many of the pitfalls and opportunities that come
with upgrading CRM from one version to the next. However, a recent
experience caused me to re-evaluate these assumptions.<br />
We had a client with a mature CRM 4.0 deployment moving from their
host company to a brand new start up. They needed to transition their
on-premise Sales CRM 4.0 instance in its entirety to Dynamics CRM 2011
online, with new reporting servers, new Active Directory (Office 365),
etc.<br />
What finally moved them to decide upon a re-implementation was the
move from on-premise to online. There is currently no easy way to
achieve this short of a full data migration effort (potentially using
the new <a href="http://www.microsoft.com/en-us/download/details.aspx?id=35385">Microsoft Instance Adapter</a>),
and because a data migration effort was going to be involved anyway,
the client decided to take advantage of the opportunity to revise their
data model and code base, hence the re-implementation.<br />
<strong>Comparing CRM Re-Implementation With CRM Upgrade</strong><br />
<em>The benefits of a re-implementation for this client were:</em><br />
a. Scrub of the schema. 5 years of accumulated fields and forms were all cleaned up <em>outside </em>of the CRM application<br />
b. Selective import of data. Inactive contacts older than 3 years
were not imported at all. The same logic applied to activities, leads,
deactivated accounts, and attachments.<br />
c. Optimization of code for 2011. Rather than fix the code prior to
the upgrade occurring, or during the import process of the 4.0 DB to a
2011 DB, the code can be optimized offline.<br />
d. An opportunity to manage and include different data sets other
than the Sales CRM instance into the data migration prior to load.<br />
e. For migrations of instance from on-premise to the cloud, where a
migration is essential, the opportunities identified above are too good
to miss!<br />
Not all of these are mutually exclusive when compared to an upgrade,
but are significantly easier to manage when dealing with a tabula rasa
style environment.<br />
<br />
For parity, the upgrade path offers the following benefits:<br />
a. Automatic migration of data.<br />
b. Mapping of Users to the new domain users, and historical mapping of old, unmatched users.<br />
c. A transition of all client side code and database stored plugins.<br />
d. A transition of workflows.<br />
<strong>The Process</strong><br />
Re-implementation forces a deep dive into the minutiae of the existing
CRM environment. This is otherwise only really done when an environment
is initially set up, or for certain key releases of functionality. (In
the case of the latter, it is still unlikely that the entire application
is reviewed.)<br />
Accordingly, a data-map was constructed for all entities in the
source application that needed to be migrated. In addition, this data
map also contained details of all forms and views currently in use, and
the sequencing and labeling of the included fields.<br />
What followed was a painstaking process of field by field examination
by Madrona and the client to evaluate the use and label of each of
these fields (sample below). Due to the scale of the project, we
identified a single resource on the Madrona team to own the schema map
process and document. We all contributed, along with the client, and the
schema master ensured that our versioning was maintained.<br />
Sample: The red highlights indicate a field no longer needed. Note the schema renaming:<br />
<img alt="Microsoft Dynamics CRM Upgrade Vs. Re-implementation" src="http://www.madronasg.com/sites/madronasg.com/files/leeblogpostimage.png" style="float: left; height: 113px; width: 480px;" /><br />
<br />
<br />
<br />
<br />
Once the data map was confirmed, we began planning the migration of
the existing CRM data into the new application. Clearly the sequencing
of this was key, as we were not simply inserting rows into SQL, we were
migrating to the online CRM 2011, and so we need to use the API at all
times.<br />
<strong>Final Post Re-Implementation Thoughts</strong><br />
Having recently completed this project, we had some key takeaways as it
relates to this debate that we will take into our next project of this
type:<br />
1. Set expectations early that the process of re-mapping, as time
consuming as it is, needs to be replicated at the testing phase by the
client so as to ensure the data migrations occur exactly as planned<br />
2. The ability to manage the dataset outside of a CRM environment,
and to include new data into the mix during the transition, is an
opportunity that is unique to the re-implementation process. If you have
a great deal of data normalization to perform, and are due an upgrade,
it is worth considering re-implementation for this alone. In this case,
we on-boarded a Support function into CRM along with the Sales team, and
used this process to merge Account and Contact data<br />
3. Code transition was excellent. Being able to do this independent
of the data migration was a great plus. This and the schema change
opportunity are the stand-out advantages of the re-implementation.<br />
4. The relationship between CRM and external reporting teams (in
this case, a data warehouse team that had been doing weekly extracts
from CRM) needs to be established early and considered a key part of the
process. With schema renaming and fine tuning of the data migration
process, large impacts can be seen downstream for reporting especially
if they are using GUIDs as key identifiers.<br />
Finally, based on our experience, here is a comparative table of each:<br />
<table border="1" cellpadding="0" cellspacing="0" style="width: 490px;">
<tbody>
<tr>
<td style="width: 213px;">
<strong>Area</strong><br />
</td>
<td style="width: 213px;">
<strong>Upgrade</strong><br />
</td>
<td style="width: 213px;">
<strong>Re-implementation</strong><br />
</td>
</tr>
<tr>
<td style="width: 213px;">
Moving from on-Premise to Online.<br />
</td>
<td style="width: 213px;">
Not applicable. Even if you upgrade to match the current version you still need to migrate to the cloud via re-implementation.<br />
</td>
<td style="width: 213px;">
Essential.<br />
</td>
</tr>
<tr>
<td style="width: 213px;">
Data Migration.<br />
</td>
<td style="width: 213px;">
No risk.<br />
</td>
<td style="width: 213px;">
Complicated. Complete field mapping required, plus design of the migration process itself and sequencing of the imports.<br />
</td>
</tr>
<tr>
<td style="width: 213px;">
Data integrity.<br />
</td>
<td style="width: 213px;">
No risk.<br />
</td>
<td style="width: 213px;">
Higher risk due to re-structure of data. Not able to fully
replicate all deactivated system users in CRM online either (need to map
to a service account instead).<br />
</td>
</tr>
<tr>
<td style="width: 213px;">
Data model changes.<br />
</td>
<td style="width: 213px;">
Complicated. Can only be completed either live in the source application pre-deployment, or once upgraded.<br />
</td>
<td style="width: 213px;">
Easier.<br />
</td>
</tr>
<tr>
<td style="width: 213px;">
Removal / culling of data.<br />
</td>
<td style="width: 213px;">
Done only via the CRM user interface and bulk deletes, or a third party API tool.<br />
</td>
<td style="width: 213px;">
Easier.<br />
</td>
</tr>
<tr>
<td style="width: 213px;">
Merging and adding additional Data.<br />
</td>
<td style="width: 213px;">
Complicated. Traditional data migration with downstream effects (data clean up and de-duplication).<br />
</td>
<td style="width: 213px;">
Managed outside of CRM, much simpler insertion into the CRM application.<br />
</td>
</tr>
<tr>
<td style="width: 213px;">
CRM SSRS Reports.<br />
</td>
<td style="width: 213px;">
Reports are moved over into the new instance automatically. The reports are not tested automatically.<br />
</td>
<td style="width: 213px;">
Reports have to be optimized offline and deployed anew to the re-implemented instance.<br />
</td>
</tr>
<tr>
<td style="width: 213px;">
Other Reports.<br />
</td>
<td style="width: 213px;">
Aside from a change of Organization name or hardware, the data model and guides will all remain identical.<br />
</td>
<td style="width: 213px;">
Potentially complicated dependent upon reporting model. If a
schema re-structure has occurred, commensurate work may be required with
reporting model.<br />
</td>
</tr>
<tr>
<td style="width: 213px;">
Code Optimization.<br />
</td>
<td style="width: 213px;">
Either let the upgrade process tell you where you code has failed (or the upgrade may even fail!) and then fix.<br />
</td>
<td style="width: 213px;">
Re-implementation forces a code review, due to schema revision.
Code situation will not prevent successful data migration. Easier for
developers.<br />
</td>
</tr>
<tr>
<td style="width: 213px;">
Workflows.<br />
</td>
<td style="width: 213px;">
Upgraded automatically. May need fixing is dependent code breaks.<br />
</td>
<td style="width: 213px;">
Need to be manually re-created.<br />
</td>
</tr>
</tbody>
</table>
<br />
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-60631138364776221732013-09-30T08:28:00.001-07:002013-09-30T08:28:49.775-07:00Integrating Microsoft Dynamics CRM 2011 with BizTalk 2010<header class="entry-header"><br /></header>
<div class="entry-content">
As I told in my previous post, I am working at a customer where we
are trying to integrate Microsoft Dynamics CRM 2011 using BizTalk 2010.
Since CRM 2011 does not have a BizTalk adapter anymore, we have to use
the webservices it exposes, which can be used in BizTalk in 2 ways. I
first tried to use the untyped option, where you would have to use
mappings with custom XSLT for your communication to the CRM service. I
ran into a lot of <a href="http://blog.eldert.net/integrating-crm-2011-with-biztalk-2010/" target="_blank" title="Integrating CRM 2011 with BizTalk 2010 – Untyped">problems</a>
with this, and then decided to use the typed option instead. Using this
option, you will create a helper class that does the communication to
CRM, which you can then use from your orchestrations. While looking for
more resources on this, I ran into <a href="http://blogs.msdn.com/b/pkelcey/archive/2011/03/10/crm-2011-integration-how-to-video-1-biztalk-on-premise-to-crm-2011.aspx" target="_blank">this video</a> Peter Kelcey created, which I used as my basis for my solution. The full source for my solution can be found <a href="https://skydrive.live.com/redir?resid=3FE8758B2C2B58D2%21143" target="_blank">here</a>.<br />
<span id="more-991"></span><br />
<h1>
Get CRM Types</h1>
The first thing you will need to do is to get the <a href="http://www.microsoft.com/en-us/download/details.aspx?id=24004" target="_blank">CRM 2011 SDK</a>
if you have not done so yet. In the SDK you will find a file called
crmsvcutil.exe. Using this, you create a helper class containing all
your CRM entities. To use this, execute it from the command line as
following:<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="dos" style="font-family: monospace;">"C:\Location\Of\Microsoft Dynamics CRM 2011 SDK\bin\crmsvcutil.exe" /url:https://company.crm.ms-hosting.nl/XRMServices/2011/Organization.svc /out:CRMHelper.cs /username:user<span style="color: #33cc33;">@</span>company.com /password:Pass<span style="color: #33cc33;">@</span>word1</pre>
</td></tr>
</tbody></table>
</div>
The first parameter, url, is the URL where your organization service
is living. The second parameter, out, is the class that will be created.
The username and password parameters are the credentials of a user in
CRM with enough rights to actually use the webservice. Once you have
created the helper class you can add this to your BizTalk project. <br />
<h1>
Service Wrapper</h1>
Next we are going to create a new class, that will hold various
helper classes used communicate with CRM. I simply call this class
HelperMethods.cs. Make sure you add a reference to
microsoft.xrm.sdk.dll, which can be found in the CRM 2011 SDK.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Collections.Generic</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.IO</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.ServiceModel.Description</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Text</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Xml</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Xml.Serialization</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">Microsoft.Xrm.Sdk.Client</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">Microsoft.Xrm.Sdk.Query</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">namespace</span> Company<span style="color: green;">.</span><span style="color: blue;">BizTalk</span><span style="color: green;">.</span><span style="color: blue;">CRM</span><span style="color: green;">.</span><span style="color: blue;">BusinessComponents</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Methods used to communicate with Microsoft Dynamics CRM 2011.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> HelperMethods
<span style="color: green;">{</span>
<span style="color: green;">}</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
The first method we are going to set up is where we create a
connection to CRM. As always, I have extensively commented my code, so
it should be pretty easy to see what everything does. I have a seperate
Constants class, where I have stored several strings for username,
password, etc. The method finally returns a connection to our CRM
system.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// This method opens a connection to CRM 2011 and returns a proxy object that can be used to create, update, read, delete and execute events in CRM.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <returns>The proxy used to connect to the CRM webservice.</returns></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> OrganizationServiceProxy CreateServiceProxy<span style="color: green;">(</span><span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// The proxy used to connect to the CRM webservice OrganizationServiceProxy serviceProxy;</span>
<span style="color: teal; font-style: italic;">// Set the URL for the CRM organization webservice</span>
Uri organizationUri <span style="color: green;">=</span> <span style="color: green;">new</span> Uri<span style="color: green;">(</span><span style="color: #666666;">"https://"</span> <span style="color: green;">+</span> Constants<span style="color: green;">.</span><span style="color: blue;">CRMOrganizationName</span> <span style="color: green;">+</span> <span style="color: #666666;">".crm.ms-hosting.nl/XRMServices/2011/Organization.svc"</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// The user credentials we need to provide are the credentials that we use to access CRM</span>
ClientCredentials credentials <span style="color: green;">=</span> <span style="color: green;">new</span> ClientCredentials<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
credentials<span style="color: green;">.</span><span style="color: blue;">UserName</span><span style="color: green;">.</span><span style="color: blue;">UserName</span> <span style="color: green;">=</span> Constants<span style="color: green;">.</span><span style="color: blue;">CRMUserName</span><span style="color: green;">;</span>
credentials<span style="color: green;">.</span><span style="color: blue;">UserName</span><span style="color: green;">.</span><span style="color: blue;">Password</span> <span style="color: green;">=</span> Constants<span style="color: green;">.</span><span style="color: blue;">CRMPassword</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// This is only used when you want to connect to CRM online</span>
<span style="color: teal; font-style: italic;">// Seeing how I use the on-promise CRM I will not be using this, but I will let it in for reference purposes</span>
<span style="color: teal; font-style: italic;">// The device credentials that we use must have been generated by the CreateCRM2011Device application, which is available at http://code.msdn.microsoft.com/CRM2011Beta/Release/ProjectReleases.aspx?ReleaseId=4944</span>
<span style="color: teal; font-style: italic;">// If you do not have these credentials, download the application, run it and a new Device username and Device password will be generated for you</span>
ClientCredentials devicecredentials <span style="color: green;">=</span> <span style="color: green;">new</span> ClientCredentials<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Create the service proxy</span>
serviceProxy <span style="color: green;">=</span> <span style="color: green;">new</span> OrganizationServiceProxy<span style="color: green;">(</span>organizationUri, <span style="color: #0600ff; font-weight: bold;">null</span>, credentials, devicecredentials<span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// This next method enables support for early bound types</span>
<span style="color: teal; font-style: italic;">// If you forget this line, you'll get a "value cannot be null" exception</span>
serviceProxy<span style="color: green;">.</span><span style="color: blue;">EnableProxyTypes</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Return the proxy</span>
<span style="color: #0600ff; font-weight: bold;">return</span> serviceProxy<span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
And here is what the constants class looks like.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Collections.Generic</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Linq</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Text</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">namespace</span> Company<span style="color: green;">.</span><span style="color: blue;">BizTalk</span><span style="color: green;">.</span><span style="color: blue;">CRM</span><span style="color: green;">.</span><span style="color: blue;">BusinessComponents</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Class containing all constant values used in the helper classes.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> Constants
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// The name of the column with the email addresses for contacts.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">string</span> ContactEmailAddressColumnName <span style="color: green;">{</span> <span style="color: #0600ff; font-weight: bold;">get</span> <span style="color: green;">{</span> <span style="color: #0600ff; font-weight: bold;">return</span> <span style="color: #666666;">"emailaddress1"</span><span style="color: green;">;</span> <span style="color: green;">}</span> <span style="color: green;">}</span>
<span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// The name of the organization used to connect to the CRM webservice.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">string</span> CRMOrganizationName <span style="color: green;">{</span> <span style="color: #0600ff; font-weight: bold;">get</span> <span style="color: green;">{</span> <span style="color: #0600ff; font-weight: bold;">return</span> <span style="color: #666666;">"company"</span><span style="color: green;">;</span> <span style="color: green;">}</span> <span style="color: green;">}</span>
<span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// The username used to connect to the CRM webservice.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">string</span> CRMUserName <span style="color: green;">{</span> <span style="color: #0600ff; font-weight: bold;">get</span> <span style="color: green;">{</span> <span style="color: #0600ff; font-weight: bold;">return</span> <span style="color: #666666;">"eldert.grootenboer@company.nl"</span><span style="color: green;">;</span> <span style="color: green;">}</span> <span style="color: green;">}</span>
<span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// The password used to connect to the CRM webservice.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">string</span> CRMPassword <span style="color: green;">{</span> <span style="color: #0600ff; font-weight: bold;">get</span> <span style="color: green;">{</span> <span style="color: #0600ff; font-weight: bold;">return</span> <span style="color: #666666;">"Pass@word1"</span><span style="color: green;">;</span> <span style="color: green;">}</span> <span style="color: green;">}</span>
<span style="color: green;">}</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
<h1>
Converting schema’s to C# classes</h1>
To be able to easily use the schema’s from BizTalk in our code, we
should create C# classes to do this. For this the xsd.exe tool can be
used. This tool can be found in the folder<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="dos" style="font-family: monospace;">Program Files <span style="color: #33cc33;">(</span>x86<span style="color: #33cc33;">)</span>\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools</pre>
</td></tr>
</tbody></table>
</div>
Using this tool you can create a C# class with schema by running the following from a commandline:<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="dos" style="font-family: monospace;">Program Files <span style="color: #33cc33;">(</span>x86<span style="color: #33cc33;">)</span>\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\xsd.exe C:\Location\Of\YourSchema.xsd /c /o:C:\Location\Of</pre>
</td></tr>
</tbody></table>
</div>
If you use the same output folder as the where the input xsd file is
located, you can attach it to the schema in Visual Studio by using the
Show All Files button, and then including it in the project. Do this for
all schema’s you will be receiving from your orchestration (probably
your canonicals), which will contain the objects you want to transfer to
or from CRM.<br />
<h1>
C# to XML Documents</h1>
Since we only want to use XMLDocuments in BizTalk itself, we are also
going to create a class which is used to create XMLDocuments from our
classes representing the schema’s (which we created in the previous
chapter). To do this, we will add another method to the class we just
created. This method will take a C# object, and serialize it to a XML
document.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Create an XML document from a C# object.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <param name="objectToMakeXmlDocument">The object to be serialized.</param></span>
<span style="color: teal; font-style: italic;">/// <returns>The serialized object as an XML document.</returns></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> XmlDocument CreateXmlDocument<span style="color: green;">(</span><span style="color: #6666cc; font-weight: bold;">object</span> objectToMakeXmlDocument<span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// The serializer we will use</span>
<span style="color: #0600ff; font-weight: bold;">var</span> xmlSerializer <span style="color: green;">=</span> <span style="color: green;">new</span> XmlSerializer<span style="color: green;">(</span>objectToMakeXmlDocument<span style="color: green;">.</span><span style="color: blue;">GetType</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Create a new StringBuilder, that will create a string with the XML document</span>
<span style="color: #0600ff; font-weight: bold;">var</span> stringBuilder <span style="color: green;">=</span> <span style="color: green;">new</span> StringBuilder<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Serialize the object into the StringBuilder</span>
xmlSerializer<span style="color: green;">.</span><span style="color: blue;">Serialize</span><span style="color: green;">(</span><span style="color: green;">new</span> StringWriter<span style="color: green;">(</span>stringBuilder<span style="color: green;">)</span>, objectToMakeXmlDocument<span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Create an XML document</span>
XmlDocument document <span style="color: green;">=</span> <span style="color: green;">new</span> XmlDocument<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Load the XML from the StringBuilder</span>
document<span style="color: green;">.</span><span style="color: blue;">LoadXml</span><span style="color: green;">(</span>stringBuilder<span style="color: green;">.</span><span style="color: blue;">ToString</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Return the XML document</span>
<span style="color: #0600ff; font-weight: bold;">return</span> document<span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
<h1>
CRM Actions</h1>
The next class we are going to create will contain the actions we want do on CRM, like retrieve, insert, update and delete.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Collections.Generic</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">Microsoft.Xrm.Sdk</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">Microsoft.Xrm.Sdk.Query</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">namespace</span> Company<span style="color: green;">.</span><span style="color: blue;">BizTalk</span><span style="color: green;">.</span><span style="color: blue;">CRM</span><span style="color: green;">.</span><span style="color: blue;">BusinessComponents</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Class containing the various actions that can be done in CRM, like select, create, update, etc.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> CRMActions
<span style="color: green;">{</span>
<span style="color: green;">}</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
My first method in this class will be used to look up entities. CRM
has to retrieve functions, one uses the ID of an entity, the other can
use a custom condition. Since we wanted to be able to find contacts by
using the email address, I used the second option. This method creates
the query to be used, sends this to CRM, and returns the entities that
were returned by CRM.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Retrieves multiple entities using a query.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <param name="entityName">The logical name of the entity which we want to work on.</param></span>
<span style="color: teal; font-style: italic;">/// <param name="conditions">The query to be used.</param></span>
<span style="color: teal; font-style: italic;">/// <returns>A collection of entities.</returns></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> DataCollection<span style="color: green;"><</span>Entity<span style="color: green;">></span> RetrieveMultipleEntities<span style="color: green;">(</span><span style="color: #6666cc; font-weight: bold;">string</span> entityName, List<span style="color: green;"><</span>ConditionExpression<span style="color: green;">></span> conditions<span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Create the proxy</span>
<span style="color: #0600ff; font-weight: bold;">var</span> serviceProxy <span style="color: green;">=</span> HelperMethods<span style="color: green;">.</span><span style="color: blue;">CreateServiceProxy</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Execute the query and return the result</span>
<span style="color: #0600ff; font-weight: bold;">return</span> serviceProxy<span style="color: green;">.</span><span style="color: blue;">RetrieveMultiple</span><span style="color: green;">(</span>HelperMethods<span style="color: green;">.</span><span style="color: blue;">CreateRetrieveMultipleQuery</span><span style="color: green;">(</span>entityName, conditions<span style="color: green;">)</span><span style="color: green;">)</span><span style="color: green;">.</span><span style="color: blue;">Entities</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
As you can see a list of ConditionExpression is used, which is used
to set up a filter. It contains a column on which we want to filter, the
operator to be used (f.e. equals or like), and the value we want to
find.<br />
Also I use a method called CreateRetrieveMultipleQuery in the
HelperMethods class. This method is used to create the QueryExpression
that will be sent to the CRM webservice, and looks like this:<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Create a query that will retrieve multiple entities from CRM.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <param name="entityName">The logical name of the entity.</param></span>
<span style="color: teal; font-style: italic;">/// <param name="conditionExpressions">The conditions that make up the query.</param></span>
<span style="color: teal; font-style: italic;">/// <returns>A query that can be used to retrieve multiple entities.</returns></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> QueryExpression CreateRetrieveMultipleQuery<span style="color: green;">(</span><span style="color: #6666cc; font-weight: bold;">string</span> entityName, IEnumerable<span style="color: green;"><</span>ConditionExpression<span style="color: green;">></span> conditionExpressions<span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Create a new FilterExpression</span>
<span style="color: #0600ff; font-weight: bold;">var</span> filterExpression <span style="color: green;">=</span> <span style="color: green;">new</span> FilterExpression<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Add the conditions to set up the filter</span>
filterExpression<span style="color: green;">.</span><span style="color: blue;">Conditions</span><span style="color: green;">.</span><span style="color: blue;">AddRange</span><span style="color: green;">(</span>conditionExpressions<span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Create the new Query expression and return it</span>
<span style="color: #0600ff; font-weight: bold;">return</span> <span style="color: green;">new</span> QueryExpression
<span style="color: green;">{</span>
EntityName <span style="color: green;">=</span> entityName,
ColumnSet <span style="color: green;">=</span> <span style="color: green;">new</span> ColumnSet
<span style="color: green;">{</span>
AllColumns <span style="color: green;">=</span> <span style="color: #0600ff; font-weight: bold;">true</span>
<span style="color: green;">}</span>,
Criteria <span style="color: green;">=</span> filterExpression
<span style="color: green;">}</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
This next method is used to create a new entity, and returns it’s ID.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Create a new entity in CRM.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <param name="entityToCreate">The entity that should be created.</param></span>
<span style="color: teal; font-style: italic;">/// <returns>The GUID of the new entity.</returns></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> Guid CreateEntity<span style="color: green;">(</span>Entity entityToCreate<span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Create the proxy</span>
<span style="color: #0600ff; font-weight: bold;">var</span> serviceProxy <span style="color: green;">=</span> HelperMethods<span style="color: green;">.</span><span style="color: blue;">CreateServiceProxy</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Create the entity, and return it's GUID</span>
<span style="color: #0600ff; font-weight: bold;">return</span> serviceProxy<span style="color: green;">.</span><span style="color: blue;">Create</span><span style="color: green;">(</span>entityToCreate<span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
We also want a method we can use to update an entity.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Update an existing entity in CRM.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <param name="entityToUpdate">The entity that should be updated, with it's new values set.</param></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> UpdateEntity<span style="color: green;">(</span>Entity entityToUpdate<span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Create the proxy</span>
<span style="color: #0600ff; font-weight: bold;">var</span> serviceProxy <span style="color: green;">=</span> HelperMethods<span style="color: green;">.</span><span style="color: blue;">CreateServiceProxy</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Update the entity</span>
serviceProxy<span style="color: green;">.</span><span style="color: blue;">Update</span><span style="color: green;">(</span>entityToUpdate<span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
The last method in this class will be used to delete an entity in CRM.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Delete an entity in CRM.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <param name="entityToDelete"></param></span>
<span style="color: #0600ff; font-weight: bold;">internal</span> <span style="color: #0600ff; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> DeleteEntity<span style="color: green;">(</span>Entity entityToDelete<span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Create the proxy</span>
<span style="color: #0600ff; font-weight: bold;">var</span> serviceProxy <span style="color: green;">=</span> HelperMethods<span style="color: green;">.</span><span style="color: blue;">CreateServiceProxy</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Delete the entity</span>
serviceProxy<span style="color: green;">.</span><span style="color: blue;">Delete</span><span style="color: green;">(</span>entityToDelete<span style="color: green;">.</span><span style="color: blue;">LogicalName</span>, entityToDelete<span style="color: green;">.</span><span style="color: blue;">Id</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
<h1>
Contact proxy</h1>
For this blogpost I will only show the code I use for working on one
entity, contact. All code up to this point can be re-used for all
entities, so you only need to to create the class I am going to describe
now for each entity you want to work on from BizTalk. Seeing how this
is the class you will actually be using in your orchestration, you have
to make it serializable, so BizTalk can write it to the database.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Linq</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Xml</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">Microsoft.XLANGs.BaseTypes</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">Microsoft.Xrm.Sdk.Query</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">using</span> <span style="color: teal;">System.Collections.Generic</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">namespace</span> Customer<span style="color: green;">.</span><span style="color: blue;">BizTalk</span><span style="color: green;">.</span><span style="color: blue;">CRM</span><span style="color: green;">.</span><span style="color: blue;">BusinessComponents</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Proxy class used for working on contacts in CRM.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: green;">[</span>Serializable<span style="color: green;">]</span>
<span style="color: #0600ff; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> CRMServiceProxyContact
<span style="color: green;">{</span>
<span style="color: green;">}</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
This is where you will use the C# classes you created of your
schemas. In this class, add an attribute for the type of schema you will
be getting from BizTalk.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Canonical representation of the contact.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
ContactCanonical _contact<span style="color: green;">;</span></pre>
</td></tr>
</tbody></table>
</div>
The schema looks as following. Here IsProcessed is a boolean
indicating if the message has allready been processed by a
orchestration, and is promoted so it can be used on the filters. Action
is an enumerator where a value of retrieve, create, update or delete can
be used.<br />
<a href="http://blog.eldert.net/wp-content/uploads/2012/06/ContactCanonical.jpg"><img alt="" class="aligncenter size-full wp-image-992" height="520" src="http://blog.eldert.net/wp-content/uploads/2012/06/ContactCanonical.jpg" title="ContactCanonical" width="558" /></a><br />
Next we are going to create the constructor. This takes in a
XLANGMessage, which is the message from the orchestration in BizTalk. To
be able to use this type add a reference to
Microsoft.XLANGs.BaseTypes.dll which is located in the BizTalk 2010
installation folder.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Constructor.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <param name="serviceRequest">The XML document from BizTalk with the canonical contact.</param></span>
<span style="color: #0600ff; font-weight: bold;">public</span> CRMServiceProxyContact<span style="color: green;">(</span>XLANGMessage serviceRequest<span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Cast the XML document to a canonical contact</span>
_contact <span style="color: green;">=</span> <span style="color: green;">(</span>ContactCanonical<span style="color: green;">)</span>serviceRequest<span style="color: green;">[</span><span style="color: red;">0</span><span style="color: green;">]</span><span style="color: green;">.</span><span style="color: blue;">RetrieveAs</span><span style="color: green;">(</span><span style="color: green;">typeof</span><span style="color: green;">(</span>ContactCanonical<span style="color: green;">)</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// We have processed the contact, so make sure it does not get picked up by this orchestration again</span>
_contact<span style="color: green;">.</span><span style="color: blue;">Header</span><span style="color: green;">.</span><span style="color: blue;">IsProcessed</span> <span style="color: green;">=</span> <span style="color: #0600ff; font-weight: bold;">true</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
The next method is used to determine the action that should be done
in CRM by looking into the message we got. We return the message with
it’s new contents to the orchestration.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Work on the contact.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <returns>XML document with the result.</returns></span>
<span style="color: #0600ff; font-weight: bold;">public</span> XmlDocument DoWorkOnContact<span style="color: green;">(</span><span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Check what type of work we want to do on the contact.</span>
<span style="color: #0600ff; font-weight: bold;">switch</span> <span style="color: green;">(</span>_contact<span style="color: green;">.</span><span style="color: blue;">Header</span><span style="color: green;">.</span><span style="color: blue;">Action</span><span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: #0600ff; font-weight: bold;">case</span> ContactCanonicalHeaderAction<span style="color: green;">.</span><span style="color: blue;">retrieve</span><span style="color: green;">:</span>
<span style="color: #0600ff; font-weight: bold;">return</span> RetrieveContact<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">case</span> ContactCanonicalHeaderAction<span style="color: green;">.</span><span style="color: blue;">create</span><span style="color: green;">:</span>
<span style="color: #0600ff; font-weight: bold;">return</span> CreateContact<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">case</span> ContactCanonicalHeaderAction<span style="color: green;">.</span><span style="color: blue;">update</span><span style="color: green;">:</span>
<span style="color: #0600ff; font-weight: bold;">return</span> UpdateContact<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">case</span> ContactCanonicalHeaderAction<span style="color: green;">.</span><span style="color: blue;">delete</span><span style="color: green;">:</span>
<span style="color: #0600ff; font-weight: bold;">return</span> DeleteContact<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">default</span><span style="color: green;">:</span>
<span style="color: #0600ff; font-weight: bold;">throw</span> <span style="color: green;">new</span> Exception<span style="color: green;">(</span><span style="color: #666666;">"Invalid action."</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: green;">}</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
Here is the code to retrieve a contact. We look up the contact by
using it’s email address, then we enrich the message with the data we
got from CRM.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Retrieve a contact from CRM.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <returns>The contact that was retrieved.</returns></span>
<span style="color: #0600ff; font-weight: bold;">private</span> XmlDocument RetrieveContact<span style="color: green;">(</span><span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Get the contact we want to retrieve</span>
<span style="color: #0600ff; font-weight: bold;">var</span> retrievedContact <span style="color: green;">=</span> GetContactByEmailAddress<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Set the values from the retrieved contact on the contact that will be returned as an XML document</span>
<span style="color: teal; font-style: italic;">// Basicly, we do a mapping from the result of the query to the BizTalk document</span>
_contact<span style="color: green;">.</span><span style="color: blue;">Body</span><span style="color: green;">.</span><span style="color: blue;">ID</span> <span style="color: green;">=</span> retrievedContact<span style="color: green;">.</span><span style="color: blue;">Id</span><span style="color: green;">.</span><span style="color: blue;">ToString</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
_contact<span style="color: green;">.</span><span style="color: blue;">Body</span><span style="color: green;">.</span><span style="color: blue;">Name</span> <span style="color: green;">=</span> retrievedContact<span style="color: green;">.</span><span style="color: blue;">LastName</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Return the contact as an XML document</span>
<span style="color: #0600ff; font-weight: bold;">return</span> HelperMethods<span style="color: green;">.</span><span style="color: blue;">CreateXmlDocument</span><span style="color: green;">(</span>_contact<span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
As you can see, we use a method called GetContactByEmailAddress,
which is used to retrieve all contacts with a certain email address.
Since we assume the email address is unique, this should return one
contact.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Get a contact by looking it up by email address.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <returns>The contact belonging with the email address specified in the BizTalk message.</returns></span>
<span style="color: #0600ff; font-weight: bold;">private</span> Contact GetContactByEmailAddress<span style="color: green;">(</span><span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Get the contact by looking it up by email address</span>
<span style="color: teal; font-style: italic;">// The email address should be treated as a primary key, and therefor should never change</span>
<span style="color: #0600ff; font-weight: bold;">var</span> contacts <span style="color: green;">=</span> CRMActions<span style="color: green;">.</span><span style="color: blue;">RetrieveMultipleEntities</span><span style="color: green;">(</span>Contact<span style="color: green;">.</span><span style="color: blue;">EntityLogicalName</span>, GetEmailAddressFilter<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Check if any contacts were found</span>
<span style="color: #0600ff; font-weight: bold;">if</span> <span style="color: green;">(</span>contacts<span style="color: green;">.</span><span style="color: blue;">Any</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Seeing how the email address should be unique, we can simply get the first contact</span>
<span style="color: #0600ff; font-weight: bold;">return</span> contacts<span style="color: green;">.</span><span style="color: blue;">First</span><span style="color: green;">(</span><span style="color: green;">)</span> <span style="color: #0600ff; font-weight: bold;">as</span> Contact<span style="color: green;">;</span>
<span style="color: green;">}</span>
<span style="color: teal; font-style: italic;">// The contact could not be found</span>
<span style="color: #0600ff; font-weight: bold;">throw</span> <span style="color: green;">new</span> Exception<span style="color: green;">(</span><span style="color: #666666;">"No contact exists with this email address."</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
We use another method here, GetEmailAddressFilter. This method simply
creates a list of ConditionExpressions which will be used to set up the
query.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Create a filter that uses the email address.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <returns></returns></span>
<span style="color: #0600ff; font-weight: bold;">private</span> List<span style="color: green;"><</span>ConditionExpression<span style="color: green;">></span> GetEmailAddressFilter<span style="color: green;">(</span><span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: #0600ff; font-weight: bold;">return</span> <span style="color: green;">new</span> List<span style="color: green;"><</span>ConditionExpression<span style="color: green;">></span>
<span style="color: green;">{</span>
<span style="color: green;">new</span> ConditionExpression
<span style="color: green;">{</span>
AttributeName <span style="color: green;">=</span> Constants<span style="color: green;">.</span><span style="color: blue;">ContactEmailAddressColumnName</span>,
<span style="color: #0600ff; font-weight: bold;">Operator</span> <span style="color: green;">=</span> ConditionOperator<span style="color: green;">.</span><span style="color: blue;">Equal</span>,
Values <span style="color: green;">=</span> <span style="color: green;">{</span> _contact<span style="color: green;">.</span><span style="color: blue;">Body</span><span style="color: green;">.</span><span style="color: blue;">EmailAddress</span> <span style="color: green;">}</span>
<span style="color: green;">}</span>
<span style="color: green;">}</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
The next method will be used to create a new contact. We insert the
new contact into CRM, and return the message with the new ID set we got
from CRM.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Create a contact in CRM.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <returns>The contact we just created, including the new ID.</returns></span>
<span style="color: #0600ff; font-weight: bold;">private</span> XmlDocument CreateContact<span style="color: green;">(</span><span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Create a new contact</span>
Contact contactToUpdate <span style="color: green;">=</span> <span style="color: green;">new</span> Contact<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Set the values of the contact</span>
<span style="color: teal; font-style: italic;">// Basicly, we do a mapping from the BizTalk document to a CRM contact</span>
contactToUpdate<span style="color: green;">.</span><span style="color: blue;">LastName</span> <span style="color: green;">=</span> _contact<span style="color: green;">.</span><span style="color: blue;">Body</span><span style="color: green;">.</span><span style="color: blue;">Name</span><span style="color: green;">;</span>
contactToUpdate<span style="color: green;">.</span><span style="color: blue;">EMailAddress1</span> <span style="color: green;">=</span> _contact<span style="color: green;">.</span><span style="color: blue;">Body</span><span style="color: green;">.</span><span style="color: blue;">EmailAddress</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Create the contact</span>
_contact<span style="color: green;">.</span><span style="color: blue;">Body</span><span style="color: green;">.</span><span style="color: blue;">ID</span> <span style="color: green;">=</span> CRMActions<span style="color: green;">.</span><span style="color: blue;">CreateEntity</span><span style="color: green;">(</span>contactToUpdate<span style="color: green;">)</span><span style="color: green;">.</span><span style="color: blue;">ToString</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Return the contact as an XML document</span>
<span style="color: #0600ff; font-weight: bold;">return</span> HelperMethods<span style="color: green;">.</span><span style="color: blue;">CreateXmlDocument</span><span style="color: green;">(</span>_contact<span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
Now let’s create a method used to update an existing contact. We
first retrieve the contact by looking it up in CRM using it’s email
address. We then set the new data, and then update the contact in CRM.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Update a contact in CRM.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <returns>The contact we updated with it's new values.</returns></span>
<span style="color: #0600ff; font-weight: bold;">private</span> XmlDocument UpdateContact<span style="color: green;">(</span><span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Get the contact we want to update </span>
<span style="color: #0600ff; font-weight: bold;">var</span> contactToUpdate <span style="color: green;">=</span> GetContactByEmailAddress<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Set the new values on the contact</span>
contactToUpdate<span style="color: green;">.</span><span style="color: blue;">LastName</span> <span style="color: green;">=</span> _contact<span style="color: green;">.</span><span style="color: blue;">Body</span><span style="color: green;">.</span><span style="color: blue;">Name</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Update the contact in CRM</span>
CRMActions<span style="color: green;">.</span><span style="color: blue;">UpdateEntity</span><span style="color: green;">(</span>contactToUpdate<span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Return the updated contact</span>
<span style="color: #0600ff; font-weight: bold;">return</span> HelperMethods<span style="color: green;">.</span><span style="color: blue;">CreateXmlDocument</span><span style="color: green;">(</span>RetrieveContact<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
And finally, the method to delete a contact. This again looks up the
contact in CRM by using it’s email address, and then deletes the
contact. Since we use the IsProcessed variable in the message to
determine if a message has been processed, we create a new canonical
contact to return to the orchestration.<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;"><span style="color: teal; font-style: italic;">/// <summary></span>
<span style="color: teal; font-style: italic;">/// Delete a contact in CRM.</span>
<span style="color: teal; font-style: italic;">/// </summary></span>
<span style="color: teal; font-style: italic;">/// <returns></returns></span>
<span style="color: #0600ff; font-weight: bold;">private</span> XmlDocument DeleteContact<span style="color: green;">(</span><span style="color: green;">)</span>
<span style="color: green;">{</span>
<span style="color: teal; font-style: italic;">// Get the contact we want to delete</span>
<span style="color: #0600ff; font-weight: bold;">var</span> contactToDelete <span style="color: green;">=</span> GetContactByEmailAddress<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Delete the entity from CRM</span>
CRMActions<span style="color: green;">.</span><span style="color: blue;">DeleteEntity</span><span style="color: green;">(</span>contactToDelete<span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: teal; font-style: italic;">// Return a new contact to BizTalk, which just specifies that processing succeeded</span>
<span style="color: #0600ff; font-weight: bold;">var</span> doc <span style="color: green;">=</span> <span style="color: green;">new</span> ContactCanonical<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span>
doc<span style="color: green;">.</span><span style="color: blue;">Header</span><span style="color: green;">.</span><span style="color: blue;">IsProcessed</span> <span style="color: green;">=</span> <span style="color: #0600ff; font-weight: bold;">true</span><span style="color: green;">;</span>
<span style="color: #0600ff; font-weight: bold;">return</span> HelperMethods<span style="color: green;">.</span><span style="color: blue;">CreateXmlDocument</span><span style="color: green;">(</span>doc<span style="color: green;">)</span><span style="color: green;">;</span>
<span style="color: green;">}</span></pre>
</td></tr>
</tbody></table>
</div>
That was all the code we need. Now to be able to use all this, we need to create an orchestration.<br />
<a href="http://blog.eldert.net/wp-content/uploads/2012/06/WorkOnContactOrchestration.jpg"><img alt="" class="aligncenter size-full wp-image-994" height="649" src="http://blog.eldert.net/wp-content/uploads/2012/06/WorkOnContactOrchestration.jpg" title="WorkOnContactOrchestration" width="558" /></a><br />
On my receive I use the following filter:<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="dos" style="font-family: monospace;"><span style="color: #33cc33;">(</span>BTS.MessageType == "http://www.company.com/BizTalk/Schemas/v100#ContactCanonical"<span style="color: #33cc33;">)</span>
<span style="color: #33cc33;">&&</span> <span style="color: #33cc33;">(</span>Company.BizTalk.Algemeen.Schemas.IsProcessed == false<span style="color: #33cc33;">)</span></pre>
</td></tr>
</tbody></table>
</div>
And in my expression I use this:<br />
<div class="wp_syntax">
<table><tbody>
<tr><td class="code"><pre class="csharp" style="font-family: monospace;">crmServiceProxyContact <span style="color: green;">=</span> <span style="color: green;">new</span> Company<span style="color: green;">.</span><span style="color: blue;">BizTalk</span><span style="color: green;">.</span><span style="color: blue;">CRM</span><span style="color: green;">.</span><span style="color: blue;">BusinessComponents</span><span style="color: green;">.</span><span style="color: blue;">CRMServiceProxyContact</span><span style="color: green;">(</span>contactIncoming<span style="color: green;">)</span><span style="color: green;">;</span>
contactResponse <span style="color: green;">=</span> crmServiceProxyContact<span style="color: green;">.</span><span style="color: blue;">DoWorkOnContact</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">;</span></pre>
</td></tr>
</tbody></table>
</div>
That is all, you can use this framework do do your communication with
CRM. As you can see it is some more work then we are used to by using
adapters, but it does work quite nicely. I have uploaded the entire
solution <a href="https://skydrive.live.com/redir?resid=3FE8758B2C2B58D2%21143" target="_blank">here</a>. Hopefully it can save you some time when integrating CRM 2011.<br />
</div>
Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com1tag:blogger.com,1999:blog-847413858566642421.post-41759400973655355162013-09-27T06:31:00.000-07:002013-09-27T06:31:07.708-07:00Multiple Instances in CRM Online<h3 class="post-name">
<br /></h3>
<br />With the December
2012 Service update (aka "Polaris"), we introduced the ability for
customers to provision and manage multiple CRM instances within a single
subscription.<br />
This opens up new enterprise customer scenarios such as separate
instances for departmental use, regional use, development/test instances
for application lifecycle management and more.<br />
<a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-32/5444.a1.png"><img alt="" border="0" src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-32/5444.a1.png" /></a><br />
<br />
<strong>Use Case for Multiple Instances</strong><br />
Logically, you can imagine multiple CRM Online instances for an
organization structured similar to multi-tenant high-rise or building.
Each floor within a building can be logically considered as an
application (Sales/Service, Vendor mgmt., Wealth mgmt., etc) and each
unit within a floor can be considered as an instance for a specific
purpose such as production (final), training, testing, development, etc.<br />
<br />
<a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-32/7585.a2a.png"><img alt="" border="0" src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-32/7585.a2a.png" /></a><br />
The need for multiple instances varies from one organization to
another. Some organizations might require just a few and others might
need large number of instances depending upon their business needs.<br />
It is important to note that multiple instances cannot be created
across the globe. Currently, all the additional instances can only be
created within the same geo (Americas, EMEA or APAC) as the
subscription.<br />
<br />
<strong>Scenario: Departmental Use</strong><br />
<span style="background-color: yellow;">So - why would an
organization need multiple instances of CRM Online if data segregation
can be achieved using business units and role-based forms?</span><br />
<br />
<a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-32/0880.a3.png"><img alt="" border="0" src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-32/0880.a3.png" /></a><br />
A common use for additional instances is to have separate instances
for each department or region within an organization. For example a
large financial organization might need separate instances for retail
banking division, wealth management vision, separate ones for insurance
business and vendor mgmt., etc. Another example might be to have
separate instances for different regions (Northwest, South, East, etc)
as the policies and business procedures might significantly vary from
one region to another within the same organization.<br />
<span style="background-color: yellow;">Multiple instances are
needed when segregation of plugins/workflows/admin resources are
required which cannot be easily isolated using business units in CRM</span>.
In the below example - when Retail banking needs to make a change or
install a 3rd party component for their needs, you wouldn’t want the
wealth management users to be affected by those changes.<br />
Additional instances are charged at a monthly rate per instance and
do not require additional CRM user licenses (CALs). Each user with a CRM
license can access all of the instances in their subscription. When a
user is part of multiple instances, they’ll see an instance picker while
logging into CRM Online. Security can also be applied to restrict users
only to specific instances.<br />
<br />
<strong>Instance Security Groups</strong><br />
Security groups defined within the Microsoft Online Services Portal
(MOSP) controls access to various CRM Online instances. Any security
group available within the MOSP can be used to control access to a CRM
instance. If a security group is not associated with a CRM instance, all
users with a CRM license will be created as users in the instance. If a
security group is associated with an instance, only users with CRM
licenses that are members of the security group will be created as users
in the CRM instance<br />
<br />
<a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-32/2313.a4.png"><img alt="" border="0" src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-32/2313.a4.png" /></a><br />
Security groups can also be nested, meaning one security group can
encompass other security groups making it easy to map complex security
and access requirements that is illustrated in the slide. For example,
you can easily create an “All Sales” group that includes Corporate,
Field Management and Field Sales/Service groups.<br />
Administrators can view and create security groups within the MOSP.
If you have configured your subscription for Active Directory
synchronization, security groups you create in Active Directory will be
replicated to the MOSP and can be associated with your CRM Online
instance for simplified integration. Of course security groups within
Active Directory can be used for controlling access to other products
such as SharePoint, network shares and other applications making it
easier to achieve end-to-end enterprise security.Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0tag:blogger.com,1999:blog-847413858566642421.post-47219446732624557262013-09-23T22:02:00.003-07:002013-09-23T22:02:53.120-07:00Implementing Dynamics CRM on an Enterprise-Wide Scale Using a Hub and Spoke Strategy<h1>
</h1>
Implementing Microsoft Dynamics CRM across an enterprise can
deliver tremendous value for organizations, but it requires addressing
several significant challenges (such as the need for functional
diversity between departments, organizational security requirements,
enterprise-wide standardization, and enterprise-wide reporting.) The
flexibility of Dynamics CRM provides many different architecture
alternatives for enterprise implementation, each with its own
characteristics and tradeoffs, and for many organizations, a
hub-and-spoke architecture may be the best approach for answering the
challenges presented by enterprise-wide implementation of CRM.<br />
<strong>Hub and Spoke Strategy</strong><br />
This deployment strategy utilizes Microsoft Dynamics CRM’s
multi-tenancy capabilities to create a “hub and spoke” architecture. At
the center is a hub that serves as a data master. It aggregates all the
common data elements and manages which organizations or “spokes” are
setup to see the data. This allows data to be shared among multiple
organizations through an integration layer.<br />
This model lends itself to some centralized administration to support
the hub organization and the integration platform, but can support
decentralized administration for the spokes.<br />
<img alt="Implementing Dynamics CRM on an Enterprise-Wide Scale Using a Hub and Spoke Strategy" src="http://www.madronasg.com/sites/madronasg.com/files/shannonblogpic1.png" style="float: left; height: 484px; width: 490px;" /><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<strong>The Hub</strong><br />
The hub contains only the most basic and fundamental data elements
needed to represent the shared data and serves as the central data
aggregator. As the data at the hub is added or modified (by either a
spoke or the integration), it pushes out those changes to the spokes.
The hub should make the call to push to the spokes as a proxy user, “Hub
Proxy User”. The Hub Proxy User needs to be granted sufficient rights
to make the call in each of the spoke organizations.<br />
Additionally, the hub needs a way to identify each of the spokes, or
“subscribers” that are attached. The best way to achieve this is to
create a custom entity that tracks the URL to the organization as well
as the organization name for each spoke.<br />
<strong>The Spoke</strong><br />
For each spoke to be able to connect to the hub, a baseline solution
should be created with the required data elements (entities, fields,
etc.), web resources, and plugin assemblies required to achieve
integration with the hub. Once the baseline solution is deployed, the
business group can extend the data model and apply any business logic
that they need to achieve individual business goals. When data mastered
by the hub is created or modified, the spoke pushes the changes to the
hub. The hub, in turn, pushes out those changes to the other spokes.
The spoke makes the call to push to the hub as a proxy user, Spoke Proxy
User. The Spoke Proxy User should be granted only the rights needed to
meet their business goals and the enterprise security requirements. If
the spoke should not be allowed to modify organizational data, then the
Spoke Proxy User should be restricted as such.<br />
<strong>Integration Technology</strong><br />
There are many different choices for the integration technology. One
example is to use plugins to push data between the hub and spokes. The
diagram below illustrates how the integration using plugins would work
for contact updates (at either hub or spoke).<br />
<img alt="Implementing Dynamics CRM on an Enterprise-Wide Scale Using a Hub and Spoke Strategy" src="http://www.madronasg.com/sites/madronasg.com/files/shannonblogpic2.png" style="float: left; height: 600px; width: 336px;" /><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<strong>Summary</strong><br />
Implementing CRM applications in enterprise environments present unique challenges which can include:<br />
<ul>
<li>
Functional Diversity among Business Groups</li>
<li>
Organizational Privacy, Security and Compliance Restrictions</li>
<li>
Standardization</li>
<li>
Enterprise-wide Reporting</li>
</ul>
Microsoft Dynamics CRM provides the capability to address each of
these challenges in a variety of implementation scenarios.
Multi-tenancy with integration using plugins are one way to create a
“hub and spoke” model to solve many enterprise-wide goals, while giving
individual departments functional autonomy with their CRM system.Anonymoushttp://www.blogger.com/profile/02137635535636546647noreply@blogger.com0