I am trying to build a custom fetch query that will return the accounts that have recently become "active" by our internal description not in Dynamics status terms. We are an educational facility and thus we have a custom "Sessions" entity instead of a sales entity and this entity holds a "Start Date/Time" field and companies that hire us are "Clients" that I'm using for the fetchxml.
This is my goal:
- Only show accounts that have had a session with a start "date/time" This Fiscal Year but have had no related session with a start "date/time" in the last 2 Fiscal Years.
Is there a "not in" version of the "last X Fiscal Year" that can be achieved in FetchXML?
Here's the basic filter that I'm starting with but I need the "last-x-fiscal-years" line to be "not in"
<filter type="and">
<condition attribute="statecode" operator="eq" value="0" />
</filter>
<link-entity name="new_session" from="new_client" to="accountid" alias="aa">
<filter type="and">
<condition attribute="new_startdatetime" operator="this-fiscal-year" />
<condition attribute="new_startdatetime" operator="last-x-fiscal-years" value="2" />
<condition attribute="statuscode" operator="ne" value="794540005" />
</filter>
</link-entity>
Thanks
*This post is locked for comments
I have the same question (0)