locked
CRM 2011 + webservice RRS feed

  • Question

  • Hello,

    I am using CRM 2011 and new to it.

     I have an webservice(object)  which requires parameter ,the parameters will be the Enities properties which is created in CRM 2011.

    like if I have created Enitiy 'order' which has fields like pickup date,weight,total amount

    and these are parameters which will be required for webservice for Courier.

    how would I fetch data from CRM 2011 and pass to webservice .

    I known plug-in are used for that, but how to write? and how to access the database? 

    please some one will explain me how to achieve this task?

    all sort of Information are welcomed.

    Thanks


    Thanks! Sneha
    Thursday, November 24, 2011 9:03 AM

Answers

  • Hi Sneha

    ..\CRM 2011 SDK 1.6\sdk\crmsdk2011.chm is form of Help file, so you should able to search any thing

     

    Please see below screenshot

     


    Many Thanks -Bhautik Desai xRM Technologies
    Thursday, November 24, 2011 12:10 PM
  • Hi Sneha

    Did this help?

    Please make sure to mark as answer to the response that helped you get through. This will help others with similar problem identify the answer and also close this thread as resolved.


    Many Thanks -Bhautik Desai xRM Technologies
    • Marked as answer by SnehaDeore Friday, November 25, 2011 5:18 AM
    Thursday, November 24, 2011 12:26 PM

All replies

  • Hi,

    CRM 4 & 2011 comes with CRM SDK. CRM SDK Provides you great documentation how you can access CRM programmatically.

    In CRM 2011 Add/Update/Delete any data can be achieved by multiple ways like Rest (WCF service), CRM 2011 SDK, and Fetch XML. Even, CRM Context provides you Meta data information to your code, so it provides the early binding of Classes and Objects. (So if you have your own entity called Order then you will have opportunity to write like Order myobj = new Order(); .

    The Plugins has several usages in CRM 2011. For your understanding, you can say Plugins in CRM 2011 are same as Triggers in SQL Server. Yes, you can configure Plugins before Insert/Update or After Insert/Update. (Which same as SQL server triggers.)

    I think, for you best approach is to download CRM 2011 SDK and see the great examples Microsoft CRM team has provided

    CRM 2011 SDK: http://www.microsoft.com/download/en/details.aspx?id=24004

    For your original question you can use following code

      Microsoft.Xrm.Sdk.IOrganizationService xrmService = crm.OrgService; // your CRM 2011 service
    
                EntityCollection allAccounts = xrmService.RetrieveMultiple(new QueryExpression("Accounts") { ColumnSet = new ColumnSet(true) });
    
                foreach (Entity eachAccount in allAccounts.Entities)
                {
                    string sname = eachAccount["name"].ToString();
                    string strAccountNumber = (eachAccount.Attributes.Contains("yourcolumnname")) ? eachAccount["yourcolumnname"].ToString() : string.Empty;
                }
    

     


    Many Thanks -Bhautik Desai xRM Technologies
    Thursday, November 24, 2011 9:43 AM
  • Hi Bhautik,

     

    Thank you so much for ur reply,

    which Topic should I read from SDK ?

    will I be able to access Data (order Enitiy) ?

    Thanks

    Sneha

     

     


    Thanks! Sneha
    Thursday, November 24, 2011 9:54 AM
  • Hi Sneha

    you will see ..\CRM 2011 SDK 1.6\sdk\crmsdk2011.chm (help), you can search the content in that

     

     

    Apart from that sample code is available ..\CRM 2011 SDK 1.6\sdk\samplecode\cs

     

    for different way to Read/Write data ..CRM 2011 SDK 1.6\sdk\samplecode\cs\generalprogramming

    Plugins : ...\CRM 2011 SDK 1.6\sdk\samplecode\cs\plug-ins

    Yes from the code you will able to access the Order data

     

      EntityCollection allAccounts = xrmService.RetrieveMultiple(new QueryExpression("Order") { ColumnSet = new ColumnSet(true) });

     

     

     


    Many Thanks -Bhautik Desai xRM Technologies
    Thursday, November 24, 2011 10:08 AM
  • Hi Bhauik,

     

    Thank you so much for your reply.

    but still not getting the exact part that I should read as I am completely new to CRM 2011

    I shall be very thankful to u if   answer in more detail,sorry to bother u so much.

    Thank u once again

     

     


    Thanks! Sneha
    Thursday, November 24, 2011 11:02 AM
  • Hi Sneha

    ..\CRM 2011 SDK 1.6\sdk\crmsdk2011.chm is form of Help file, so you should able to search any thing

     

    Please see below screenshot

     


    Many Thanks -Bhautik Desai xRM Technologies
    Thursday, November 24, 2011 12:10 PM
  • Hi Sneha

    Did this help?

    Please make sure to mark as answer to the response that helped you get through. This will help others with similar problem identify the answer and also close this thread as resolved.


    Many Thanks -Bhautik Desai xRM Technologies
    • Marked as answer by SnehaDeore Friday, November 25, 2011 5:18 AM
    Thursday, November 24, 2011 12:26 PM
  • Hi Bhautik

     

    Thank you so much for help.

     

    it was indeed a great help.

     

    Thanks

    Sneha


    Thanks! Sneha
    Friday, November 25, 2011 5:19 AM
  • Vasu,

    Please stop posting copies of posts.

    Thank you,


    Regards, Donna

    Wednesday, February 27, 2013 6:08 AM