web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

There was an error while trying to serialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:entity. The InnerException message was 'Type 'WindowsApplication3.ServiceReference1.EntityReference' with data contract name 'En

(0) ShareShare
ReportReport
Posted on by

i have a function  this function this return this product 

Private Function FindProduct(ByVal Name As String) As String
FindProduct = ""
Dim CS As New OService.ColumnSet
CS.Columns = {"productid", "name"}
Dim QE As New OService.QueryExpression
QE.ColumnSet = CS
QE.EntityName = "product"

Dim CE As New OService.ConditionExpression
CE.AttributeName = "productnumber"
CE.Operator = OService.ConditionOperator.Equal
CE.Values = New Object() {Name}
Dim FE As New OService.FilterExpression
FE.FilterOperator = OService.LogicalOperator.And
FE.Conditions = New OService.ConditionExpression() {CE}
QE.Criteria = FE

Dim EC As OService.EntityCollection
Dim OC As New OService.OrganizationServiceClient
EC = OC.RetrieveMultiple(QE)
For i As Integer = 0 To EC.Entities.Count - 1
FindProduct = EC.Entities(i).Attributes(0).Value.ToString
Next
End Function

ER.Id = New Guid(FindProduct(name).ToString)
ER.LogicalName = "product"

 AC.Add(New KeyValuePair(Of String, Object)("product", ER))

where the program create i get this error

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    This looks like you are not using the SDK assemblies to connect to CRM and so the namespace is incorrect. You should reference the Microsoft CRM SDK assemblies and use the types defined there - see msdn.microsoft.com/.../hh547453.aspx

    Hope this helps

  • Community Member Profile Picture
    on at

    how i use this sdk??

  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    If you down load the sdk you will find a samples folder - this has lots of examples of how to use the sdk assemblies.

    Hope this helps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans