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

Microsoft Dynamics CRM - How to use Not-In clause in Fetch XMl using Javascript.

$
0
0

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:  

NameOutlet Category
ABC111,333
XYZ111,777,333
PQR555,777

Outlet Category Value will be : 

Name
111
777
555
333

Expected Result: Opportunities where Outlet Category is not having 111 and 333

PQR555,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.


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images