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

When I'm adding special character "&" in a field in CRM and trying to save getting Business process error. Can someone help me to resolve this issue

(0) ShareShare
ReportReport
Posted on by 10

I'm using a field= "info" in fetch xml query in a custom workflow and when I'm adding special character"&" in a "info" field in crm form and trying to save I'm getting Business process error "Object reference not set to an instance of an object."

Fetch xml query :

@"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' no-lock='false'>
                                      <entity name='lt_backinfo'>
                                        <attribute name='str' />
                                        <attribute name='name' />
                                        <attribute name='from' />
                                        <attribute name='until' />
                                        <attribute name='category'/>
                                        <attribute name = 'info'/>
                                         <order attribute='name' descending='false' />
                                        <filter type='and'>
                                        <condition attribute='statecode' value='0' operator='eq'/>
                                          <condition attribute='cusid' operator='eq'  uitype='account' value='{0}' />
                                        </filter>
                                        <link-entity name='typeSet' from='typeSetID' to='typeid' visible='false' link-type='outer' alias='StrtType'>
                                          <attribute name='pecode' />
                                          <attribute name='sendtoAltas' />
                                        </link-entity>
                                      </entity>
                                    </fetch>";

Unhandled Exception: System.ServiceModel.FaultException

Exception while executing Execute method Customer: Object reference not set to an instance of an object.

Exception while executing Execute method Customer: Object reference not set to an instance of an object.

Sync workflow 'Send info to sys' terminated with error 'Exception while executing Execute method Customer: Object reference not set to an instance of an object.

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    You should be using below code to handle special character in fetchXml c# plugin

    HttpUtility.HtmlEncode(forecastName)

    www.inogic.com/.../

  • vikas Profile Picture
    10 on at

    Hi but in my case I’m taking input from user for this field . Here in this link they are declaring variable in code itself.

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
Martin Dráb Profile Picture

Martin Dráb 62 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Pallavi Phade Profile Picture

Pallavi Phade 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans