web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 146 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 59

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans