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

Add support for the convertLead operation. #9

Open
GoogleCodeExporter opened this issue Apr 12, 2015 · 1 comment
Open

Add support for the convertLead operation. #9

GoogleCodeExporter opened this issue Apr 12, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

See attached patch. The proposed usage runs along the lines of

from beatbox import PythonClient, ConvertLead

svc = PythonClient()
# ...

svc.convertLead([ConvertLead(leadId='0000000', sendNotificationEmail=False), 
ConvertLead(leadId='0000001')])



Original issue reported on code.google.com by [email protected] on 4 Jun 2009 at 6:34

Attachments:

@GoogleCodeExporter
Copy link
Author

I also needed convertLead, and added it with the following changes.

(add to the bottom of _beatbox.py)

class ConvertLeadRequest(AuthenticatedRequest):
    """
    Converts a Lead to an Account. See also:
    http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_convertlead.htm
    """
    def __init__(self, serverUrl, sessionId, leadIds, convertedStatus, doNotCreateOpportunity=False, sendNotificationEmail=False, overwriteLeadSource=False):
        AuthenticatedRequest.__init__(self, serverUrl, sessionId, "convertLead")
        self.__convertedStatus = convertedStatus
        self.__leadIds = leadIds;
        self.__doNotCreateOpportunity = doNotCreateOpportunity
        self.__sendNotificationEmail = sendNotificationEmail
        self.__overwriteLeadSource = overwriteLeadSource

    def writeBody(self, s):
        s.startElement(None, 'leadConverts' )
        s.writeStringElement(_partnerNs, "convertedStatus", self.__convertedStatus)
        s.writeStringElement(_partnerNs, "doNotCreateOpportunity", self.__doNotCreateOpportunity)
        s.writeStringElement(_partnerNs, "leadId", self.__leadIds)
        s.writeStringElement(_partnerNs, "overwriteLeadSource", self.__overwriteLeadSource)
        s.writeStringElement(_partnerNs, "sendNotificationEmail", self.__sendNotificationEmail)
        s.endElement() # leadConverts


(add to the Client class in _beatbox.py)

    def convertLead(self, leadIds, convertedStatus, doNotCreateOpportunity=False, sendNotificationEmail=False, overwriteLeadSource=False):
        return ConvertLeadRequest(self.__serverUrl, self.sessionId, leadIds, convertedStatus, doNotCreateOpportunity, sendNotificationEmail, overwriteLeadSource).post(self.__conn)


Original comment by [email protected] on 17 Aug 2012 at 4:59

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

No branches or pull requests

1 participant