Hi,
How can we use Not-In clause in Fetch XMl using JS.
We have two entities a.Opportunities and b. Outlet Category with N:N relationship.
we have data 1. Opportunities : Data will be as below:
| Name | Outlet Category |
| ABC | 111,333 |
| XYZ | 111,777,333 |
| PQR | 555,777 |
Outlet Category Value will be :
| Name | |
| 111 | |
| 777 | |
| 555 | |
| 333 |
Expected Result: Opportunities where Outlet Category is not having 111 and 333
| PQR | 555,777 |
Our Code:
var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" +
"<entity name='gts_opportunity'>" +
"<attribute name='gts_name'/>"+
"<attribute name='gts_description'/>"+
"<attribute name='gts_opportunityid'/>" +
"<link-entity name='gts_gts_opportunity_gts_outletcategory' from='gts_opportunityid' to='gts_opportunityid' visible='false' intersect='true'>" +
"<link-entity name='gts_outletcategory' from='gts_outletcategoryid' to='gts_outletcategoryid' alias='ar' link-type='outer'>" +
"<attribute name='gts_outletcategoryid'/>" +
"</link-entity>" +
"</link-entity>" +
"<filter type='and'>" +
"<condition entityname='ar' attribute='gts_outletcategoryid' operator='null' />" +
"</filter>" +
"</entity>" +
"<fetch/>"
Regards,
Abhishek.






