This project is read-only.

Creating record with guid string as name

Jun 2, 2013 at 12:25 PM

While using the create method, I have encountered the following error when assigning a guid (e.g 98514d7c-af3b-414e-b038-62644c24b618) to the record name attribute.

Please advise.

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter The InnerException message was 'There was an error deserializing the object of type Microsoft.Xrm.Sdk.OrganizationRequest. The value '98514d7c-af3b-414e-b038-62644c24b618.pdf' cannot be parsed as the type 'Guid'.'. Please see InnerException for more details.
Feb 19, 2014 at 1:46 PM
I worked around the problem by changing the isGuid function which recognized any string containing GUID value and assigned GUID type to it.

The change I made is limiting the regular expression to string which represents an exact GUID value.
            _string.isGuid = function isGuid(value)
                return /^[a-z0-9]{8}(?:-[a-z0-9]{4}){3}-[a-z0-9]{12}$/i.test(value);