Salesforce API Library for Pharo Smalltalk
Pharo Smalltalk 5.0, 6.0
Metacello new
baseline: 'Salesforce';
repository: 'github://newapplesho/salesforce-smalltalk/pharo-repository';
load.
SFSettings initialize.
SFSettings default.
SFSettings default username: '<Your mailaddress>'.
"You must append the user’s security token to their password A security token is an automatically-generated key from Salesforce."
SFSettings default password: '<Your password><Security token>'.
"Sandbox"
SFSettings default isSandbox: true.
SFClient new login.
client := SFClient new.
client query: 'SELECT name FROM Account'.
accessor := SFAccessor new.
accessor allAccounts: { 'Id'. 'Name' }.
accessor allContacts: { 'Id'. 'Email' }.
accessor allContacts: { 'Id'. 'Email' } withAccount: { 'Id'. 'Name' }.
accessor allAccounts: { 'Id'. 'Name'. } withContacts: { 'Id'. 'Email' }.
accessor := SFAccessor new.
accessor deleteObject: '<Salesforce Object Id>' model: SFLead.