locked
Object intellisense in CRM2011 development RRS feed

  • Question

  • Hi

    I wonder if anyone can clear up one basic but yet important thing for me. I have a CRM 2011 installation running and try to make up my mind as to what way I want to access data in my CRM through the sdk.

    I'm keen on using linq to crm as I already use linq to sql and are familiar with the syntax - one thing puzzles me though:

    I don't seem to have any intelisense in my visual studio when I will create a new object type - for instance a new contact.

    In the "old" api (crm 3.x and 4.x) one could generate a classfile using the wsdl tool and after that just write:

    contact cont = new contact();

    After that you'd have full intellisense on the new objects properties - contact.firstname = "xxx";

    As I've seen this approach in crm2011 one must write:

    Entity contact = new Entity("contact");

    contact["lastname"] = "contact created using IOrganizationSerivce";

    _service.Create(contact);

    (where _service is the IOrganizationService)

    to make a new contact - eg . no intellisense on the crm entity object properties!?

    Can someone tell me if I'm missing some important things here?

    Is it possible to work in an object oriented (and typesafe!) way with entities in crm 2011 - and please a sort example if possible...

    Kind regards

    Thomas

    Wednesday, March 9, 2011 7:03 PM

Answers

  • In CRM 3 and 4 the entity object classes were all generated when you created the web service reference.  In CRM 2011 you have to use the CrmSvcUtil.exe tool to generate the classes.  Then you can use both the contact.lastname and contact["lastname"] syntax with the same objects, and you have full intellisense.  see here: http://msdn.microsoft.com/en-us/library/gg327844.aspx 

     


    Erik Pool | Avanade XRM | http://erikpool.blogspot.com
    Thursday, March 10, 2011 12:01 AM