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 CRM (Archived)

LookupService Encoding Error

(0) ShareShare
ReportReport
Posted on by

After migrating a previous CRM install to CRM 2016 there were a number of issues to be fixed. One of the issues involved a form with two dropdown boxes,

1. Selecting a value from the top dropdown box "Employers" would run a javascript function that returned a view with all the employees for that employer

2. The view would be used to populate the second ("Employees") dropdown box

There was an error that occurred anytime the Employer name contained an ampersand so I modified the javascript to encode the ampersand and everything worked fine after that, until I noticed that after creating the record, if you re-entered the same record you just created and then tried to click on the little magnifying glass icon associated with the "Employee" there would be a number of errors thrown - again, only if the "Employer" dropdown contained an employer name with an ampersand  - but the it doesn't appear that the same javascript is being executed.

If I run fiddler when attempting to do this, I appear to get an error associated with the ampersand when making a call to LookupService.asmx. The error says "An error occurred while parsing EntityName..."

System.Xml.XmlException: An error occurred while parsing EntityName. Line 8, position 74.

   at System.Xml.XmlTextReaderImpl.Throw(String res, Int32 lineNo, Int32 linePos)

   at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)

   at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)

   at System.Xml.XmlTextReaderImpl.ParseAttributes()

   at System.Xml.XmlTextReaderImpl.ParseElement()

   at System.Xml.XmlTextReaderImpl.ParseElementContent()

   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)

   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)

My question is - how do I find the code that is calling the LookupService? I do not see anything directly associated with clicking on the magnifying glass icon associated with the dropdown. Is there some way to view (or step through (F11)) the call to the LookupService?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

    Is this with all the browser?

    Did you clear the cache?

    Please refer the following thread:

    community.dynamics.com/.../203041

  • Community Member Profile Picture
    on at

    No, it won't be a cache issue.

    When creating a new record, the "Employers" dropdown is associated with a javascript file that executes the query to populate the "Employees" dropdown. This allows me to escape the ampersand before the query for "Employees" is submitted.

    When attempting to edit an existing record, the "Employer" and "Employee" dropdowns will display the values that were selected when the record was created. However, if I want to change the "Employee" value I click on the dropdown's "search" icon and it seems that this causes a query to execute that will populate the control with all the employees associated with the current employer, but the execution of this query does NOT go through the same javascript functions that are used when the record is created so I do not have the opportunity to escape the ampersand.

    My question is, how do I identify the code that is being executed to make this query? I can only imagine that there is a relationship by configuration or convention that links the control to the query but I do not know enough about CRM to find that code. If I can find the code, I can escape the ampersand BEFORE the query is made (just as I did in the previous javascript file) and everything should be fine.

    Thanks

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans