Linking Existing Contacts with existing Opportunites via Import

I'm new to SugarCRM, but I got it done quickly to import records like Account, Contact, Opportunity, Product and Employee.
But in my old CRM system we have on each Opportunity an assigned customer contact.
As far as I understood this will be handled in SugarCRM with the link table Opportunites_Contacts.
But this table is not available in any import tools I have found until now.

Please tell he how I can import links between existing records.

Thanks a lot in advance
Michael

  • Hi Michael,

    Please go through link to understand and know more about Importing Relationships.

    And here you can find the complete guide about Import guidelines and different techniques on Importing in SugarCRM.

    Hope this information helps you:)

    Thanks and Best Regards,

    Poojitha Katram,

    www.bhea.com

  • Hi Poojitha,
    Thanks a lot for the very quick reply. I already found the documentation you sent me.
    The problem is that this documentation says something about the link between Opps and Contacts.
    Regards
    Michael

  • Here is a link to the relation I'm talking about

    https://apidocs.sugarcrm.com/schema/11.2.0/ent/tables/opportunities_contacts.html

    The table opportunities_contacts is the one where I would like to import data.
    Because I have the contacts already in the table CONTACTS and the Opps I have I have in table OPPORTUNITY. I would like to link some of the contacts to some of the Opps now.

  • Hi Michael,

    Thanks for the clarification. I don't think so you can link Contacts and Opportunities through importing process. By default Opportunities to Contacts is Many to Many relationship. Sugar Importing tool does not support many to many relationships to be imported using it. It is only limited for One to One and One to Many relationships to be imported using standard importing process. You may have to find alternate way to do this.

    Hope this information helps you:)

    Thanks and Best Regards,

    Poojitha K

    www.bhea.com

  • Definitely there is no way to set a M:M relationship via import.

    You can set those relationships via api call to POST /Opportunities/:opp_id/link/contacts/:ctt_id

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Thanks a lot for your very helpful answer. It needed some more investigations to get your recommendation done because this is all pretty new to me. I got it now to work in Postman.
    Now I will search for code example on how to run API calls from a C# program.

  • Thanks, this worked for me! A part of the code in c#:  

    Fullscreen
    1
    var responseMsg = await helper.PostAsync($"Opportunities/{oppId}/link/contacts/{contactId}");
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX