Performing searches RRS feed

  • Question

  • It is indeed difficult for a newcomer to MS CRM to grasp the whole development/SDK


    Is there a general rule or some guidance someone could kindly help me with?


    How would you do a search on some entity based on some value and retrieve the results back from the webservice?


    Eventually when figured out, if I have designed an ASPX page which will be a "starting" page for our MS CRM solution, how would I get hold of the ID/GUID of an entity that was clicked, which is calling our application?

    So for example if we double clicked on an entity in "Accounts" and say it were to show our application, how would I get a hold of which account it was that was used to launch our page? Is this possible?


    To give you a better idea, trying to develop a solution which will allow you to perform a custom search on a series of things. So when you click on a button or something in an account edit page, it will launch our application from which will carry out the rest of the searching procedure.


    How do we enable MS CRM to allow us to add a button or link into an account page, so when they click on it, it will launch our application within MS CRM? Is this possible?


    Finally, if we created a custom entity in MS CRM, I see that the tables are also created in SQL Server. That's cool, but now how do I use these new entities and perform operations on them? Such as creating and saving a new object of that type of custom entity or performing searches on them?


    Much appreciated for your answers.

    Tuesday, June 19, 2007 11:03 AM


All replies

  • To search, create a QueryExpression (more powerful) or QuerybyAttribute (simpler) object and pass it to the RetrieveMultiple method, or use the Retrieve method if you have the parimary key of the entity you want




    To add a button on a CRM account page, you make a change to the ISV.config.xml page. If you include the PassParams=1 attribute, then the accountid will be passed on the querystring to your .aspx page



    You can access custom entities like any other entities through the CRM web service. What you have to do is update the Web Reference in your .Net project after creating the new entity; this entity will now appear as a class within the web service classes

    Tuesday, June 19, 2007 1:18 PM
  • Many thanks David for your speedy reply.

    I tried updating the webservice after creating this custom entity but I still do not see it in IntelliSense.


    in the MS CRM application I created a custom entity, lets say "Candidate". I've seen in SQL Server the appropriate tables being created, that's cool and the entity exists in MS CRM. I then tried to update the webservice in VS 2003, rebuilt the project and started to look into the intellisense and cannot see "Candidate" there at all. Any ideas? Or am I doing something incorrectly? Perhaps I misunderstood?


    In addition, could you give me a quick simple example on working with a custom entity? So if we had "EntityA" created in MS CRM application, I would want to do a search in EntityA on a field called "name" and search for "bob" on a LIKE statement/condition.


    Is there a way to add a button/link in an account form in MS CRM? This will be so that when you click on it, it will load the custom application for MS CRM, passing it of course as you stated on how to, the ID of that account/entity.



    Many thanks David!

    Tuesday, June 19, 2007 1:42 PM
  • All custom entities and fields will have a prefix, by default it is CRM unless you changed it in organization settings. So your Candidate entity would actually be named YourPrefix_candidate. Does that help any?




    PS I assume you published your entity after you created it? If not you have to publish your new entity. Any enity customizations (new entities, new fields, new tabs, new form layout etc) must be published before they are completely available.

    Wednesday, June 27, 2007 6:48 PM