SSIS/Kingsway MSCRM-Lookup per ScriptComponent

 

Verweise:

//KingswaySoft.DynamicsCrmServices   
//Pfad: C:\WINDOWS\assembly\GAC_MSIL\KingswaySoft.DynamicsCrmServices\1.0.0.0__705df8e0751bcea7\KingswaySoft.DynamicsCrmServices.dll
//KingswaySoft.IntegrationToolkit.DynamicsCrm   
//Pfad: C:\Program Files (x86)\Microsoft SQL Server\120\DTS\PipelineComponents\KingswaySoft.IntegrationToolkit.DynamicsCrm.dll

Namespaces im Code:

using KingswaySoft.DynamicsCrmServices.Soap2011.OrganizationService;
using KingswaySoft.DynamicsCrmServices.Soap2011.OrganizationService.Messages;
using KingswaySoft.DynamicsCrmServices.Soap2011.OrganizationService.Metadata;
using KingswaySoft.DynamicsCrmServices.Soap2011.OrganizationService.Query;
using KingswaySoft.IntegrationToolkit.DynamicsCrm;

Code:

    public override void Input0_ProcessInputRow(Input0Buffer Row)
    {
        /*
         * Add your code here
         * 
         * http://www.kingswaysoft.com/blog/2013/06/24/Writing-Script-Component-or-Script-Task-using-CRM-Connection-Manager
         */

        //var connMgr = this.Connections.Dynamics365;
        //var conn = (CrmConnection)connMgr.AcquireConnection(null);

        var connMgr = this.Connections.Dynamics365;
        var connectionString = (string)connMgr.AcquireConnection(null);
        var conn = new CrmConnection(connectionString);

        var orgService = (IOrganizationService)conn.GetCrmService();

        //Select parentcustomerid from contact where contact = '00000-0000000000-00000-00000-0000'
        var inputValue = Row.contactid;  // input0: Field "contactid"
        var retrievedEntity = orgService.Retrieve("account", parmInputvalue, new ColumnSet("parentcustomerid"));
        var outputValue = retrievedEntity.GetAttributeValue("parentcustomerid");
        Row.parentcustomerid = outputValue;  // output0: new Field "parentcustomerid"
    }
</pre

 

KingswaySoft „Integrations Toolkit“ Parallelität

Das Kingsway „SSIS Integrations Toolkit for Dynamics 365“ kann seit den neuen Versionen die Parallelität ein- bzw. ausschalten:

In selbst umgesetzten Importe wurde die Parallelität jedoch komplett anderes umgesetzt.

Einer der wichtigsten Punkte war wie Klarheit, welche Sätze Importiert wurde und welche nicht. Es wurden die Sätze z. B. nach dem Erstem Buchstaben des Namens in eigene Jobs verteilt und damit 26 oder 27 Jobs (A-Z und andere Zeichen) gleichzeitig erlaubt. Technisch sind diese vielen Jobs alle nur ein Einziger, jedoch Aufgerufen mit Parametern. Der klare Vorteil, wenn bestimmte Buchstaben vollständig durchlief, mussten nicht alle neu importiert, sondern fehlerfreie Buchstaben konnten deaktiviert werden und mussten damit nicht erneut importiert. Immer wenn einmal die Menge groß wird und damit mehrere Millionen Sätze importiert werden müssen, kommt der Faktor „Laufzeit“ ins Spiel und dann können Importe auch überraschend abgebrochen aus anderen Gründen des Imports-Job selber. Und die leichte Übersicht spart viel Analyse und dann können die fehlende Jobs viel schneller wieder gestartet werden.

In der Realität müssen die Anzahl der parallele Jobs passen zu den Kapazitäten vom Import-Server, Frontserver und dem SQL Server. Wenn Virtuelle Server benutzt werden, können speziell diese zu den Initial Importen kurzfristig anders konfigurieren als in der Produktivzeit.

Merge von MSCRM-Sätzen per Kingswaysoft

Merge per Kingswaysoft Nötig ist dazu das normale „SSIS Integration Toolkit for Microsoft Dynamics 365“ und nicht das „SSIS Productivity Pack“. Link: https://www.kingswaysoft.com/products/ssis-integration-toolkit-for-microsoft-dynamics-365/help-manual/crm/destination
CRM Destination Component Editor – Action (Nur möglich bei account / contact / lead / incident):

Merge action is only possible with the following CRM entities:

  • account
  • contact
  • lead

When Merge action is chosen, you will be working with the following 4 columns with the first two columns being required in order to merge a pair of CRM records:

  • targetid – the record that you would like to retain.
  • subordinateid – the record that is going to be retired, in which case, the record itself will be deactivated and all child records will be re-parented underneath the retained record which is specified by the targetid input column.
  • CoalesceNonEmptyValues (since v8.0) – specify a Boolean value to determine whether to coalesce non-empty value during the Merge operation. When the input value for this field is true, the destination component will try to coalesce non-empty values during the Merge operation. For example, when this is set to true, if the subordinate record has a value for a particular field, but the target record does not have a value (usually in the format of NULL), then the value from the subordinate record will be copied over to the target entity record. The default behavior is false if this field is not mapped.
  • PerformParentingChecks (since v8.0) – specify a Boolean value to determine whether a parenting check is needed during the Merge operation. Set to Ture to check if the parent information is different for the two entity records, otherwise, False