Social Networking Accelerator not downloading data

Oct 20, 2009 at 1:04 PM

Hi,

I have just installed the SN accelerator on a server here.  The install completed fine (took a few tries to get the right combination of admin. permissions etc), workflows all published etc, but struggling to get it to download any data.  The workflows are failing.

I notice that when I try to run the on-demand workflows they fail with the error "The date/time format is not valid, or the value is outside the supported range."

Is anyone else experiencing similar difficulties?

We suspect that this may be because we use the European date format on our systems (dd/mm/yy) rather than the US mm/dd/yy format.......

Any ideas how to resolve this?  We are really keen to put this accelerator through it's paces!

Thanks,
Becky

 

Oct 21, 2009 at 10:38 AM

We are getting the same issue. You are correct it is to do with date format. I am running on a test system, and if I have the date on UK I get the same error, but change it to US I don't get the date error, but I do get a much more generic error, but this could be something else at it is the first time I have used twitter, so not totally sure what I am doing!!! I am going to try a little debugging and will let you know if I find out anything more.

 

Thanks

 

Rob

Oct 21, 2009 at 11:13 AM

I think I have now managed to resolve all the problems this appears to have. 

1. To resolve the Date/Time issue I had to edit the MSA_Twitter Workflow Assembly in Visual Studio. 

In the file mas_datapump.cs, in the function BuildDynEntity change the section for the case of CrmDateTimeProperty from 

                    CrmNumberProperty crmNumberProperty = new CrmNumberProperty();

                    CrmNumber crmNumber = new CrmNumber();

                    crmNumber.Value = Convert.ToInt32(CRMAttrValue);

                    crmNumberProperty.Value = crmNumber;

                    crmNumberProperty.Name = CRMAttrName;

                    crmEntity.Properties.Add(crmNumberProperty);

to

 

                    CrmDateTimeProperty crmDateTimeProperty = new CrmDateTimeProperty();
                    CrmDateTime crmDateTimeValue = new CrmDateTime();
                    DateTime tempDateTimeValue = DateTime.ParseExact(CRMAttrValue, "ddd MMM dd HH:mm:ss zzz yyyy", null);
                    crmDateTimeValue = CrmDateTime.FromUniversal(tempDateTimeValue.ToUniversalTime());
                    crmDateTimeProperty.Value = crmDateTimeValue;
                    crmDateTimeProperty.Name = CRMAttrName;
                    crmEntity.Properties.Add(crmDateTimeProperty);

                    CrmDateTimeProperty crmDateTimeProperty = new CrmDateTimeProperty();

                    CrmDateTime crmDateTimeValue = new CrmDateTime();

                    DateTime tempDateTimeValue = DateTime.ParseExact(CRMAttrValue, "ddd MMM dd HH:mm:ss zzz yyyy", null);

                    crmDateTimeValue = CrmDateTime.FromUniversal(tempDateTimeValue.ToUniversalTime());

                    crmDateTimeProperty.Value = crmDateTimeValue;

                    crmDateTimeProperty.Name = CRMAttrName;

                    crmEntity.Properties.Add(crmDateTimeProperty);

Then rebuilt the DLL and re-registered it with CRM.

I have not fully check that this code works correctly with different timezones so times may be out if you are not in GMT. I am happy to put the recompiled dll somewhere if it would help.

The second problem is to to with debugging. The assemblies debug to a direction of c:\debug\source_ as this does not exist the system will error if debugging is turned on, which it is. To turn this off unpublish and edit all the twitter workflows, and anywhere the MSA Social Networking custom workflow assembly is called change the debug value from true to false. The republish the workflows.

Once I did all this it appears to be working. Or should I so I am not getting any errors, now just need to work out twitter!!!

 

Hope this is of some help

 

Robert Mottram

 

Oct 21, 2009 at 12:14 PM

Hi,

Thanks for the update - looks like we were on the right lines afterall with the date/time issue!

Would love a copy of the updated dll if you are able to share - save us time re-doing it.

Thanks,
Becky

Oct 21, 2009 at 12:18 PM

More then happy to share the DLL. If you let me have your email address I will send it to you, or happy to upload it somewhere if anyone knows of a good place to put it.

Oct 21, 2009 at 12:30 PM

I have uploaded the dll to Microsoft skydrive if it helps any one.

http://cid-b3aa269435e4c766.skydrive.live.com/self.aspx/.Public/MSA_Twitter.dll

Rob

Oct 21, 2009 at 5:13 PM

error still exists in german CRM 4.0 with complete german environment...

 

>Workflow terminated: {9C76D40D-57BE-DE11-B4D2-003005EDF6C1} - System.FormatException: Die Zeichenfolge wurde nicht als gültiges DateTime erkannt.

bei System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
bei System.DateTime.ParseExact(String s, String format, IFormatProvider provider)
bei MSA.Integration.inbound.BuildDynEntity(DynamicEntity crmEntity, String CRMAttrName, String CRMAttrValue, String CRMDataType, String CrmLookupEntity)
bei MSA.Integration.inbound.BuildDynEntity(DynamicEntity crmEntity, String CRMAttrName, String CRMAttrValue, String CRMDataType)

bei MSA.Integration.inbound.CrmCreate(String crmEntityName, XElement CrmRecord, ICrmService crmService)
bei MSA.Integration.inbound.CrmTransaction(ICrmService crmService, String xmlIn)
bei MSA.SocialNetworking.GetReplies.Execute(ActivityExecutionContext executionContext)
bei System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
bei System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
bei System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
bei System.Workflow.Runtime.Scheduler.Run()

 

error must be somewhere here

<font size="2">

 

</font>

                case "CrmDateTimeProperty":
                    CrmDateTimeProperty crmDateTimeProperty = new CrmDateTimeProperty();
                    CrmDateTime crmDateTimeValue = new CrmDateTime();
                    crmDateTimeValue.Value = DateTime.ParseExact(CRMAttrValue, "ddd MMM dd HH:mm:ss zzz yyyy", null).ToString();
                    crmDateTimeProperty.Value = crmDateTimeValue;
                    crmDateTimeProperty.Name = CRMAttrName;
                    crmEntity.Properties.Add(crmDateTimeProperty);
                    break;

 

 

Oct 21, 2009 at 5:44 PM

trebor0l7 

Have you made the changes I have noted above, rebuilt the dll and updated CRM. You will then need to restart the Async service to get it to work. 

Oct 22, 2009 at 1:31 AM
rmottram wrote:

                    DateTime tempDateTimeValue = DateTime.ParseExact(CRMAttrValue, "ddd MMM dd HH:mm:ss zzz yyyy", null);

I believe there is an error in the format string for DateTime.ParseExact(). The "zzz" format string specifies a time zone in hours and minutes, expressed as a decimal. However, Twitter returns a timezone in hours as an integer, therefore the format string should be "zz".

--Tim 

Oct 22, 2009 at 6:22 PM

Thanks for the feedback all - especially rmotram, NameOfTheDragon and trebor017. We'll take a look at this as soon as possible,

Barry

Oct 30, 2009 at 10:22 PM

I haven't completely tested this, but it seems that adding the following to your MSCRM web.config will also resolve the problem:

 <System.Workflow.ComponentModel.WorkflowCompiler>
    <authorizedTypes>
       <authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Globalization" TypeName="CultureInfo" Authorized="True"/>

Nov 7, 2009 at 6:34 PM

Sadly this doesnt seem to work on our system - can we get a definitive statement from MS on what's needed to get this working with date formats other than US please.

thanks


Roger

Nov 12, 2009 at 10:19 PM

check both the code changes or DLL provided by rmottram

*AND*

that the System.Globalization entry exists in your crm web.config as per mhooper post. 

you will need *both* of these to make this work outside of the US default timezones...

Nov 13, 2009 at 2:07 PM

Thanks for your help - this worked as you said - enjoying using it now!

Roger

Dec 14, 2009 at 2:02 PM

Hi,

hi i followed every step, i changed the source code to

                case "CrmDateTimeProperty":
                    CrmDateTimeProperty crmDateTimeProperty = new CrmDateTimeProperty();
                    CrmDateTime crmDateTimeValue = new CrmDateTime();
		 crmDateTimeValue.Value = DateTime.ParseExact(CRMAttrValue, "ddd MMM dd HH:mm:ss zz yyyy", null).ToString();
                    crmDateTimeProperty.Value = crmDateTimeValue;
                    crmDateTimeProperty.Name = CRMAttrName;
                    crmEntity.Properties.Add(crmDateTimeProperty);
                    break;
also built the new dll file, registered it into CRM Database...
error in CRm tarce file is still the same...
>Workflow terminated: {A0E949AE-B7E8-DE11-AF49-001D92A21828} - System.FormatException: Die Zeichenfolge wurde nicht als gültiges DateTime erkannt.
bei System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
bei System.DateTime.ParseExact(String s, String format, IFormatProvider provider)
bei MSA.Integration.inbound.BuildDynEntity(DynamicEntity crmEntity, String CRMAttrName, String CRMAttrValue, String CRMDataType, String CrmLookupEntity)
bei MSA.Integration.inbound.BuildDynEntity(DynamicEntity crmEntity, String CRMAttrName, String CRMAttrValue, String CRMDataType)
Is it possible to provide us with working assemblies for german customers..?
whould be great...