Skip to main content

Notifications

Announcements

No record found.

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

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.

  • vikas Profile Picture
    vikas 10 on at
    RE: 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

    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.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: 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

    Hi,

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

    HttpUtility.HtmlEncode(forecastName)

    www.inogic.com/.../

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans