?
Solved

ms dynamics 4.0 - email with apostrophe in it

Posted on 2011-03-18
4
Medium Priority
?
877 Views
Last Modified: 2012-05-11
hi,

i am programatically creating a contact in crm 4.0.
i am using a windows service which calls into a wsdl generated proxy of the crm webservice.
it works fine - but when i create a contact which has an email address that contains an apostrophe. i.e

contact crmContact = new contact();
contact.emailaddress1 = "sean.o'brien@abc.com";
//add other properties...

//this is an instance of my proxy
crmService.create(crmContact);

it always falls over with the following soap exception:

2011-03-16 16:06:56,448 [7] ERROR  [(null)] - Soap Exception in :mywindowsservice Error : <error>
<code>0x80040216</code>
<description>An unexpected error occurred.</description>
<type>Platform</type>
</error>

I have tried escaping the apostrope with  sean.o\'brien@abc.com - but i still get the same exception.

thankyou very much.

0
Comment
Question by:MrKevorkian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
smartapp earned 1000 total points
ID: 35164801
Hi,

As solution for the problem, you can call crmservice by replacing apostrophe bu others acceptable characters, for example :

contact.emailaddress1 = "sean.o-.-brien@abc.com";

And register a new Prestage plugins on create message on contact entity and replace -.- by the apostrophe '.

contact.emailaddress1 = contact.emailaddress1.Replace("-.-","'");

Hope this will solve your problem

Thanks
0
 
LVL 1

Assisted Solution

by:MrKevorkian
MrKevorkian earned 0 total points
ID: 35166042
hi,

thanks for your suggestion.  I have just figured out the problem!

basically just sending apostrophes through the webservice is actually fine.
but what i was doing in my code, before creating a contact - i was running a fetchxml query, to check that the contact email did not already exist.  And the apostrophe in the email was breaking the fetch x ml - so what i did was encode it

sean.o&apos;brien@abc.com
and this still retrieved sean.o'brien  at the crm end!

so it was the fetch query that was the problem.




0
 
LVL 1

Author Comment

by:MrKevorkian
ID: 35166057
.
0
 
LVL 1

Author Closing Comment

by:MrKevorkian
ID: 35196659
it was a really good suggestion, that got me thinking, which led to me solving my problem.

thanks
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question