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

Linq to CRM VB.NET

$
0
0

Hi!

I have this code which gives me

In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user.

    Function GetSiiProductNumberFromProduct(productId As System.Guid) As String

        Try
            Dim ctx As DataContext = Session("Ctx")
            Dim items As List(Of Product) = ctx.ProductSet.
            Where(Function(p) p.ProductId = productId).
            Select(Function(q) New Product With {
                        .Id = q.Id,
                        .ProductNumber = q.ProductNumber
                   }).ToList()

            Return items(0).ProductNumber
        Catch ex As Exception
            Return ""

        End Try
    End Function


The same code retrieving information from custom entity works fine. Please help.


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images