Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Unable to update records using XRMService Toolkit

$
0
0

I have following code snippet to update a certain record using XRMServiceToolkit but it throws exception as well. I could not find out the reason. any idea what I am missing in it.

function updateOrderStatus(){
var orders = XrmServiceToolkit.Soap.Fetch(query);

var value = Xrm.Page.getAttribute(attr);
var osId = orders[0].attributes['new_testid'];
var update = new XrmServiceToolkit.Soap.BusinessEntity("new_test", osId);

update.attributes["new_assignedto"] = { id: value.getValue()[0].id, logicalName: 'systemuser', type: 'EntityReference' };
update.attributes["new_assignedtodate"] = { value: new Date(), type: "DateTime" };

var result = XrmServiceToolkit.Soap.Update(update);
}


Exception:

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter schemas.microsoft.com/.../Services:request. The InnerException message was 'There was an error deserializing the object of type Microsoft.Xrm.Sdk.OrganizationRequest. The value '[object Object]' cannot be parsed as the type 'Guid'.'.  Please see InnerException for more details.



Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>