Giter VIP home page Giter VIP logo

Comments (10)

nimisha84 avatar nimisha84 commented on June 18, 2024

Looks like a bug to me. Thanks for the feedback, we will look into this and fix it in our next release.

from quickbooks-v3-dotnet-sdk.

nimisha84 avatar nimisha84 commented on June 18, 2024

In the 5.3 SDK release, can you try this code?
Batch batch = commonServiceQBO.CreateNewBatch();

                batch.Add("select * from Account startPosition 0 maxResults 10", "queryAccount");
                batch.Execute();

                if (batch.IntuitBatchItemResponses != null && batch.IntuitBatchItemResponses.Count() > 0)
                {
                    IntuitBatchResponse res = batch.IntuitBatchItemResponses.FirstOrDefault();
                    List<Account> acc = res.Entities.ToList().ConvertAll(item => item as Account);
                };

from quickbooks-v3-dotnet-sdk.

nimisha84 avatar nimisha84 commented on June 18, 2024

We don't support LINQ detailed extensions as we deprecated them earlier due to some issues. Some simpler ones like the one I suggested above works.

from quickbooks-v3-dotnet-sdk.

evillegas92 avatar evillegas92 commented on June 18, 2024

Hi @nimisha84
I don't see how this query you suggested

select * from Account startPosition 0 maxResults 10

Has anything to do with SELECT Count( *). I also don't see what LinQ detailed extensions have to do with SELECT Count( *) either.

Will I be able to get the totalCount value from the SELECT Count( *) query in the next release? If so, what release would that be? 5.4?

Thanks.

from quickbooks-v3-dotnet-sdk.

nimisha84 avatar nimisha84 commented on June 18, 2024

I might have misunderstood your query earlier thinking the count was required for the batch itemresponse and not the actual count query. I mentioned linq as I saw you used this-FirstOrDefault(item => item.Id == batchId);

I am looking at this issue again and hopefully should be able to fix this in 5.4 unless any other high priority issues come up. Will keep you posted.
Thanks for the feedback.

Also, I would like to understand why you would want to call count query in batch and not as a regular query instead? Is there a specific use case?

from quickbooks-v3-dotnet-sdk.

evillegas92 avatar evillegas92 commented on June 18, 2024

How would I call count query in a regular query using the SDK? The only way I've found to execute a custom query is through Intuit.Ipp.DataService.Batch.

Thanks for re opening the issue.

from quickbooks-v3-dotnet-sdk.

nimisha84 avatar nimisha84 commented on June 18, 2024
                DataService commonServiceQBO = new DataService(serviceContext);
               
                QueryService<Invoice> inService = new QueryService<Invoice>(serviceContext);
                var In = inService.ExecuteIdsQuery("SELECT count(*) FROM Invoice");

or int count= inService.ExecuteIdsQuery("SELECT count(*) FROM Invoice").Count();

from quickbooks-v3-dotnet-sdk.

nimisha84 avatar nimisha84 commented on June 18, 2024

ExecuteIdsQuery should work for any queries.

from quickbooks-v3-dotnet-sdk.

evillegas92 avatar evillegas92 commented on June 18, 2024

Thank you @nimisha84 this is actually what I needed.
int count= inService.ExecuteIdsQuery("SELECT count(*) FROM Invoice").Count();

I thought Batch was the only way to execute custom queries.

from quickbooks-v3-dotnet-sdk.

nimisha84 avatar nimisha84 commented on June 18, 2024

Ok great. Anyways, I have fixed the SDK to return count in batch too. Will be available in 5.4 version of SDK which I releases today.

from quickbooks-v3-dotnet-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.