Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Need help with Code

$
0
0

Hi, 

I have no prior knowledge of coding.

I’m starting a new data migration project whereby I’ll need to use the code below to match CRM GUIDs in the migration tool.

The issue is, we need an if/else statement to be nested in the middle somewhere that only runs the code if the entitytype == “User”. Otherwise we want our migration tool to ignore the code and just use whatever data is already in place. 

If anyone can help I'll be eternally grateful.

 

public string[] Newfrom

                {

                                get

                                {

                                                string[] NewToValues = DataSchemaTypeConverter.ConvertTo<string[]>(this.to);

                                               

                                                for (int i =0; i<NewToValues.Length;i++)

                                                                {

                                                                                string[] ItemArray = NewToValues[i].Split('|');

                                                                               

                                                                                string entitytype = ItemArray[0];

                                                                                string oldGuid = ItemArray[1];

                                                                               

                                                                                var newGuid = LOOKUPB("accountid","account",WHEN("new_guid_dataimport",oldGuid));

                                                                                                                                                                                                                                               

                                                                                string newGuidstr = DataSchemaTypeConverter.ConvertTo<string>(newGuid);

                                                                               

                                                                                NewToValues[i]= ItemArray[0]+"|"+newGuidstr;

                                                                }

                                               

                                                return NewToValues;

                                }

                }

                                                   

                                                                                                                                      


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images