2017-07-07 1 views
1

Ich weiß nicht, wie ich einen Kontakt für ein Konto erstellen kann. Ich habe eine CSV-Datei mit einem Konto und einem Kontakt, und ich möchte diese Daten in mein CRM importieren. Dies ist mein Code, um ein Konto in CRM hinzuzufügen:Kontaktkontobindung in CRM erstellen C#

#region Column One Mappings 
// Create a column mapping for a 'text' type field. Ajouter un Compte 
ColumnMapping colMapping1 = new ColumnMapping() 
{ 
    // Set source properties. 
    SourceAttributeName = "my_new_accounts", 
    SourceEntityName = "Account_1", 

    // Set target properties. 
    TargetAttributeName = "name", 
    TargetEntityName = Account.EntityLogicalName, 

    // Relate this column mapping with the data map. 
    ImportMapId = new EntityReference(ImportMap.EntityLogicalName, importMapId), 

    // Force this column to be processed. 
    ProcessCode = new OptionSetValue((int)ColumnMappingProcessCode.Process) 
}; 

// Create the mapping. 
Guid colMappingId1 = _serviceProxy.Create(colMapping1); 
#endregion 

Ich möchte viele Kontakte an ein Konto gebunden erstellen.

Antwort

0

Der von Ihnen verwendete Beispielcode stammt von CRM SDK. Dasselbe Beispiel enthält Code zum Zuordnen der Zuordnung für das Parent Account Lookup.

Sehen Sie diesen Code Block, lesen Sie Kommentare, implementieren Sie es basierend auf Ihrem Bedarf.

Wenn Sie nur diesen Ansatz ausprobieren, gehen Sie voran. Oder Sie können einfach mit dem OOB-Datenimport-Assistenten importieren.

Verwandte Themen