locked
CRM fetchXml from ASP.net Code behind RRS feed

  • Question

  • Hello

    I am new to CRM and i was trying to find a way to use the fetchXML from ASP.net codebehind.

    As of now, my html page works fine as it has a "Post" in the form tag with the "Action" element being set to a url that has ~/ fetchData.aspx and a javascript with the script tag. I am wondering if this can also be implemented on weform code behind. all the examples i see on the web is about the use of Crm webservice to get data which i don't want to use as i don't have enough info on that

    Your help will be appreciated

    thank you

    mekbeb

    Wednesday, August 18, 2010 4:29 PM

Answers

  • Hi,

    Even if you are able to call the fetchData.aspx page in the code behind then also you do not have mucn control over the record return in the page.

    Better do the web service call using the Javascript. MS CRM provides a very good feature of calling MS CRM Web Services using Javascript. On the form load / on any page, you can call the Javascript Web Services to Query the desired entity from where you want to fetch the details. It returns the XML with the Entity details. Retrieve the details and populate the attributes with the result.

    So, you have to work with Client Side Web Services - MS CRM

    Please refer below link - how to work with client side web services with MS CRM.
    http://www.stunnware.com/crm2/topic.aspx?id=jswebservice2

    And here is the tool which generates the Javascript Code (very helpful):
    http://www.stunnware.com/crm2/topic.aspx?id=JSWebService

    Hope this helps.


    Thanks, Ranjitsingh R | http://mscrm-developer.blogspot.com/ | MS CRM Consultant
    Wednesday, August 18, 2010 6:08 PM

All replies

  • Hi,

    Even if you are able to call the fetchData.aspx page in the code behind then also you do not have mucn control over the record return in the page.

    Better do the web service call using the Javascript. MS CRM provides a very good feature of calling MS CRM Web Services using Javascript. On the form load / on any page, you can call the Javascript Web Services to Query the desired entity from where you want to fetch the details. It returns the XML with the Entity details. Retrieve the details and populate the attributes with the result.

    So, you have to work with Client Side Web Services - MS CRM

    Please refer below link - how to work with client side web services with MS CRM.
    http://www.stunnware.com/crm2/topic.aspx?id=jswebservice2

    And here is the tool which generates the Javascript Code (very helpful):
    http://www.stunnware.com/crm2/topic.aspx?id=JSWebService

    Hope this helps.


    Thanks, Ranjitsingh R | http://mscrm-developer.blogspot.com/ | MS CRM Consultant
    Wednesday, August 18, 2010 6:08 PM
  • Hi Ranjitsingh

    Thank you for the info. It seems calling the MS CRM webservice is a better option. But when you say "you don't have much control over the record return in the page", can you drop a line or two regarding that. My aim was to create an IFRAME in a user control and damp it in the webform once i get a response from the post made by HttpWebReqest. I have never done that though. My client wants an iFrame liked feature when data is searched.

    Thank you

    Mekbeb

    Wednesday, August 18, 2010 6:52 PM