Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

FetchQuery doubt

$
0
0

Question:

     Check whether all the documents against the solution are with document status ‘Completed’ and have an expiry date or ‘Not Required’

Query:

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

<entity name="document">

<attribute name="documentid" />

<attribute name="documentid_text"/>

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

<filter type="and">

<filter type="or">

<filter type="and">

<condition attribute="documentstatus" value="Completed Value" operator="eq"/>

<condition attribute="expirationdate" value="{2}" operator="on-or-after"/>

</filter>

<condition attribute="documentstatus" value="Not Required" operator="eq"/>

</filter>

<condition attribute="statecode" value="0" operator="eq"/>

</filter>

<link-entity name="solution_document"  intersect="true" visible="false" to="documentid" from="documentid">

<link-entity name="solution" to="solutionid" from="solutionid" alias="ac">

<filter type="and">

<condition attribute="solutionid"  operator="eq" value="{1}" />

</filter>

</link-entity>

</link-entity>

</entity>

</fetch>

So how can I write query on condition as 'only check for expiration date on documents where the document status is ‘Completed’ where the associated Required Document record has the flag ‘Can Expire’ set to yes'.

Can anyone guide me please...


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>