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.

  • vikas Profile Picture
    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
    28,961 Moderator 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,020 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,837 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans