locked
Queries in CRM RRS feed

  • Question

  • Hello,

    What is an equivalent query to" select top n * from table." ? in dynamics crm 4.0. By using queryexpression or soap webservice in jscript

    Thanks for help.

    Regards

    Tuesday, March 20, 2012 2:24 PM

Answers

  • Hi 

     The way I would go about implementing this is

     write a equvivalent  fetchXML query like

    then use FetchXmlToQueryExpressionRequest  to Convert FetchXML to QueryExpression

     Or

     Use Paging info to limit the Records

    QueryExpression query = new QueryExpression();
    query.PageInfo = new PagingInfo();
    query.PageInfo.Count = 200; // or 50, or whatever
    query.PageInfo.PageNumber = 1;

    Which would produce Fetchxml like

    <fetch mapping='logical' page='1' count='200'>

    hth

    dkay

     if the response answered your question, please take a minute and mark the response as an answer.

    • Marked as answer by dc74 Tuesday, March 20, 2012 3:45 PM
    Tuesday, March 20, 2012 2:33 PM

All replies

  • Hi 

     The way I would go about implementing this is

     write a equvivalent  fetchXML query like

    then use FetchXmlToQueryExpressionRequest  to Convert FetchXML to QueryExpression

     Or

     Use Paging info to limit the Records

    QueryExpression query = new QueryExpression();
    query.PageInfo = new PagingInfo();
    query.PageInfo.Count = 200; // or 50, or whatever
    query.PageInfo.PageNumber = 1;

    Which would produce Fetchxml like

    <fetch mapping='logical' page='1' count='200'>

    hth

    dkay

     if the response answered your question, please take a minute and mark the response as an answer.

    • Marked as answer by dc74 Tuesday, March 20, 2012 3:45 PM
    Tuesday, March 20, 2012 2:33 PM
  • Thanks i tried it works.
    Tuesday, March 20, 2012 3:44 PM