Rss 2.0 via FEED
Ken Hughes... - MSCRM
Productivity, Technology and Automating Everything...
    
 

Some of the code I have for importing data (from ACT! 2000) to MS CRM creates new 'PhoneCall' activities / objects. The problem is, that it seems MSCRM does not allow you to programmatically modify the 'create date'.

Here is the code I use...

phonecall pc

            CrmDateTime start = new CrmDateTime();

            start.Value = DateTime.Parse("10/08/2005 12:30");

            pc.actualstart = start;

            pc.scheduledstart = start;

            CrmDateTime end = new CrmDateTime();

            end.Value = DateTime.Parse("10/08/2005 14:30");

            pc.actualend = end;

            pc.scheduledend = end;

            pc.subject = "Phone call regarding sales of Widgets Q2/2005");
***

            string desc =  "Start    : " + pc.actualstart.Value + "\n";

            desc += "End       : " + pc.actualstart.Value + "\n\n";
***

            desc += "The details of the phone call go in here");

            pc.description = desc;

            pc.regardingobjectid = new Lookup();

            pc.regardingobjectid.type = EntityName.contact.ToString();

            Guid contactGuid = new Guid(guidOfContactWeTelephoned);

            pc.regardingobjectid.Value = contactGuid;

 

 

The actualstart and scheduledstart (and ends) get populated with the current datetime (this seems to happen if the time they are set to is in the past).

 

Note the two lines between the ***'s - this is my solution / workaround and simply include the start/end times as text in the body/description of the phone call object.

 

Posted: Monday, August 20, 2007 2:07:39 PM (GMT Daylight Time, UTC+01:00)  #   Comments [0]
TAGS: .NET | C Sharp | Development | MSCRM | Software

DownloadDocument Today I was looking around for some MSCRM info. I came across a great document on the Microsoft Website, Using Microsoft Dynamics CRM 3.0 Small Business Edition. It is a PDF file but on their Website it has a little Word icon next to it and is described as a 'Microsoft Word file'.

This got me wondering if they were now describing it as this because Word 2007 can work with PDF files ?

I have the PDF add-in for Office 2007 so I right clicked on the file (after downloading it to my desktop) and chose 'Open With'  ..  'Microsoft Word 2007'.ConvertDocument

I was then presented with a ' File Conversion' dialog. I left the settings as default and cracked on (clicked OK).

This opened Word and munged in a load of initial PDF data from the file.

OpenedDocument

 

About 8 minutes later after a lot of repagination. It tells me that I have exceeded the maximum number of pages supported by Word.

 

ExcessPages

and from the Word status bar I can see the limit is 32,767  Pages

Note to self: Read PDF's in Foxit Reader, not Word.

Posted: Thursday, July 05, 2007 4:21:32 PM (GMT Daylight Time, UTC+01:00)  #   Comments [0]
TAGS: MSCRM | Office

So after some poor experiences with the MSCRM Data Migration framework I decided to get pragmatic and write a C# app to do the migration.

The CDF is poorly documented at best, it seems they (Microsoft) give you a bunch of database tables, an Excel spreadsheet outlining the schema and a 'Good Luck'. There is little 'googleable' (is that a word) knowledge about it either.

The good news was that the MSCRM SDK is much better documented (on MSDN). There is not a lot of googleable info around but there is enough (Stunnware proved pretty helpful for me).

There were other challenges also - the software we purchased for exporting the ACT! 2000 data to Access (Exporter Pro) did a good job of getting the data out of ACT but the Unique ID left a bit to be desired, they are basically a munge of punctuation characters and alphanumerics - what's wrong with a GUID or a int ??

So, anyway, I got there in the end...

The connecting to the CrmService was pretty easy, as was the population and addition of an account.

            crmSvc = new CrmService();

            crmSvc.Url = MsCrmUrl;

            crmSvc.Credentials = new System.Net.NetworkCredential(CrmUsername, CrmPassword, CrmDomain);

 

            account acct = new account();

            acct.name = "company name";

            acct.address1_line1 = "address line one";

            acct.address1_line2 = "address line two";

            acct.address1_line3 = "address line three";

            // etc

 

            Guid acctGuid = crmSvc.Create(acctGuid);

 

 

Simple as that - do it for each account...

Next installment will outline adding Contacts an then linking them to an account.

 

Posted: Tuesday, July 03, 2007 9:51:25 PM (GMT Daylight Time, UTC+01:00)  #   Comments [0]
TAGS: .NET | C Sharp | MSCRM | Software

One of the projects I am involved with at work was evaluating Microsoft CRM (MSCRM).

Out of the box, it comes as a pretty well fully featured CRM application, but it is also hugely customizable. I downloaded the SDK from here and had a quick play.
Within 20 – 30 minutes I had a quick extension / customisation working – it is a simple webpage allowing customers to register their own details and when submitted, that customer is automatically added to MSCRM.

It was incredibly simple to get working, just :-

  • Create a new web project
  • Add a web reference to MsCrmSdk
  • Add some textboxes and a submit button and on the 'submit click' event just :-
    • Create a new CrmService object
    • Set the URL for it and provide credentials if necessary
    • Create a new contact object
    • Populate it with the data from the textboxes
    • Call 'Create' on the CrmService object passing the contact object as a parameter

You're done...

Below is some sample code – it only picks up a few details about the contact, but should be fairly easy to enhance ... Enjoy

 

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using MsCrmSdk;

 

    public partial class _Default : System.Web.UI.Page

    {

        protected void Page_Load(object sender, EventArgs e)

        {

            btnInsert.Click += new EventHandler(btnInsert_Click);

 

        }

 

        void btnInsert_Click(object sender, EventArgs e)

        {

            string salutation = txtSalutation.Text;

            string firstName = txtFirstName.Text;

            string lastName = txtLastName.Text;

            string emailAddress = txtEmailAddress.Text;

 

            CrmService svc = new CrmService();

            svc.Url = "http://10.10.121.226:5555/mscrmservices/2006/crmservice.asmx";

            svc.Credentials = new System.Net.NetworkCredential("kenh", "Exchange1", "kennet");

 

            contact newContact = new contact();

            newContact.salutation = salutation;

            newContact.firstname = firstName;

            newContact.lastname = lastName;

            newContact.emailaddress1 = emailAddress;

 

            Guid guidResult = svc.Create(newContact);

 

            txtSalutation.Text = "";

            txtFirstName.Text = "";

            txtLastName.Text = guidResult.ToString();

 

        }

 

    }

Posted: Friday, May 25, 2007 12:38:31 PM (GMT Daylight Time, UTC+01:00)  #   Comments [0]
TAGS: ASP.NET | C Sharp | MSCRM
     
 
 
Copyright © 2008 Ken Hughes. All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 2.0 UK: England & Wales License.