Git Product home page Git Product logo

Comments (8)

perbrondum avatar perbrondum commented on June 17, 2024
// Fails in 9.06 BETA with date format 
@available(iOS 15.0.0, *)
private func simpleDateQuery() async throws
    {
    DB.salesforce.identity().sink(receiveCompletion: { (completion) in
        switch completion {
        case .finished:
            break
        case let .failure(error) :
           print("Failed to login. Error: \(error)")
        }
    }) { identity in
        let userId = identity.userID
        
        let userSoql = "select name from account where lastmodifiedDate > 2023-01-01T12:00:00.000+0100"
      //  print(userSoql)
        DB.salesforce.query(soql: userSoql).sink(receiveCompletion: { (completion) in
            switch completion {
            case let .failure(error):
                testResults[8] = "simpleDateQuery, Failure"
                testErrors[8] = error
                print("Failed query(8) SFDC. Error: \(error)")
            case .finished:
                testResults[8] = "simpleDateQuery, Success"
                printOut()
            }
        }, receiveValue: { (userData : QueryResult<User>) in
            //
        }).store(in: &subscriptions)
    }.store(in: &subscriptions)
}

from swiftlysalesforce.

mike4aday avatar mike4aday commented on June 17, 2024

@perbrondum the query will work if you use the date/time format YYYY-MM-DDThh:mm:ssZi.e. select name from account where lastmodifiedDate > 2023-01-01T11:00:00Z(adjusted to UTC).

Your original query also fails with the same error when I try it in Workbench's "REST Explorer," so I don't believe the problem lies within Swiftly Salesforce. Per the docs, the format you used is acceptable, but still only the above format works in Workbench.

from swiftlysalesforce.

mike4aday avatar mike4aday commented on June 17, 2024

@perbrondum -- sorry, disregard my last comment; it is indeed a bug in Swiftly Salesforce: I should have checked for "+" in the time zone offset and then URL-encoded it. For now, a workaround is to use UTC time format instead, i.e. YYYY-MM-DDThh:mm:ssZ

Thanks

from swiftlysalesforce.

perbrondum avatar perbrondum commented on June 17, 2024

Thanks for the quick reply.

from swiftlysalesforce.

perbrondum avatar perbrondum commented on June 17, 2024

Using "YYYY-MM-ddThh:mm:ssZ" returns "2021-12-11T21:21:53+0000" which has the same problem.

from swiftlysalesforce.

perbrondum avatar perbrondum commented on June 17, 2024

Note that any query using predicate date qualifiers like LAST_N_DAYS:n will have the same issue.

from swiftlysalesforce.

mike4aday avatar mike4aday commented on June 17, 2024

Thanks @perbrondum - I will fix this. I'm working on the version 10, and don't know yet whether it'll be faster to fix it there or in a minor release of version 9.

from swiftlysalesforce.

mike4aday avatar mike4aday commented on June 17, 2024

Fixed in version 10.0.0

from swiftlysalesforce.

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.