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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

How to escape an apostrophe in addCustomFilter Client API function

(0) ShareShare
ReportReport
Posted on by 5

Hi All,

I am having some issues attempting to escape an apostrophe whilst using the addCustomFilter Client API function. 

I have tried a number of different methods but continue to get "Invalid XML Format" error message. I was able to successfully escape an ampersand character using &amp.

Here are some of the things I have tried:

  • Using ' to escape the apostrophe.
  • Using &39; to escape the apostrophe.
  • Built a string variable into fetch xml but still getting the same issue.
  • Instead of using equal to in the fetch query I used contains but still getting the error message.
  • Tried escaping using HTML character references - still no luck.

Has anyone experienced this issue before?

Thanks,

Shea

I have the same question (0)
  • Suggested answer
    RodRodriguez Profile Picture
    on at

    Howdy!

    I believe you are looking for this:  

    '

    docs.oracle.com/.../obcCustomXml.htm

    Also here is the Microsoft docs as well:

    docs.microsoft.com/.../xml-character-entities

  • SheaLeonard Profile Picture
    5 on at

    Hi Rod,

    Thanks for your reply.

    Unfortunately I have also tried this and to no avail (including the #). To get around it I have had to find that record by GUID in the filter query.

    Thanks,

    Shea

  • Goksel oral Profile Picture
    25 on at

    Have you tried the method -  System.Security.SecurityElement.Escape(string) to replace those and other methods mentioned below

    weblogs.sqlteam.com/.../

  • SheaLeonard Profile Picture
    5 on at

    This is JavaScript issue and not C# but thanks for the response.

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 80

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans