I use Ruby on Rails 4.2.5 with the Restforce gem for Salesforce API. I create a Contact
in my controller :
class CandidateFormController < ApplicationController
def index
client = Restforce.new(
:username => ENV['SALESFORCE_USERNAME'],
:password => ENV['SALESFORCE_MDP'],
:security_token => ENV['SALESFORCE_TOKEN'],
:client_id => ENV['SALESFORCE_APIKEY'],
:client_secret => ENV['SALESFORCE_SECRET'],
)
new_client = client.create('Contact', FirstName: @first_name,
LastName: @last_name,
Email: @email,
MobilePhone: @telephone,
Description: @champ_libre,
Profil_LinkedIN__c: @linkedin
)
end
end
I have a relationship between two of my tables.
Candidate
is associated to Opportunity
(a job offer if you prefer), and the restforce documentation doesn't explain how to create a new entry with a relation between two elements, or if it does I am not enough experimented to have understand how am I supposed to do so.
I have not enough credit to post screenshots, but if this is necesseray I can use imgur or something like that.
P.S : I already see this post on the subject, but that didn't help me at all.