Question

I'm writing an application using Intuit's API V3 written in vb.net. I'm trying to do a customerQuery on a customer using the Customer.DisplayName. I think I have the query set up but I'm missing something because I keep getting an object reference error. Here is the code doing the query:

     '* create service context
            Dim context As ServiceContext = New ServiceContext(oAuthData.realmId, oAuthData.dataSource, oAuthValidator)            

            Dim list As System.Collections.Generic.IEnumerable(Of Customer)

            Dim customerQueryService As New Intuit.Ipp.QueryFilter.QueryService(Of Customer)(context)

            Dim selectBy As Intuit.Ipp.LinqExtender.Ast.Expression = New Intuit.Ipp.LinqExtender.Ast.SelectExpression(aCustomer.DisplayName)

            list = customerQueryService.Execute(selectBy, True, aCustomer.DisplayName)

I pass in a customer object with the DisplayName I want to query by. The context is getting created properly so that is not the problem. I get the object reference error when the execute query is called. What am I missing or what is wrong with this call?

Was it helpful?

Solution

Following is an example in C#-

QueryService<Account> accountQueryService2 = new QueryService<Account>(context);
Account account21 = accountQueryService2.ExecuteIdsQuery("Select * From Account where AccountType='" + AccountTypeEnum.AccountsReceivable+"'").FirstOrDefault<Account>();

Can you map it to VB syntax?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top