Hello All.
I am trying to search simultaneity 2 tables with FetchXML as you may see below. The issue is that it should be a clause "OR" (if has in one table OR in another), but it react always as an "AND".
This code doesn't work:
<filter type="or" > <condition attribute="description" alias="ap" operator="like" value="%Dear%" /> <filter type="or" > <condition attribute="description" operator="like" value="%Dear%" /> <condition attribute="title" operator="like" value="%Dear%" /> </filter> </filter>
This code works:
<filter type="or" > <condition attribute="description" alias="ap" operator="like" value="%Dear%" /> <filter type="or" > <condition attribute="description" operator="like" value="%test%" /> <condition attribute="title" operator="like" value="%test%" /> </filter> </filter>
I tried to write it in many other ways without success.
E.g:
<filter type="or" >
<condition attribute="description" alias="ap" operator="like" value="%Dear%" />
<condition attribute="description" operator="like" value="%Dear%" />
<condition attribute="title" operator="like" value="%Dear%" />
</filter>
</filter>
or:
<link-entity name="activitypointer" from="regardingobjectid" to="incidentid" alias="ap" >
<attribute name="description" />
<filter type="or" >
<condition attribute="description" alias="ap" operator="like" value="%Dear%" />
</filter>
</link-entity>
<link-entity name="account" from="accountid" to="customerid" link-type="inner" >
<attribute name="accountnumber" />
</link-entity>
<filter type="or" >
<condition attribute="description" operator="like" value="%Dear%" />
<condition attribute="title" operator="like" value="%Dear%" />
</filter>
Please, maybe could someone help me with this issue?
Below do you have the full code.
Thank you in advance.
Best regards,
Dante Dantas
--------------------------------------------------------
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" > <entity name="incident" > <attribute name="title" /> <attribute name="ticketnumber" /> <attribute name="tri_responsibleteam" /> <attribute name="incidentid" /> <attribute name="tri_incidentnumber" /> <attribute name="createdon" /> <attribute name="contactid" /> <attribute name="ownerid" /> <attribute name="tri_environment" /> <attribute name="statuscode" /> <attribute name="description" /> <attribute name="prioritycode" /> <link-entity name="activitypointer" from="regardingobjectid" to="incidentid" alias="ap" > <attribute name="description" /> </link-entity> <link-entity name="account" from="accountid" to="customerid" link-type="inner" > <attribute name="accountnumber" /> </link-entity> <filter type="or" > <condition attribute="description" alias="ap" operator="like" value="%Dear%" /> <filter type="or" > <condition attribute="description" operator="like" value="%Dear%" /> <condition attribute="title" operator="like" value="%Dear%" /> </filter> </filter> <order attribute="title" descending="false" /> </entity> </fetch>