Dec 20, 2016

Migrate Connections using Kingswaysoft Adapter

We all use Kingswaysoft Adapter to migrate data to Dynamics CRM. Just thought of sharing related tricks.

Here I reveal how to migrate connection, which can be little tricky than other entities. Important part is we need Connection roles are configured correctly. In my example, Employee and Employer Roles needs to be configured as illustrated below.





Account (i.e. Organisation in given example) is Employer and Contact (i.e. Individual in given example) is Employee. See how they associated with each other and enabled for particular entities.
Now see the fields we need to map with relevant information. We pass correct texts for Roles and Guids for related records. We need to pass object type code as well.


Actual fields we are mapping here as below;

Record1id = Connected To
Record1roleid = Role (To)
Record2id = Connected From
Record2roleid = Role (From)

For Roles need to resolve with Primary field as below since we are passing the names. For the safe side I enable the "Ignore Case". Still we need to make sure spellings are correct.

Object Type Code for Custom entities
This is tricky since this value can be different based on environment. Just check the URL of an open record of same type to obtain it.

Dec 8, 2016

Passing and Receiving values (parameters) in Custom workflow

Just thought of posting this code snippet on input/output parameters in CWF. In most of the places it explains well on how to declare the parameters, but not using of get, set methods in the code.

Here how we declare them;

[RequiredArgument]
[Input("Salary")]
public InArgument<Double> SalaryVal { get; set; }

[OutputAttribute("Tax")]
public OutArgument<Double> TaxVal { get; set; }

...and this is how you associate to the code within the Execute method;

protected override void Execute(CodeActivityContext executionContext)
{
//...........
//...........

Double _salaryVal = SalaryVal.Get(executionContext);

// Calculation goes here
// and return to _taxVal

TaxVal.Set(executionContext, _taxVal);

}