Showing posts with label Social Networking. Show all posts
Showing posts with label Social Networking. Show all posts

Sunday, July 18, 2010

MS CRM Social Networking Workflow DateTime Format Error.


The accelerator code as supplied does not correctly parse Twitter timestamps. DateTime.ParseExact breaks on the odd time zone value, which in (GMT/UK) comes from twitter with the value "+0000".

DateTime.ParseExact can use a format string of "z", "zz", or "zzz", corresponding to "+0", "+00" or "+00:00" respectively, none of which match the Twitter format.

You need to change the code in teh BuildDynEntity() method, in msa_datapump.cs, as follows:

case "CrmDateTimeProperty":
//Twitter timestamps contain odd timezone specifier "+0000" that doesn;t work
// well with DateTime.ParseExact().
CrmDateTimeProperty crmDateTimeProperty = new CrmDateTimeProperty();
CrmDateTime crmDateTimeValue = new CrmDateTime();
DateTimeOffset parsedDateTime = DateTimeOffset.ParseExact(CRMAttrValue, "ddd MMM dd HH:mm:ss zzz yyyy", null);
DateTime localDateTime = new DateTime(parsedDateTime.Ticks, DateTimeKind.Local);
crmDateTimeProperty.Value = CrmDateTime.FromUser(localDateTime);
crmDateTimeProperty.Name = CRMAttrName;
crmEntity.Properties.Add(crmDateTimeProperty);
break;

Save / Complile / Build the assembly.

Register the assembly using plug-in registration tool.
Restart the Microsoft Crm Async Service.

Start Creating the Twitter User. Now the workflow won't failed (i mean it will not be on the Waiting state anymore !!!).

Hope this will resolves the issue.


MS CRM Social Networking Workflow Error (Twitter-Get External Updates / Missing Attributes)

Recently I've installed MS Social Networking Accelerator for MS CRM 4. The installation is very simple, it will get installed very easily. Once you installed and run you will encounter the Workflow errors:

Basically the MSA_snStatus Entity Customisation has some bugs. It does not include the below three attributes: You need to manually create those three attributes.

Open MS CRM App -> Go to Settings -> Go to Customisations -> Customise Entity -> Open MSA_snStatus entity -> Go to Attributes (left hand navigation panel)

Step 1. Add new attribute
Step 2. Specify attribute Display name = Contributors
Step 3. Specify attribute name = msa_snContributors [make sure your application default prefix is msa]
Step 4: datatype = nVarChar
Step 5: specify length = 200
Step 6: Save and clsoe

Repeat the same steps for below attributes:
2. MSA_snCoordinates attribute [Display name = Coordinates / nVarchar / 200]
3. MSA_snPlace attribute [Display name = Place / nVarchar / 200]

Save and Publish the entity.
Reload the MS CRM Application.

Start Creating the Twitter User. Now the workflow won't failed (i mean it will not be on the Waiting state anymore !!!).


Hope this will resolve the issue.