Comments (7)
line 5: Should read "fails when using USER struct, works when using SALESFORCERECORD"
from swiftlysalesforce.
@perbrondum I believe the issue is that the Id
field is not in the list of queried fields in your SOQL query; only CompanyName
is queried. Does it work if you add Id
to the queried field list?
from swiftlysalesforce.
Sorry, just saw this. While id is not needed in the select list, I will check tomorrow if the bug still exists with it in.
from swiftlysalesforce.
Indeed, adding id to the select list solves the problem.
from swiftlysalesforce.
Looked at this again, the id field does not have to be in the select list for this to work, but the Id field in the USER struct does have to be optional.
public var Id: String?
In my case I had the Id field as non-optional and that reproduces the error.
from swiftlysalesforce.
Hi @perbrondum - I assume User
is a custom model struct you defined? If so, then any property defined as optional will work since the automatic decoding provided by Swiftly Salesforce via Swift's Decodable
protocol will not throw an error if the server response is missing a value for that property. If the property is required, however, then it must be present in the JSON response, and the relevant field has to be in the SOQL
select list.
from swiftlysalesforce.
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
- Query with date predicate fail HOT 8
- 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.