Comments (8)
// 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.
@perbrondum the query will work if you use the date/time format YYYY-MM-DDThh:mm:ssZ
i.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.
@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.
Thanks for the quick reply.
from swiftlysalesforce.
Using "YYYY-MM-ddThh:mm:ssZ" returns "2021-12-11T21:21:53+0000" which has the same problem.
from swiftlysalesforce.
Note that any query using predicate date qualifiers like LAST_N_DAYS:n will have the same issue.
from swiftlysalesforce.
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.
Fixed in version 10.0.0
from swiftlysalesforce.
Related Issues (20)
- Enhance SOSL to support AnyPublisher<QueryResult<T> HOT 6
- Login not working after dismissed HOT 1
- Question: Best practices for querying if user is allowed to update object HOT 1
- Composite resources support HOT 2
- MyRecords() func assumes object has 'ownerId' column HOT 8
- Login migration path for Swift Apps HOT 6
- Support for Anonymous Apex? HOT 7
- Error in fields array: Protocol 'Encodable' as a type cannot conform to the protocol itself HOT 7
- salesforce.search() replacement? in 9.0 HOT 2
- 'group by' count() soql fails in 9.0 HOT 26
- WebAuthenticator.swift:50:30: 'shared' is unavailable in application extensions for iOS HOT 1
- keyNotFound "id" error on simple query HOT 7
- Minor doc bug HOT 1
- Is there another way to perform salesforce.nextResultPage in V10? HOT 6
- Update links in README.md so they point to latest code version
- Adding SwiftlySalesforce to new project adds V8.0 (master) HOT 4
- Add ability to save files to SFDC & share via Chatter/Slack
- Implementation in ipad Swift Playground. AuthenticationError HOT 3
- README OATH screenshot needs refresh HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftlysalesforce.