Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Problem with AssignRequest

$
0
0

Hello All,

I'm trying to transfer some contacts from one system user to another using a console app.

I've found plenty of examples of code and I think I have everything set up correctly. But when I make my call, I get an error message that I have not been able to find information about. I know what the message means (I've work with WCF elsewhere), but I don't know where I am supposed to make my fix.

Here's my error message:

Message=There was an error while trying to serialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:request. The InnerException message was 'Type 'Microsoft.Crm.Sdk.Messages.AssignRequest' with data contract name 'AssignRequest:http://schemas.microsoft.com/crm/2011/Contracts' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'.  Please see InnerException for more details.

Here's the code that I'm using:

 AssignRequest assign = new AssignRequest
                {
                    Assignee = new EntityReference("systemuser",recipientEntity.Id),
                    Target = new EntityReference("contact",thisContact.Id)
                };


                // Execute the Request
                _client.Execute(assign);

So it looks like the "KnownTypes" do not include "AssignRequest". But this doesn't make sense, since the UI can assign contacts as needed without any problems.

Any help is appreciated!

-tomas


Viewing all articles
Browse latest Browse all 8223

Trending Articles



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