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

 

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

 

Darstellen der Rechte im MSCRM…

Es können mehrere Rechte im MSCRM für eine Person bzw. Team und jede Entität und und und …
Die Rechte sollten klar festzustellen, aber gelegentlich gibt es Ausnahmen. Siehe unten!

Beispiel ein Import meldet die Fehlermeldung mit der Nummer 262153.
Ein Binäre Darstellung gibt:

0100 0000 0000 0000 1001

…(siehe Link)…
But wait, There is no Access Right with a binary value of 1000. Since I’ve been unable to find any other documentation, my guess is that something on our installation (that was an upgrade from a CRM 4.0 server) still has a reference to the CRM 4.0 enum values in which AppendToAccess is actually 8 (1000) rather than 16 (0001 0000).

Using that assumption and the table above, 262153 is made up of ShareAccess, AppendToAccess, and ReadAccess. This means the user has to have sufficient Access Levels for Share, Append, and Read privileges of the entity, in order to successfully perform the requested operation.

Quelle:

http://dotnetdust.blogspot.com/2014/03/how-to-interpret-accessrights-numbers.html

Parameter von MSCRM/Dyn365 Reports

Sobald ein Report neu angelegt wird. können auch viele Parameter  automatisch angeboten werden. Diese Parameter sind „hidden“ und haben lediglich einen statischen „Default“ Value.

Lediglich haben einige Parameter eine besondere Bedeutung. Speziell „CRM_Url“: DIeser (leere!) Parameter wird benötigt um von einem Report wieder in das CRM zu springen.

MSCRM: Unit/UnitGroup

Bei „Product“, „Quote“ und „Opportunity“ (und weiteren Entitäten) kommen Pflicht-Felder vor. Z.B. sind „Einheiten“ verlangt. Bei einem Import stößt man auf dieses ER-Model:

Beispiel: UOMGroup: „Weight“
UOM: „Gramm“, „Kilogramm“, „Tonne“

MSCRM: Activity

Prinzipiell werden die Daten im MSCRM in den folgenden Tabellen 


Es gibt neben der Grafik weitere Activities, die das MSCRM unterstützt.