Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Filter lookup with XML and special character '&' does not work

(1) ShareShare
ReportReport
Posted on by 3
Hello,
 
I am currently trying to filter a lookup field in dynamics 365 crm using a fetchXML in a javascript. I have to view all the products with a custom text field ('my_variantstatus') not equal to 'R&D Stage' (and some other values).
Here is my filter xml: 
 
var filterXml = ''<filter type='and'><condition attribute='my_variantstatus' operator='ne' value='R&amp;D stage'/><condition attribute='my_variantstatus' operator='ne' value='Discontinued'/></filter>'';
 
 I have already tried remplacing the ampersand '&' with : '&', '&amp;', '&#38;', but none of them worked.
Please note that the script works well when I try to filter without the ampersand ('RD stage') and that it does not work with any other special character as well (quote, <, >, etc).
 
I am really confused so thank you in advance

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 671 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 167 Super User 2025 Season 1

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 138 Most Valuable Professional

Product updates

Dynamics 365 release plans