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
Comments
Please reply. Its urgent |
@degreecloud can you update to the current version of Swiftly Salesforce? What is the underlying error you're encountering? |
This is my error : The operation could not be completed. (SwiftlySalesforce.RequestError error 1.) |
I am using deployment target 10.3 and using pod I have updated swiftly
salesforce. But no progress. Please solve this issue. Getting request
error.
…On 2018-09-11 10:16, Michael Epstein wrote:
@degreecloud [1] can you update to the current version of Swiftly
Salesforce? What is the underlying error you're encountering?
--
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [2], or mute the
thread [3].
Links:
------
[1] https://github.com/degreecloud
[2]
#90 (comment)
[3]
https://github.com/notifications/unsubscribe-auth/AnpwN_BMZLZ7A9s-PIRxbP3uzgUHhk3eks5uZ-HAgaJpZM4Wg0iH
--
Thanks and Regards,
Komal Dhingra
|
@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 You could place a breakpoint here, and step through the code to see the underlying error. |
Path is correct because 1 week ago it was working and now request error is showing. |
I have also tried insert method to create lead in salesforce but request error is showing again. |
could you please suggest me right syntax? I have to create lead on
salesforce and want to send some data or parameters.
…On 2018-09-12 08:24, Michael Epstein wrote:
@degreecloud [1] 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 [2], and step through the code to
see the underlying error.
--
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [3], or mute the
thread [4].
Links:
------
[1] https://github.com/degreecloud
[2]
https://github.com/mike4aday/SwiftlySalesforce/blob/6.0.7/SwiftlySalesforce/Classes/Requestor.swift#L20
[3]
#90 (comment)
[4]
https://github.com/notifications/unsubscribe-auth/AnpwN0s0lxr_TZoxzSoYC3sAgcI6-uU_ks5uaRkagaJpZM4Wg0iH
--
Thanks and Regards,
Komal Dhingra | iOS Developer
360 Degree Cloud Technologies (P) Ltd.
|
@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 |
Still getting same error. Please check below steps:
Step 1: let result = salesforce.insert(type: "Contact", fields: fields)
//where fields is a dictionary of type [String: Encodable]
debugPrint(result)
Step 2: When I run the app then above debug gives: "Promise:
UnsealedState: Optional("Pending with 0 handlers")"
Step 3: I Implemented breakpoints and found:
a: Firstly breakpoint goes to case 400..<500: and gives 400
error. "PromiseKit: unhandled error: Error
Domain=SwiftlySalesforce.RequestError Code=0 "(null)"
b: Then after this breakpoint goes to case 200..<300 .
What should I do now?
I have implemented insert method and still getting error.
…On 2018-09-17 23:18, Michael Epstein wrote:
@degreecloud [1] the syntax for calling an Apex method exposed as a
REST endpoint using the _current_ version of Swiftly Salesforce is
here [2].
What is the underlying error (i.e. not the
SwiftlySalesforce.RequestError)? If you place a breakpoint here [3]
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 [4].
--
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [5], or mute the
thread [6].
Links:
------
[1] https://github.com/degreecloud
[2]
https://github.com/mike4aday/SwiftlySalesforce/blob/master/SwiftlySalesforce/Sources/Extensions/Salesforce%2BREST.swift#L87
[3]
https://github.com/mike4aday/SwiftlySalesforce/blob/6.0.7/SwiftlySalesforce/Classes/Requestor.swift#L20
[4]
https://github.com/mike4aday/SwiftlySalesforce/blob/master/SwiftlySalesforce/Sources/Extensions/Salesforce%2BSObject.swift#L67
[5]
#90 (comment)
[6]
https://github.com/notifications/unsubscribe-auth/AnpwN647IWNqIvzWQ11L0RMRXiYDAM43ks5ucIImgaJpZM4Wg0iH
--
Thanks and Regards,
Komal Dhingra | iOS Developer
360 Degree Cloud Technologies (P) Ltd.
|
@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 |
I am getting below httpResponse:
<NSHTTPURLResponse: 0x604000236b80> { URL:
https://ap4.salesforce.com/services/data/v41.0/sobjects/Lead/ } { Status
Code: 400, Headers {
"Cache-Control" = (
"no-cache,must-revalidate,max-age=0,no-store,private"
);
"Content-Security-Policy" = (
"upgrade-insecure-requests"
);
"Content-Type" = (
"application/json;charset=UTF-8"
);
Date = (
"Mon, 24 Sep 2018 05:01:02 GMT"
);
"Sforce-Limit-Info" = (
"api-usage=2/50000"
);
"Strict-Transport-Security" = (
"max-age=31536000; includeSubDomains"
);
"Transfer-Encoding" = (
Identity
);
"X-Content-Type-Options" = (
nosniff
);
"X-Robots-Tag" = (
none
);
"X-XSS-Protection" = (
"1; mode=block"
);
} }
…On 2018-09-21 17:58, Michael Epstein wrote:
@degreecloud [1] 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 [2])
--
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [3], or mute the
thread [4].
Links:
------
[1] https://github.com/degreecloud
[2]
https://github.com/mike4aday/SwiftlySalesforce/blob/6.0.7/SwiftlySalesforce/Classes/Requestor.swift#L27
[3]
#90 (comment)
[4]
https://github.com/notifications/unsubscribe-auth/AnpwN9HxA8HAOcSBGEE_4fweYELRQzgaks5udX0TgaJpZM4Wg0iH
--
Thanks and Regards,
Komal Dhingra | iOS Developer
360 Degree Cloud Technologies (P) Ltd.
|
@degreecloud is this a |
Below is my complete code, this is in swift:
let params: [String: Encodable] = ["FirstName": "Test1",
"Company": "DegreeCloud",
"LastName": "Komal",
"City": "city",
"Street": "street",
"State": "state",
"Country": "country",
"Zipcode": "344455",
"Email": "komal@gmail.com",
"Title": "iOS",
"Website": "www.test.com",
"Phone": "9988776655",
"DeviceType": "iPhone",
"DeviceID":
UIDevice.current.identifierForVendor!.uuidString
]
let result = salesforce.insert(type: "Lead", fields: params)
Please check and let me know the issue.
…On 2018-09-24 08:25, Michael Epstein wrote:
@degreecloud [1] is this a POST request? What are the fields on Lead
that you're attempting to set?
--
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [2], or mute the
thread [3].
Links:
------
[1] https://github.com/degreecloud
[2]
#90 (comment)
[3]
https://github.com/notifications/unsubscribe-auth/AnpwN4T5u5bppwLeuGIp_g2XD7HpL2qWks5ueOtZgaJpZM4Wg0iH
--
Thanks and Regards,
Komal Dhingra | iOS Developer
360 Degree Cloud Technologies (P) Ltd.
|
- Leads uses PostalCode not Zipcode
- Leads has no DeviceType nor DeviceId fields.
The following code inserts the lead correctly:
let fields: [String: Encodable] = ["FirstName": "Test1",
"Company": "DegreeCloud",
"LastName": "Komal",
"City": "city",
"Street": "street",
"State": "state",
"Country": "country",
"Postalcode": "344455",
"Email": "komal@gmail.com",
"Title": "iOS",
"Website": "www.test.com",
"Phone": "9988776655",
// "DeviceType": "iPhone",
"Status": "Open - Not Contacted",
// "DeviceID":
UIDevice.current.identifierForVendor!.uuidString
]
salesforce.insert(type: "Lead", fields: fields).done {_ in
}.catch {
error in
print(error.localizedDescription)
}
Per
Regards,
Per Jakobsen
Regular mail : perbrondum@gmail.com
Secure Mail: isper@protonmail.com
On Thu, Sep 27, 2018 at 8:16 AM, degreecloud <notifications@github.com>
wrote:
… Below is my complete code, this is in swift:
let params: [String: Encodable] = ["FirstName": "Test1",
"Company": "DegreeCloud",
"LastName": "Komal",
"City": "city",
"Street": "street",
"State": "state",
"Country": "country",
"Zipcode": "344455",
"Email": ***@***.***",
"Title": "iOS",
"Website": "www.test.com",
"Phone": "9988776655",
"DeviceType": "iPhone",
"DeviceID":
UIDevice.current.identifierForVendor!.uuidString
]
let result = salesforce.insert(type: "Lead", fields: params)
Please check and let me know the issue.
On 2018-09-24 08:25, Michael Epstein wrote:
> @degreecloud [1] is this a POST request? What are the fields on Lead
> that you're attempting to set?
>
> --
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub [2], or mute the
> thread [3].
>
> Links:
> ------
> [1] https://github.com/degreecloud
> [2]
> #90#
issuecomment-423992925
> [3]
> https://github.com/notifications/unsubscribe-auth/AnpwN4T5u5bppwLeuGIp_
g2XD7HpL2qWks5ueOtZgaJpZM4Wg0iH
--
Thanks and Regards,
Komal Dhingra | iOS Developer
360 Degree Cloud Technologies (P) Ltd.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#90 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA4tYg96_r9rcnUkOVTsYTRmkgCTFns0ks5ufOvOgaJpZM4Wg0iH>
.
|
Ok . Thank you |
Thank you @pbrondum @degreecloud I'll close this issue for now. Re-open if you need to. |
sure thank you so much for replying every question.
…On 01/10/2018 08:07 AM, Michael Epstein wrote:
Thank you @pbrondum [1]
@degreecloud [2] I'll close this issue for now. Re-open if you need
to.
--
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [3], or mute the
thread [4].
Links:
------
[1] https://github.com/pbrondum
[2] https://github.com/degreecloud
[3]
#90 (comment)
[4]
https://github.com/notifications/unsubscribe-auth/AnpwN218eo4yRCN99AlZz6BB7PTsQ5TCks5ugX_5gaJpZM4Wg0iH
--
Thanks and Regards,
Komal Dhingra | iOS Developer
360 Degree Cloud Technologies (P) Ltd.
|
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
}
The text was updated successfully, but these errors were encountered: