Updating CRM datetime field and getting serializedForm error
-
Wednesday, August 04, 2010 5:59 PM
In BizTalk 2009 Enterprise 64-bit, running on Windows Server 2008 Standard 64-bit, and connecting to CRM 4.0 we are getting an error while trying to update two datetime fields in CRM.
<ReturnCode>0</ReturnCode>
<ErrorCode>0x80040203</ErrorCode>
<ErrorString>serializedForm :: Server was unable to process request.</ErrorString>
<Retryable>0</Retryable>
We have tried a number of different functoids in the mapping, including IsNill->Logical Not, Logical Date, Logical String, Logical Existence, all of which went into a Value Mapping functoid which then went to the values in the CRM update schema. I have also tried a scripting functoid that would return an empty string (both return ""; and return String.Empty;) and none of them have worked. The only way we've gotten this to work so far is to put in a default value, or not include them in the update.We are updating the account entity, and since these two fields need to be updated, we can't just exclude them from the update. Not every account has to have a value for these either. In CRM they are not required, and have no default value. We have an existing Scribe job that handles these updates right now, and it doesn't have any issues updating using null values.
An example of what we are doing, and how it pans out is...
The account entities are actually dealers for our company, so one of the datetime fields is when they started as a dealer with us. An account does not have to be a dealer to exist in CRM, they can still be a prospective dealer. If an account is a prospect, then there is obviously no date for when they started as a dealer with us, so the value would be null. The other datetime that we are trying to update is along similar lines.
Any help on this issue is greatly appreciated.
All Replies
-
Wednesday, August 04, 2010 7:07 PM
Hi,
The 0x80040203 return value indicates an invalid argment.
You have indicated that when you leave them(Date values) out the update is successful. This implies that the generated Account entity schema element which holds the date value is defined as optional.(min = 0). This is correct based on your business requirements.
Next when you enter a default value for them(Date values) the update is successful. This implies the the system(BizTalk) know how to generate the correct DateTime format for the generated Account entity schema.
Next steps would be to ensure that the format of the DateTime values you are sending match the format of the default DateTime value in your message being sent to CRM.
I believe the default format of XSD xs:dateTime is YYYY-mm-ddThh:mi:ss.
Hope it helps.
Thanks,
William
- Edited by William Cummings1 Wednesday, August 04, 2010 7:07 PM YYYY vs YYY
-
Wednesday, August 04, 2010 7:39 PMReading your response, and my original post, I think I failed to mention that it works fine if a value is present in the source schema. It only happens when we try to pass a null value.
-
Wednesday, August 04, 2010 7:53 PM
Why do you want to pass a null value. If the date is needed for the update, CRM is expecting a value and won't except null.
Try to use a string concat functoid and enter "2010-01-01T00:00:00.000" and pass it to the values. If this works then you need a date. This would lead to two possible solutions:
1. Hand over default values that are ok for CRM system.
2. Read the actual dates from CRM and put them into the update message so that you will update your data with the same dates. This would of course cause one additional request / response cycle, but would give you valid data.
Would be
Source node --> IsDate --> Value Mapping (1) --> Node
--> Source node --> Value Mapping (1)
Source node --> IsDate --> LogicalNot --> Value Mapping (2) --> Node
--> default date (or original crm date) --> Value Mapping (2)
If you like my post or consider it as a valid answer, please use the buttons to show me - Oliverhttp://biztalk.hauth.me
-
Wednesday, August 04, 2010 8:33 PM
The reason for wanting to pass null, is because not all accounts have to have both (or either) datetime field, but there are many that do have one or both which then need to be updated.
CRM DOES accept null values, because our existing Scribe job is capable of using them, and if you manually add an account IN CRM, it allows it just fine. In my original post, I had specified that we don't want to use default values. That causes problems with concurrency later, such as "This account says it's not a dealer, but it says they have a start date..." which is used in several places, and would be outside the scope of this project to "fix"
These come from the Schema for account_Entities generated from CRM if it helps any:
< s:element minOccurs =" 0 " maxOccurs =" 1 " name =" new_dealerstartdate " nillable =" true " type =" s3:CrmDateTime " />
< s:element minOccurs =" 0 " maxOccurs =" 1 " name =" new_dealerbusinessstartdate " nillable =" true " type =" s3:CrmDateTime " />
I'm basically looking for a way that would send the destination schema the value if it exists, or don't send anything if it doesn't, other than the ones I have tried.
Thanks for the replies so farEDIT:
also, this is what the two fields look like in the message that gets sent to CRM:
< new_dealerstartdate > 1985-06-01T00:00:00 </ new_dealerstartdate >
<new_dealerbusinessstartdate />The dealerstartdate is fine, but when it gets to dealerbusinessstartdate is when it errors out with that serializedForm error from the first post. The only way we've figured out for this to get it working, is that if the datetime field doesn't exist in the input schemas, then the entire field in the message needs to be gone (and not just empty like dealerbusinessstartdate)
-
Thursday, August 05, 2010 6:19 PM
Hi,
I can think of two ways to prevent/remove the creation of empty elements. (In order of my preference)
1. ) Modify Account_Entities schema.
In your Account_Entities schema SchemaInfo node: suppress_empty_nodes="true" and each of the optional element to Nilable=true and minOccours=0)
2.) Remove the empty nodes using custom functiod and XSLT
Thanks,
William
-
Thursday, August 05, 2010 9:33 PM
1. ) Modify Account_Entities schema.
In your Account_Entities schema SchemaInfo node: suppress_empty_nodes="true" and each of the optional element to Nilable=true and minOccours=0)
I like the looks of that answer, however I'm not sure I am positive how exactly to do that. In the account_Entities schema, there's supposed to be a node named SchemaInfo? I can't seem to see such a node... But the Nilable=true and minOccurs=0 are already set up
-
Friday, August 06, 2010 2:18 PM
The solution turned out to be relatively simple (yet I never found it anywhere online for some reason...)
I set up some functoids in the map that used the logical date functoid, and if it was a logical date, then a Value Mapping functoid sent the value to the datetime field. The logical date functoid also went to a logical NOT functoid which then went to two Value Mapping functoids. the first value mapping functoid returns the date of 1901-01-01 to the datetime field, and the second one simply returns the constant true and goes to the IsNull attribute in the datetime field in the destination schema.
Summed up, I never found anywhere that said the datetime field needed to have a valid date in it in order to set IsNull = "true" for it to work...
- Marked As Answer by cjalbee Friday, August 06, 2010 2:18 PM

