Coder Social home page Coder Social logo

Using DataService.Query<Table>(page, queryBuilder,fieldSelection) with dates in queryBuilder returns no results. about infusionsoft.net HOT 4 OPEN

eventday avatar eventday commented on July 22, 2024
Using DataService.Query(page, queryBuilder,fieldSelection) with dates in queryBuilder returns no results.

from infusionsoft.net.

Comments (4)

scottcate avatar scottcate commented on July 22, 2024

My hunch is that startDate.ToStrjng() doesn't produce the same string as
your first example.

You can watch this with tracing.

@scottcate

On Wednesday, November 11, 2015, naeazach [email protected] wrote:

So when I run the untyped query:

    var queryData = new XmlRpcStruct() { { "DateCreated", "2015-11-03%" } };
    var cs = client.DataService.Query(
       table: "Invoice",
       limit: 1000,
       page: 0,
       queryData: queryData,
       selectedFields: new[] { "AffiliateId", "ContactId", "CreditStatus", "DateCreated", "Description" }).ToList();

it returns records. But when I run the same thing as:
var results = client.DataService.Query(
page: new DataPage(1000, i),
queryBuilder: q => q.Add(c => c.DateCreated, startDate),
fieldSelection: z => z.Include(c=> c.AffiliateId)
.Include(c=> c.ContactId)
.Include(c=> c.CreditStatus)
.Include(c=> c.DateCreated)
.Include(c=> c.Description)
.Include(c=> c.Id)
.Include(c=> c.InvoiceTotal)
.Include(c=> c.InvoiceType)
.Include(c=> c.JobId)
.Include(c=> c.LeadAffiliateId)
.Include(c=> c.PayPlanStatus)
.Include(c=> c.PayStatus)
.Include(c=> c.ProductSold)
.Include(c=> c.PromoCode)
.Include(c=> c.RefundStatus)
.Include(c=> c.Synced)
.Include(c=> c.TotalDue)
.Include(c=> c.TotalPaid)

        );

I get no results. Any ideas?


Reply to this email directly or view it on GitHub
#40.

@scottcate (Mobile)
602-418-0770

from infusionsoft.net.

naeazach avatar naeazach commented on July 22, 2024

That's what I figured, I know that even if you do .Date it'll still show 12:00:00 ... however, the query builder expects a real date value if passing it in as part of date query. is there a place I can add an exception to trim the time in the query builder? I couldn't find exactly where it's putting together the xmlrpcstruct...

from infusionsoft.net.

ChaseCarlile avatar ChaseCarlile commented on July 22, 2024

@naeazach I just ran into the same issue and got around it by exposing the Dictionary property through IQueryBuilder:
Dictionary<string, object> Dictionary { get; }

This allows me to get around the type restriction when bulding the query:
queryBuilder: q => { q.Dictionary.Add("LastUpdated", "2016-02-16%"); },

Perhaps not the most eloquent solution, but got the job done.

from infusionsoft.net.

secretwep avatar secretwep commented on July 22, 2024

I couldn't get it to work either. Intellisense has trouble with the line:

queryBuilder: q => q.Add(c => c.DateCreated, startDate),

Everything else appears to be fine in the .Query(). In my case I am using a ContactAction object, but the actual ContactAction object does not seem to be available in the queryBuilder for use in a lambda expression.

This is unfortunate because I was really hoping to hydrate a ContactAction instead of using the untyped query method.

from infusionsoft.net.

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.