-
Notifications
You must be signed in to change notification settings - Fork 116
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
Ability to convert lead into account? #64
Comments
I don't think this is supported by REST API. A quick Google brings up workarounds like this one. If you think there's a way to do it in REST API, let me know and I'll take a look at docs. |
Thanks for the quick answer! I had seen that, what's unclear to me is whether this class is just patching a lead and triggering a conversion or whether it's doing something more than that through the API upon calling Database.convertLead. |
It’s an Apex class so it’s not using REST API. I believe an Apex solution
is being proposed because there is no way to do it via REST API directly.
The Apex class is exposed as a rest endpoint which can be called via a
standard REST http call.
…On Mon, Dec 4, 2017 at 10:19 AM sfdaniele ***@***.***> wrote:
Thanks for the quick answer!
I had seen that, what's unclear to me is whether this class
<https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dml_convertLead.htm>
is just patching a lead and triggering a conversion or whether it's doing
something more than that through the API upon calling Database.convertLead.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#64 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARUrMRtSRexMZVWoONhk-mX6Nok5jCSks5s9DevgaJpZM4Q1B3P>
.
|
Ok. The answer here seems to suggest that there is an endpoint called If so, I'd have to re-use your authentication and client infrastructure to make that call. That most likely would require me to send a PR to you and change the client. If all of the above is correct, could I do that? I'd have to dig into your code to figure out where to plug in. Thanks! |
force-rest-api supports calling custom endpoints like that one and reusing
the autentication and marshalling logic. See the plain get/put/post/delete
methods on ForceApi.
…On Mon, Dec 4, 2017 at 10:33 AM sfdaniele ***@***.***> wrote:
Ok. The answer here
<https://developer.salesforce.com/forums/?id=906F0000000D6SBIA0> seems to
suggest that there is an endpoint called
your_instance_url/services/apexrest/convertlead where I can POST {"leadId"
: lead_id}. Is my understanding correct? Do the endpoints under Apex Rest
use the same authentication mechanism as the Force API?
If so, I'd have to re-use your authentication and client infrastructure to
make that call. That most likely would require me to send a PR to you and
change the client.
If all of the above is correct, could I do that? I'd have to dig into your
code to figure out where to plug in.
Thanks!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#64 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARUrHCdDk92W5aUbUvV-9CKUIT9Noaaks5s9DsJgaJpZM4Q1B3P>
.
|
Got it! I'll play around with it and report back, if it works perhaps we can add it to the README for future reference. |
Alright, I'm making some progress but encountering issues as well. First, I had to temporarily work around The work around is ugly and it involves calling the private method The second issue is that I can't seem to be able to call Apex.
Invoking this causes a @jesperfj I realize that this is getting in the weeds and I really appreciate your help here. It looks like there aren't many resources online to do this in Java so there isn't much documentation to go after. |
To add to my comment above, after reading a bit more about Apex it looks like I'll have to wire up the endpoint to convert a lead on the Salesforce side before I can call it, is that so? If that's the case, then the solution would be to:
|
I'll take a look at it. The raw crud methods are relatively new and less
battle tested. There might be some issues with them.
…On Mon, Dec 4, 2017 at 12:26 PM sfdaniele ***@***.***> wrote:
To add to my comment above, after reading a bit more about Apex it looks
like I'll have to wire up the endpoint to convert a lead on the Salesforce
side before I can call it, is that so?
If that's the case, then the solution would be to:
1. Get a SF Developer account
2. Create an Apex class that converts a lead to an account and add a
rest resource for it
3. Modify the code above to call this newly created endpoint
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#64 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARUrOVfC7-DbgQcMBEU85ZlqFmjadtjks5s9FVWgaJpZM4Q1B3P>
.
|
Oh, I didn't see your updated response. Yes, you will have to deploy the Apex class first. |
Ok! |
Hi, I was finally able convert a lead into an account and it works! I'm still having to work around the fact that If possible, it would be awesome to change the ForceApi's interface so that there is a way to call arbitrary (non The hardest part of this entire endeavor was figuring out how to create the Apex class and deploy it to production as I'm not that familiar with Salesforce. If you want to add information on how to integrate with Apex in your readme, I've written down some notes here. Feel free to use those. Thanks! |
I see. When I did the raw crud methods, I reused This is certainly a bug. The crud methods were intended to be used with Apex REST for sure. |
I don't know. I'm new to the Salesforce API but I wouldn't be surprised if there were more endpoints under services. |
Hi! I wasn't sure what was the best way to contact you.
Is there a way to convert a lead into an account through the client? If so, would you be able to add it to the readme as an example?
Thanks!
The text was updated successfully, but these errors were encountered: