Wednesday, 25 May 2016

Monday, 25 April 2016

Released MSXrmTools Solution : MSXRMTOOLS_1_0_0_1 For Dynamics CRM 2016/2015 - includes FetchXML Tester, FetcXML Tutorials, Metadata Browser

MSXrmTools Solution: MSXRMTOOLS_1_0_0_1 for Dynamics CRM 2016/2015 includes below features:
Download here: http://msxrmtools.com/fetchxml/FetchXMLTesterSolution

  • FetchXML Tester: Test FetchXML within Dynamics CRM Organisation. 

  • FetchXML Tutorials: Learn FetchXML within Dynamics CRM organization and execute sample code to visualize results from your organization.

  • Metadata Browser: Browse Dynamics CRM metadata 


Thursday, 21 April 2016

Sunday, 17 April 2016

Using "older than" clauses for date and time values in FetchXML Query

The following example shows a FetchXML that finds incidents that are older than 30 minutes.
  1. <fetch>
  2. <entity name="incident">
  3. <attribute name="title" />
  4. <attribute name="ticketnumber" />
  5. <attribute name="createdon" />
  6. <attribute name="incidentid" />
  7. <filter type="and">
  8. <condition attribute="createdon" operator="olderthan-x-minutes" value="30" />
  9. </filter>
  10. </entity>
  11. </fetch>
- See more at: http://msxrmtools.com/fetchxml/reference

fiscal-period - FetchXML Query

The following example shows a FetchXML aggregation expression that sums the total amount of orders fulfilled and groups the result by fiscal semester and fiscal year.
  1. <fetch aggregate="true">
  2. <entity name="order">
  3. <attribute name="totalamount" aggregate="sum" alias="total"/>
  4. <attribute name="datefulfilled" groupby="true" dategrouping="fiscal-period"/>
  5. </entity>
  6. </fetch>
Explanation
To create group by with linked entity FetchXML:
  • Create an aggregate query
  • Add link-entity node for entity which contains group by attribute (systemuser entity in this case.)
  • In link-entity node add required attribute containing groupby keyword with value set to true.
- See more at: http://msxrmtools.com/fetchxml/reference

in-fiscal-period-and-year Query - FetchXML Query

The following example shows a FetchXML expression that finds all orders fulfilled in period three of fiscal year 2013, according to the organization’s fiscal year settings. If the organization uses fiscal months, the query returns results from month three. If the organization uses fiscal quarters, the query returns results from quarter three. If the organization uses fiscal semesters, no results are returned; there are only two semesters, and the value supplied is therefore out-of-range.
  1. <fetch>
  2. <entity name="order">
  3. <attribute name="name"/>
  4. <filter type="and">
  5. <condition attribute="datefulfilled" operator="in-fiscal-period-and-year">
  6. <value>3</value>
  7. <value>2013</value>
  8. </condition>
  9. </filter>
  10. </entity>
  11. </fetch>
Explanation
To create in-fiscal-period-and-year FetchXML query:
  • In condition attribute set operator keyword to in-fiscal-period-and-year.
    <condition attribute="datefulfilled" operator="in-fiscal-period-and-year">
    
  • Specify value of fiscal period in value attribute of condition tag.
    <value>3</value>
    
  • Specify value of fiscal year in another value attribute of condition tag.
    <value>2013</value>
- See more at: http://msxrmtools.com/fetchxml/reference

in-fiscal-period - FetchXML Query

The following example shows a FetchXML expression that finds all orders fulfilled in period three of any fiscal year, according to the organization’s fiscal year settings. The fiscal period value is specified in the value attribute of the condition tag. If the organization uses fiscal months, the query returns results from month three. If the organization uses fiscal quarters, the query returns results from quarter three. If the organization uses fiscal semesters, no results are returned; there are only two semesters, and the value supplied is therefore out-of-range.
  1. <fetch>
  2. <entity name="order">
  3. <attribute name="name"/>
  4. <filter type="and">
  5. <condition attribute="datefulfilled" operator="in-fiscal-period" value="3"/>
  6. </filter>
  7. </entity>
  8. </fetch>
Explanation
To create in-fiscal-period FetchXML query:
  • In condition attribute set operator keyword to in-fiscal-period.
    <condition attribute="datefulfilled" operator="in-fiscal-period" value="3"/>
    
  • Specify value of fiscal period in value attribute of condition tag.
- See more at: http://msxrmtools.com/fetchxml/reference

next-x-fiscal-years Query - FetchXML Query

The following example shows a FetchXML expression that finds all opportunities with an estimated close date in the next three fiscal years, based on the organization’s fiscal year settings.
  1. <fetch>
  2. <entity name="opportunity">
  3. <attribute name="name"/>
  4. <filter type="and">
  5. <condition attribute="estimatedclosedate" operator="next-x-fiscal-years" value="3"/>
  6. </filter>
  7. </entity>
  8. </fetch>
Explanation
To create next-x-fiscal-years FetchXML query:
  • In condition attribute set operator keyword to next-x-fiscal-years.
    <condition attribute="createdon" operator="in-fiscal-year" value="2013"/>
    
  • Specify value of x in value attribute of condition tag.
- See more at: http://msxrmtools.com/fetchxml/reference

In Fiscal Year - FetchXML Query

The following example shows a FetchXML expression that finds all accounts created in fiscal year 2013.
  1. <fetch>
  2. <entity name="account">
  3. <attribute name="name"/>
  4. <filter type="and">
  5. <condition attribute="createdon" operator="in-fiscal-year" value="2013"/>
  6. </filter>
  7. </entity>
  8. </fetch>
Explanation
To create In Fiscal Year FetchXML query:
  • In condition attribute set operator keyword to in-fiscal-year.
    <condition attribute="createdon" operator="in-fiscal-year" value="2013"/>
- See more at: http://msxrmtools.com/fetchxml/reference 

Last Fiscal Period - FetchXML Query

The following example shows a FetchXML expression that finds all orders fulfilled in the last fiscal period, according to the organization’s fiscal year settings.
For example, if the organization uses fiscal months, the query returns orders fulfilled in the last fiscal month. If the organization uses fiscal quarters, the query returns orders fulfilled in the last fiscal quarter. If the organization uses fiscal semesters, orders fulfilled in the last fiscal semester are returned.
  1. <fetch>
  2. <entity name="order">
  3. <attribute name="name"/>
  4. <filter type="and">
  5. <condition attribute="datefulfilled" operator="last-fiscal-period"/>
  6. </filter>
  7. </entity>
  8. </fetch>
Explanation
To create last fiscal period FetchXML query:
  • In condition attribute set operator keyword to last-fiscal-period.
    <condition attribute="datefulfilled" operator="last-fiscal-period"/>
- See more at: http://msxrmtools.com/fetchxml/reference