| Best Software Act! is very popular CRM for small | | | | L_CONTACT.JOBTITLE");oValue = |
| and mid-size organization. This system attracts | | | | cField.GetValue(cList[i]);if (oValue != null |
| business owner by its low price, plus system is | | | | && |
| very easy to use. However if your business is | | | | !(oValue.ToString().Trim().Equals("")))strContactXml |
| growing you should reach the moment to | | | | += "[CDATA[" + Regex.Replace(oValue.ToString(), |
| implement more advanced CRM solution. Natural | | | | "\r\n", " |
| question is - how do we convert the data from | | | | ") + "]]";o This is only portion of the data, that |
| Act! to new CRM solution and the mapping of | | | | could be transferred into CRM, the whole list of |
| your objects for conversion. You would probably | | | | fields is too long for small article, but your could |
| like to avoid operator data entry with potential | | | | design the whole list of desired fields. Please, pay |
| numerous errors and mistypes. Assuming that | | | | special attention to replace |
| you are IT specialist, we'll give you technical side | | | | HTML tag - this is required for text data transfer |
| of Act to MS CRM data migration:o First you | | | | into CRMo Next is import application creation. We |
| need to download Act! SDK from Best Software | | | | will not describe here connection to MS CRM |
| websiteo Install Act! SDK on the computer, where | | | | details - please read Microsoft CRM SDK if you |
| you plan to do programmingo We'll use | | | | need this examples. We'll concentrate on the |
| asynchronous data export/import model, this | | | | nature of the import. |
| means that we'll design the system, containing | | | | The XML export file should look like this: |
| two parts: export into XML and this XML file | | | | TA[1234 W. Big |
| import into the CRMo Lets code Act! data export | | | | 6]][CDATA[Toy |
| application, we'll use C# to address Act | | | | B2DAD}o Reading, parsing and MS CRM object |
| Framework classes, we'll need these libraries:using | | | | creation look is relatively simple: |
| Act.Framework;using | | | | Microsoft.Crm.Platform.Proxy.BizUser bizUser = |
| Act.Framework.Activities;using | | | | new Microsoft.Crm.Platform.Proxy.BizUser(); |
| Act.Framework.Companies;using | | | | ICredentials credentials = new |
| Act.Framework.ComponentModel;using | | | | NetworkCredential(crmUsername, crmPassword, |
| Act.Framework.Contacts;using | | | | crmDomain);bizUser.Url = crmDir + |
| Act.Framework.Database;using | | | | "BizUser.srf";bizUser.Credentials = credentials; |
| Act.Framework.Groups;using | | | | Microsoft.Crm.Platform.Proxy.CUserAuth userAuth |
| Act.Framework.Histories;using | | | | = bizUser.WhoAmI(); |
| Act.Framework.Lookups;using | | | | // CRMContact proxy object |
| Act.Framework.MutableEntities;using | | | | Microsoft.Crm.Platform.Proxy.CRMContact contact |
| Act.Framework.Notes;using | | | | = new Microsoft.Crm.Platform.Proxy.CRMContact |
| Act.Framework.Opportunities;using | | | | ();contact.Credentials = credentials;contact.Url = |
| Act.Framework.Users;using Act.Shared.Collections;o | | | | crmDir + "CRMContact.srf"; |
| To connect to Act! database: | | | | CorrectXML("Contacts.xml", userAuth.UserId); |
| ActFramework framework = new | | | | StreamReader reader = |
| ActFramework();framework.LogOn("Act | | | | File.OpenText("Contacts.xml");string input = |
| Username", "password", "SERVER", "Database");o | | | | null;while ((input = reader.ReadLine()) != null) |
| Now we need Act field names to map them with | | | | {string strContactId = contact.Create(userAuth, |
| the fields in the MS CRM:private void | | | | input); |
| ShowContactsFieldsDescriptions(ActFramework | | | | Console.WriteLine("Contact {0} is created", |
| framework) { | | | | strContactId);log.Debug("Contact " + strContactId |
| ContactFieldDescriptor[] cFields = | | | | + " is created"); |
| framework.Contacts.GetContactFieldDescriptors(); | | | | }o Just consider in more details CorrectXML |
| ContactFieldDescriptor cField;for(int x = 0; x "; | | | | function - it places OwnerId into XML contact |
| ContactFieldDescriptor cField; | | | | tree:private void CorrectXML(string fileName, |
| Object oValue; | | | | string userId) { |
| // First NamecField = | | | | File.Move(fileName, fileName + ".old"); |
| L_CONTACT.FIRSTNAME");oValue = | | | | StreamReader reader = File.OpenText(fileName + |
| cField.GetValue(cList[i]);if (oValue != null | | | | ".old"); |
| && | | | | FileInfo t = new FileInfo(fileName); |
| !(oValue.ToString().Trim().Equals("")))strContactXml | | | | StreamWriter writer = t.CreateText();string input |
| += "[CDATA[" + oValue.ToString() + "]]"; | | | | = null;while ((input = reader.ReadLine()) != null) |
| // Last NamecField = | | | | {input = Regex.Replace(input, |
| L_CONTACT.LASTNAME");oValue = | | | | "{_REPLACE_ME_}", |
| cField.GetValue(cList[i]);if (oValue != null | | | | userId);writer.WriteLine(input); |
| && | | | | }reader.Close();writer.Close(); |
| !(oValue.ToString().Trim().Equals("")))strContactXml | | | | File.Delete(fileName + ".old"); |
| += "[CDATA[" + oValue.ToString() + | | | | }o Finally, we are launching export, import, |
| "]]";elsestrContactXml += "" + "N/A" + ""; | | | | opening MS CRM and looking at the contact list, |
| // SalutationcField = | | | | transferred from Act!o Separate task would be |
| L_CONTACT.SALUTATION");oValue = | | | | Sales data from Act!, Notes etc. - we plan to |
| cField.GetValue(cList[i]);if (oValue != null | | | | describe them in the future articles |
| && | | | | Good luck with integration! If you want us to do |
| !(oValue.ToString().Trim().Equals("")))strContactXml | | | | the job - give us a call 1-630-961-5918 or |
| += "[CDATA[" + oValue.ToString() + "]]"; | | | | 1-866-528-0577! |
| // Job TitlecField = | | | | |