CRM 2011 SOP Integration Mode

How to turn on SOP Integration Mode in CRM 2011

If you want to integrate your CRM 2011 Organization with a separate ERP or Finance system using a product like Scribe or SmartConnect, Dynamics CRM 2011 SOP Integration Mode will make it much easier for you to do. It is not known much and hardly documented setting.

The “IsSOPIntegrationEnabled” setting makes the following changes:

  • Replaces the ‘Create Invoice’ button on the Sales Order ribbon with a ‘Submit Order’ button
  • Enables a series of ‘Submitted Status’ fields on the Sales Order entity and Sales Order properties window
  • Enables a ‘Submitted’ statecode value for the Sales Order entity
  • Allows you to specify an ‘Integration User’ that can then make changes to Sales Order and Invoice records through the SDK that would normally be read-only to all other users.

With integration mode enabled, this process flow is possible:

  1. CRM User submits a Sales Order (making the record read-only to normal users)
  2. Integration software picks up the CRM sales order and creates a record in your ERP system
  3. The CRM ‘Integration User’ account can write back to the CRM Sales Order to indicate that it has been successfully created in your ERP system.  This would need to happen through the SDK running in the context of the user account that has been marked as the integration user.
  4. The Finance Department can review the sales order, apply taxes and currency changes etc. to the record, then post it in the ERP system.
  5. The Integration picks up posted Invoices from your ERP system and creates a copy in CRM for reference by CRM users.
  6. As payments are applied to the invoice in your ERP system, another integration updates the payment status of the copy Invoice in CRM.

Turning this mode on takes a few steps, the “IsSOPIntegrationEnabled” value is held in the OrganizationBase table of your CRM Organization database.  Updates direct to SQL are unsupported, but Sonoma Partners have recently released this tool  that allows you to make changes to the OrganizationBase table in a supported way. But if you want to do it by yourself with C#, the following lines of codes will help you to do so.

public static void ActivateIntegrationMode(string CRM_USERNAME, string CRM_PASSWORD, string CRM_DOMAIN, string CRM_ORG_URL, bool turnOn)
{
ClientCredentials credentials = new ClientCredentials();
credentials.Windows.ClientCredential = new NetworkCredential(CRM_USERNAME, CRM_PASSWORD, CRM_DOMAIN);
Uri organizationUri = new Uri(CRM_ORG_URL);

using (OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(organizationUri, null, credentials, null))
{
IOrganizationService _serviceProxy = (IOrganizationService)serviceProxy;

Guid orgId = ((WhoAmIResponse)_serviceProxy.Execute(new WhoAmIRequest())).OrganizationId;
Guid userId = ((WhoAmIResponse)_serviceProxy.Execute(new WhoAmIRequest())).UserId;

//– Update Org to SOP Integration Mode
if (turnOn)
{
Entity org = new Entity(“organization”);
org[“issopintegrationenabled”] = true;
org[“organizationid”] = orgId;
_serviceProxy.Update(org);

//– Update User to Integration Mode
Entity user = new Entity(“systemuser”);
user[“systemuserid”] = userId;
user[“isintegrationuser”] = true;
_serviceProxy.Update(user);
}
else
{
Entity org = new Entity(“organization”);
org[“issopintegrationenabled”] = false;
org[“organizationid”] = orgId;
_serviceProxy.Update(org);

//– Update User to Integration Mode
Entity user = new Entity(“systemuser”);
user[“systemuserid”] = userId;
user[“isintegrationuser”] = false;
_serviceProxy.Update(user);
}
}
}

[Reference: http://crmuk.wordpress.com/2012/11/21/crm-2011-sop-integration-mode/]

Advertisement

Leave a comment

Filed under MS Dynamic CRM 2011, SOP Integration Mode

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s