Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am using below custom API and getting below error: #90

Closed
degreecloud opened this issue Sep 10, 2018 · 18 comments
Closed

I am using below custom API and getting below error: #90

degreecloud opened this issue Sep 10, 2018 · 18 comments
Assignees
Labels

Comments

@degreecloud
Copy link

degreecloud commented Sep 10, 2018

The operation could not be completed. (SwiftlySalesforce.RequestError error 1.)

Using:
first {
salesforce.apex(method: .post, path: path!, parameters: nil, body: jsonData, contentType: "application/json")
}.then {
result in
}.catch {
error in
}

@degreecloud degreecloud changed the title I am custom API and getting below error: I am using below custom API and getting below error: Sep 10, 2018
@degreecloud
Copy link
Author

Please reply. Its urgent

@mike4aday
Copy link
Owner

@degreecloud can you update to the current version of Swiftly Salesforce? What is the underlying error you're encountering?

@degreecloud
Copy link
Author

This is my error : The operation could not be completed. (SwiftlySalesforce.RequestError error 1.)
Whenever trying to save data in salesforce.

@degreecloud
Copy link
Author

degreecloud commented Sep 12, 2018 via email

@mike4aday
Copy link
Owner

@degreecloud the syntax you're using indicates an old version of Swiftly Salesforce. Can you upgrade to the latest, ver. 7 (it requires iOS 11+)? Cocoapods won't necessarily update to the latest major version if you've specified an earlier version in your podfile.

It looks like the underlying error is that the resource you're calling doesn't exist at the specified path location. What is your path argument? Can you confirm that the path argument is set correctly and matches the urlMapping attribute of the @RestResource annotation in your Apex class?

You could place a breakpoint here, and step through the code to see the underlying error.

@degreecloud
Copy link
Author

Path is correct because 1 week ago it was working and now request error is showing.

@degreecloud
Copy link
Author

I have also tried insert method to create lead in salesforce but request error is showing again.

@degreecloud
Copy link
Author

degreecloud commented Sep 14, 2018 via email

@mike4aday
Copy link
Owner

@degreecloud the syntax for calling an Apex method exposed as a REST endpoint using the current version of Swiftly Salesforce is here.

What is the underlying error (i.e. not the SwiftlySalesforce.RequestError)? If you place a breakpoint here you may be able to see the error sent from Salesforce.

It is usually better to use a standard, Salesforce REST endpoint rather than an Apex method exposed as a custom REST endpoint. So if your goal is to create a Lead record, it's preferable to use one of the insert methods here.

@degreecloud
Copy link
Author

degreecloud commented Sep 20, 2018 via email

@mike4aday
Copy link
Owner

@degreecloud that does sound like an error from the server side. What is in the HTTP response, i.e. post here the value of the variable httpResp? (defined on line 27 of Requestor.swift)

@degreecloud
Copy link
Author

degreecloud commented Sep 24, 2018 via email

@mike4aday
Copy link
Owner

@degreecloud is this a POST request? What are the fields on Lead that you're attempting to set?

@degreecloud
Copy link
Author

degreecloud commented Sep 27, 2018 via email

@ghost
Copy link

ghost commented Sep 27, 2018 via email

@degreecloud
Copy link
Author

Ok . Thank you

@mike4aday
Copy link
Owner

Thank you @pbrondum

@degreecloud I'll close this issue for now. Re-open if you need to.

@degreecloud
Copy link
Author

degreecloud commented Oct 1, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants