class MctRdSalesforce::Lead

Public Instance Methods

create(auth_keys = {}, opts = {}) click to toggle source
# File lib/mct-rd-salesforce/lead.rb, line 16
def create(auth_keys = {}, opts = {}) #id or false
    client = MctRdSalesforce::Client.new.getRestfoceClient(auth_keys)
    newLead = client.create('Lead',
                FirstName: opts[:name],
                LastName: opts[:lastName],
                Status: "Working - Contacted",
                Company: opts[:company],
                Email: opts[:email],
                Website: opts[:website],
                Phone: opts[:phone],
                Title: opts[:jobTitle]);
end
destroy(leadId, auth_keys = {}) click to toggle source
# File lib/mct-rd-salesforce/lead.rb, line 43
def destroy(leadId, auth_keys = {}) #true
   client = MctRdSalesforce::Client.new.getRestfoceClient(auth_keys)
   client.destroy('Lead', leadId)
end
get(leadId, auth_keys = {}) click to toggle source
# File lib/mct-rd-salesforce/lead.rb, line 10
def get(leadId, auth_keys = {})
    client = MctRdSalesforce::Client.new.getRestfoceClient(auth_keys)
    leads = client.query("select id, firstname , lastname, email, company, title, phone, website from Lead where id = '" + leadId + "'");
    lead = leads.first;
end
load(auth_keys = {}) click to toggle source
# File lib/mct-rd-salesforce/lead.rb, line 5
def load(auth_keys = {})
    client = MctRdSalesforce::Client.new.getRestfoceClient(auth_keys)
    leads = client.query("select id, firstname , lastname, email, company, title, phone, website from Lead");
end
update(auth_keys = {}, opts = {}) click to toggle source
# File lib/mct-rd-salesforce/lead.rb, line 29
    def update(auth_keys = {}, opts = {}) #true
        client = MctRdSalesforce::Client.new.getRestfoceClient(auth_keys)
        client.update('Lead',
                        Id: opts[:id],
            FirstName: opts[:name],
            LastName: opts[:lastName],
            Status: "Working - Contacted",
            Company: opts[:company],
            Email: opts[:email],
            Website: opts[:website],
            Phone: opts[:phone],
            Title: opts[:jobTitle]);
end