SureshKekan / salesforce-python-toolkit

Automatically exported from code.google.com/p/salesforce-python-toolkit
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Document how to add many-to-manys using this tool? #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm attempting to add a Contact to an Account, and I'm sure it's super obvious 
how to do it, but I didn't see anything in the documentation about it, and I'm 
failing at the various things I've tried. Can you put an example in for how to 
add one record to another record where many-to-many relationships exist?

Thanks.

Original issue reported on code.google.com by frey...@gmail.com on 16 Jul 2012 at 11:44

GoogleCodeExporter commented 8 years ago
Hey,

David asked me to look into this, and I was wondering, are these contacts 
previously associated with an Account?

Because if they aren't you should be able to just change the contact's Account 
Name field to be the same as the Account's Name field and it should add the 
contact to the account.

However cases and opportunities with stay attached to the previous account, so 
if they have been connected with a previous account and you want to bring 
opportunities or cases with those opportunities and cases would also have to be 
edited. 

I will post an example here and in examples at some point in the near future

-Max

Original comment by m...@loggly.com on 18 Jul 2012 at 11:49

GoogleCodeExporter commented 8 years ago
Note-This should work for have many contacts for one account, but so far as I 
can tell there is no way to have multiple accounts associated with one contact

Original comment by m...@loggly.com on 19 Jul 2012 at 4:48

GoogleCodeExporter commented 8 years ago
Also do you already have the contact object?

If you do all you need to do is say
Contact.Account=Account.Name
then
client.update(Contact)

where Account is the Account to which you want the contact to be added
Contact is the contact and client is the SforcePartnerClient or 
SforceEnterpriseClient

Original comment by m...@loggly.com on 19 Jul 2012 at 10:04