9,270
edits
Join the Power Platform Masterclass #2 starting April 23
(Created page with "This article lists several simpler examples of Sync Filter without linked entities. Notes: * SyncFilter fetches are incomplete - they do not list attributes (entity prope...") |
|||
Line 143: | Line 143: | ||
</fetch></syntaxhighlight> | </fetch></syntaxhighlight> | ||
== Private | == Private and team emails == | ||
My emails or emails owned by either myself or my team(s) which are up to 60 months old | My emails or emails owned by either myself or my team(s) which are up to 60 months old. | ||
<syntaxhighlight lang="xml> <fetch version="1.0"> | <syntaxhighlight lang="xml> <fetch version="1.0"> | ||
<entity name="email"> | <entity name="email"> | ||
Line 160: | Line 160: | ||
</fetch></syntaxhighlight> | </fetch></syntaxhighlight> | ||
== Related emails == | |||
<syntaxhighlight lang="xml> <fetch version="1.0"> | Show only emails related (regardingobjectid) to my business unit. | ||
<syntaxhighlight lang="xml><fetch version="1.0"> | |||
<entity name="email"> | |||
<filter type="and"> | |||
</filter> | <condition attribute="regardingobjectid" operator="eq-businessid" /> | ||
</filter> | |||
</entity> | |||
</fetch></syntaxhighlight> | |||
== Open cases == | |||
Show all open cases from last 60 days. | |||
<syntaxhighlight lang="xml><fetch version="1.0"> | |||
<entity name="incident"> | |||
<filter type="and"> | |||
<condition attribute="modifiedon" operator="last-x-days" value="60" /> | |||
<condition attribute="statuscode" operator="not-in"> | |||
<value>5</value> | |||
<value>6</value> | |||
</condition> | |||
</filter> | |||
</entity> | |||
</fetch></syntaxhighlight> | |||
== Omit inactive templates == | |||
This filter shows all questionnaires except inactive templates. | |||
<syntaxhighlight lang="xml><fetch version="1.0"> | |||
<syntaxhighlight lang="xml> <fetch version="1.0"> | <entity name="resco_questionnaire"> | ||
<filter type="and"> | |||
<filter type="or"> | |||
<condition attribute="resco_istemplate" operator="ne" value="1" /> | |||
<filter type="and"> | |||
<condition attribute="resco_istemplate" operator="eq" value="1" /> | |||
<condition attribute="statuscode" operator="eq" value="1" /> | |||
</filter> | </filter> | ||
</filter> | </filter> | ||
</entity> | </filter> | ||
</entity> | |||
</fetch></syntaxhighlight> | |||
== Complex example == | |||
This is an example of a more complex sync filter for the Annotation entity. Records must match one of the following conditions: | |||
* Annotations associated with opportunities or products | |||
* Notes (text annotations) not older than 3 months | |||
* Attachments (document annotations) associated with contacts, emails, tasks or appointments modified within last month | |||
* Attachments associated with accounts whose name ends with Products per Team.xls | |||
* Attachments associated with quotes max 12 months old | |||
<syntaxhighlight lang="xml><fetch version="1.0"> | |||
<entity name="annotation"> | |||
<filter type="and"> | |||
<filter type="or"> | |||
<condition attribute="objecttypecode" operator="in"> | |||
<value>3</value> | |||
<value>1024</value> | |||
<syntaxhighlight lang="xml> <fetch version="1.0"> | </condition> | ||
<filter type="and"> | |||
<filter type="and"> | <condition attribute="isdocument" operator="eq" value="0"/> | ||
<filter type=" | <condition attribute="modifiedon" operator="last-x-months" value="3"/> | ||
</filter> | |||
<filter type="and"> | |||
<condition attribute="isdocument" operator="eq" value="1"/> | |||
<condition attribute="objecttypecode" operator="in"> | <condition attribute="objecttypecode" operator="in"> | ||
<value> | <value>2</value> | ||
<value> | <value>4202</value> | ||
<value>4212</value> | |||
<value>4201</value> | |||
</condition> | </condition> | ||
<condition attribute="modifiedon" operator="last-x-months" value="1"/> | |||
</filter> | |||
<filter type="and"> | |||
<condition attribute="isdocument" operator="eq" value="1"/> | |||
<condition attribute="objecttypecode" operator="eq" value="1"/> | |||
<condition attribute="subject" operator="like" value="%Products per Team.xls"/> | |||
</filter> | |||
<filter type="and"> | |||
<condition attribute="isdocument" operator="eq" value="1"/> | |||
<condition attribute="objecttypecode" operator="eq" value="1084"/> | |||
<condition attribute="modifiedon" operator="last-x-months" value="12"/> | |||
</filter> | </filter> | ||
</filter> | </filter> | ||
</entity> | </filter> | ||
</entity> | |||
</fetch></syntaxhighlight> | |||
[[Category:Woodford]] [[Category:Support]] |