Wednesday, August 30, 2017

How Advanced Find works

We have the two ways to write the query to search.
1: FetchXml
<?xml version="1.0"?>

-<fetch distinct="true" mapping="logical" output-format="xml-platform" version="1.0">


-<entity name="account">

<attribute name="name"/>

<attribute name="primarycontactid"/>

<attribute name="telephone1"/>

<attribute name="accountid"/>

<attribute name="openrevenue"/>

<attribute name="numberofemployees"/>

<order descending="false" attribute="name"/>


-<filter type="and">


-<filter type="or">

<condition attribute="revenue" value="50000" operator="gt"/>

<condition attribute="numberofemployees" value="20" operator="gt"/>

</filter>

</filter>


-<link-entity name="opportunity" alias="ae" to="accountid" from="parentaccountid">


-<filter type="and">

<condition attribute="createdon" value="6" operator="last-x-months"/>

</filter>

</link-entity>

</entity>

</fetch>

2: Graphical creation of query
Steps:
1. Go to Advanced Find.
2. Fill in criteria from the image below.( Remember: To use OR/AND condition two conditions should be there and they should be selected. selection can be done by clicking on left down arrow and clicking over select. If you want to narrow down the query then further add another condition)
3. Sometimes you will not find the records in result, for that include those columns which are included in query. This can be done by Clicking Edit Column and add those column.
4. Save the query or Run the query.