Techiio-author
Started by Jofar ArcharNov 9, 2021

Open
simple-salesforce convert lead

1 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWES SHARE

I'm pretty new to the salesforce API. I have been using the python module simple-salesforce as a way to create leads. It works amazing, however, it is certainly doubtful to me the way to do non-crud-like movements. As an example, I want to programmatically convert a lead into an account.

The salesforce GUI makes this clean. One could in reality open the lead, then click on the convert button. Does anybody accessible understand the way to try this with simple salesforce?

1 Replies

Techiio-commentatorMurray Thomson replied 3 months ago0 likes0 dislikes

Here is the test class I created for the linked APEX class. Salesforce requires test classes with 75% coverage. This doesn't actually test any functionality, it just passes Salesforce's arbitrary requirements.

@isTest

class RestLeadConvertTest{

@isTest static void testIt(){

Lead lead = new Lead();

lead.LastName = 'salesforce';

lead.Company = 'unittest';

insert lead;

RestRequest req = new RestRequest();

RestResponse res = new RestResponse();

req.requestURI = '/services/apexrest/Lead/' + lead.Id; //Request URL

req.httpMethod = 'GET';//HTTP Request Type

RestContext.request = req;

RestContext.response= res;

RestLeadConvert.doGet();

}

}

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance