Comments (7)
Hi @perbrondum - yes, you could execute anonymous Apex by creating your own struct that conforms to Swiftly Salesforce's Service protocol (example here) and calls the Salesforce Tooling API as described here.
You could also create a custom Apex web service that both queries and deletes records, and then call that web service via Swiftly Salesforce's apex
method.
Another alternative: create a custom Service that calls the Salesforce Composite API to delete multiple record IDs as shown here.
from swiftlysalesforce.
from swiftlysalesforce.
@perbrondum if you use Swiftly Salesforce's apex
method then you won't need the session ID. You just need to provide the method arguments (or accept the defaults if applicable).
If you do need to retrieve the access token, you could get it via ConnectedApp
's getCredential
method.
from swiftlysalesforce.
from swiftlysalesforce.
from swiftlysalesforce.
Hi @perbrondum It's difficult for me to follow the unformatted code, but let me offer this:
- For the
path
argument that you pass to theapex
method: you don't need the instance name, but only the string value you defined in the corresponding Apex class'urlMapping
attribute of the@RestResource
annotation. (Swiftly Salesforce knows the instance name upon user authentication andservices/apexrest/
is already assumed.) - There's no need to call
identity
before calling theapex
publisher. - The return type is JSON with whatever you defined as the return value in the corresponding, server-side Apex method. Define a custom, Swift struct that mirrors the Apex output and then Swiftly Salesforce will automatically deserialize the JSON into that struct.
from swiftlysalesforce.
@perbrondum here's an example of calling an Apex method exposed as a REST endpoint. The @RestResource
annotation is RandomAccount
which returns a Salesforce Account record.
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
- 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
- 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.