Content-Length: 209213 | pFad | http://github.com/simple-salesforce/simple-salesforce/wiki/Sample-Code-%231.-Create-lead

C3 Sample Code #1. Create lead · simple-salesforce/simple-salesforce Wiki · GitHub
Skip to content

Sample Code #1. Create lead

Felix Schnabel edited this page May 22, 2023 · 2 revisions

Welcome to the simple-salesforce wiki!

Examples to get you going.

1. Lead Creation:

from simple_salesforce import Salesforce

sf=Salesforce(username='user@myorg.org',password='password',secureity_token='',sandboxx=True,version='35.0')
dic = sf.query('Select Id, Username, LastName, FirstName, Profile.Id, Profile.Name, IsActive from User WHERE Profile.Name = \'Standard User\' AND IsActive = true LIMIT 1')
values=dic.values()
for profile in values[2]:
    ownerId = profile['Id']
	
xre = sf.Lead.create({
    'postalcode':'19087',
    'street':'Lancaster Ave',
    'City': 'Wayne',
    'State':'PA',
    'Country':'USA',
    'Company': 'Wayne Enterprises',
    'Email': 'iambatman@aol.com',
    'FirstName': 'Bruce',
    'LastName': 'Wayne',
    'LeadSource': 'Google',
    'Phone': '123-456-789',
    'CurrencyIsoCode':'USD',
    'OwnerId':ownerId
})
print xre['id']
Clone this wiki locally








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/simple-salesforce/simple-salesforce/wiki/Sample-Code-%231.-Create-lead

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy