web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 147

#2
DAnny3211 Profile Picture

DAnny3211 134

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans