Home » Dynamics » Migrating Dynamic 365 v9.0 Multi Select Option Set Field Data using SSIS

Migrating Dynamic 365 v9.0 Multi Select Option Set Field Data using SSIS

Text Widget

This is a text widget. The Text Widget allows you to add text or HTML to your sidebar. You can use a text widget to display text, links, images, HTML, or a combination of these. Edit them in the Widget section of the Customizer.

Introduction:

Microsoft Dynamics 365 v9.0 brings some of the most awaited features and enhancements. One of the important feature introduced in Dynamics v9.0 is Multi Select Option Set. Prior to Dynamics 365 v9, there was no provision to use multi-select option set field. Our this blog explains how data import works for multi-select option set field.

In this blog, we will see Migrating Dynamic 365 Multi Select Option Set Field data using SSIS.

Migrating Dynamic 365 Multi Select Option Set Field data:

SSIS Toolkit from our friends at KingswaySoft has always been our preferred tool for data migration and in the latest release, the team has introduced v9.1 of SSIS Integration Toolkit for Microsoft Dynamics 365.

Below are the steps to migrate the Multi Select Option set field value:

For example, consider a Multi Select option set field i.e. Select Choices (new_selectchoices)

  1. Create Connection Manager for Source and Destination CRM.
  2. Map the MultiSelect option set field in the Destination as given in below screenshot.multi-select-optionset-migration1
  3. If you want to change any options in the MultiSelect Option Set field for Destination CRM, then you need to follow the below steps :
  • Add an output column.multi-select-optionset-migration2
  •   Write custom code in a script as given below.
    private void SetMultiOptionSetValue(ref Input0Buffer Row)
        {
            string functionName = "SetMultiOptionSetValue ";
            List<string> listSTR = new List<string>();
            string updatedString = string.Empty;
            string s = string.Empty;
            try
            {
              string selectChoicesByName = Row.newselectchoicesname;
    
                listSTR = selectChoicesByName.Split(';').ToList();
    //Note: you can use value instead of string also
                listSTR.Remove("Item 4");
                listSTR.Add("custom");
                for (int i = 0; i < listSTR.Count; i++)
                {
                    if (i == listSTR.Count - 1)
                    {
                        s += listSTR.ElementAt(i);
                    }
                    else
                    { s += listSTR.ElementAt(i) + ";"; }
                }
    
                Row.opMultiSelect = s;
                  
            }
            catch (Exception ex)
            {
    
                throw new Exception(functionName + ex.Message); ;
            }
        }

    We need to concatenate all the option’s values in a string separated by “;”, Here we are storing the option’s value in a string and assigning it to output column i.e. opMultiSelect.

    4. Map this output column to the Destination MultiSelect Option Set field.multi-select-optionset-migration3 

     

    In above example, we have mapped Multi Select Option Set field with the label. Like above user can map with the values also.

    Note: Please use the latest version of Kingswaysoft for above Migration.

    Conclusion:

    We can migrate Multi Select Option Set field from one environment to another using steps described above. If you are migrating Multi Select Option Set field from one environment to another using KingswaySoft SSIS toolkit for Dynamics 365 v9.0 then you need to map Multi Select Option Set field with label or value.

from Microsoft Dynamics 365(CRM) Tips and Tricks http://bit.ly/2BJ0uWL
via IFTTT


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: