<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: CRM 4.0 Create customeraddress 0&#215;80040216 An unexpected error occurred</title>
	<atom:link href="http://www.ferolen.com/blog/crm-4-0-create-customeraddress-0x80040216-an-unexpected-error-occurred/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ferolen.com/blog/crm-4-0-create-customeraddress-0x80040216-an-unexpected-error-occurred/</link>
	<description>Resources, FAQ, Help, Tutorial for your IT problem from day to day computer to web development problem.</description>
	<lastBuildDate>Sun, 01 Jan 2012 17:19:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Mark</title>
		<link>http://www.ferolen.com/blog/crm-4-0-create-customeraddress-0x80040216-an-unexpected-error-occurred/comment-page-1/#comment-12030</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 02 Nov 2011 20:57:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.ferolen.com/blog/?p=82#comment-12030</guid>
		<description>Add an Addresses record to the entity and save. This should resolve it.</description>
		<content:encoded><![CDATA[<p>Add an Addresses record to the entity and save. This should resolve it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sushma</title>
		<link>http://www.ferolen.com/blog/crm-4-0-create-customeraddress-0x80040216-an-unexpected-error-occurred/comment-page-1/#comment-11908</link>
		<dc:creator>sushma</dc:creator>
		<pubDate>Thu, 09 Dec 2010 09:44:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.ferolen.com/blog/?p=82#comment-11908</guid>
		<description>Public Function Test() As String
        Try

       
            &#039; Set up the CRM Service.
            Dim token As CrmAuthenticationToken = New CrmAuthenticationToken()
            token.AuthenticationType = 0
            token.OrganizationName = &quot;E4685-Dev&quot;

            Dim service As CrmService = New CrmService()
            service.Url = &quot;http://172.20.23.36:5555/mscrmservices/2007/crmservice.asmx&quot;
            service.CrmAuthenticationTokenValue = token
            service.Credentials = New NetworkCredential(&quot;Administrator&quot;, &quot;CrmAdmin123&quot;, &quot;MSCRMPUNE&quot;)

            Dim objDynamicEntity As DynamicEntity = New DynamicEntity()
            objDynamicEntity.Name = &quot;customeraddress&quot;

            Dim arrlProp As ArrayList = New ArrayList()
            Dim addressName As String = &quot;Street 1&quot; + &quot; &quot; + &quot;Street 2&quot; + &quot; &quot; + &quot;SAngola&quot;

            Dim Nameprop As StringProperty = New StringProperty()
            Nameprop.Name = &quot;name&quot;
            Nameprop.Value = addressName
            arrlProp.Add(Nameprop)

            Dim line1prop As StringProperty = New StringProperty()
            Nameprop.Name = &quot;line1&quot;
            Nameprop.Value = &quot;street1&quot;
            arrlProp.Add(line1prop)


            Dim line2prop As StringProperty = New StringProperty()
            Nameprop.Name = &quot;line2&quot;
            Nameprop.Value = &quot;street2&quot;
            arrlProp.Add(line2prop)


            Dim cityProp As StringProperty = New StringProperty()
            Nameprop.Name = &quot;city&quot;
            Nameprop.Value = &quot;city&quot;
            arrlProp.Add(cityProp)

            &#039;.... add other details as necessary ....
            Dim FaxProp As StringProperty = New StringProperty()
            Nameprop.Name = &quot;fax&quot;
            Nameprop.Value = &quot;020-12345&quot;
            arrlProp.Add(FaxProp)


            Dim ContactProp As StringProperty = New StringProperty()
            Nameprop.Name = &quot;primarycontactname&quot;
            Nameprop.Value = &quot;contactName&quot;
            arrlProp.Add(ContactProp)



            &#039; .... this is the important property that you should add ...                       
            Dim objEntityNameReference As EntityNameReference = New EntityNameReference()
            objEntityNameReference.Value = &quot;account&quot;

            Dim objEntityNameReferenceProperty As EntityNameReferenceProperty = New EntityNameReferenceProperty()
            objEntityNameReferenceProperty.Name = &quot;ObjectTypeCodeId&quot;
            objEntityNameReferenceProperty.Value = objEntityNameReference
            arrlProp.Add(objEntityNameReferenceProperty)

            Dim accountLookup As Lookup = New Lookup
            Dim accountlookupprop As LookupProperty = New LookupProperty
            accountLookup.name = &quot;accountid&quot;
            accountLookup.Value = New Guid(&quot;1045C1DE-4E9E-DF11-987A-001AA0C32354&quot;)
            accountLookup.type = &quot;account&quot;
            accountlookupprop.Name = &quot;ParentId&quot;
            accountlookupprop.Value = accountLookup

            arrlProp.Add(accountlookupprop)
            objDynamicEntity.Properties = CType(arrlProp.ToArray(GetType([Property])), [Property]())

            Dim objtargetCreate As TargetCreateDynamic = New TargetCreateDynamic()
            objtargetCreate.Entity = objDynamicEntity
            Dim objrequest As CreateRequest = New CreateRequest()
            Dim objresponse As CreateResponse = New CreateResponse()

            objrequest.Target = objtargetCreate
            objresponse = CType(service.Execute(objrequest), CreateResponse)
            Return objresponse.id.ToString()

        Catch ex As SoapException

        Catch ex As Exception

        End Try
    End Function

Still i m getting error.
Please upload the whole code.</description>
		<content:encoded><![CDATA[<p>Public Function Test() As String<br />
        Try</p>
<p>            &#8216; Set up the CRM Service.<br />
            Dim token As CrmAuthenticationToken = New CrmAuthenticationToken()<br />
            token.AuthenticationType = 0<br />
            token.OrganizationName = &#8220;E4685-Dev&#8221;</p>
<p>            Dim service As CrmService = New CrmService()<br />
            service.Url = &#8220;http://172.20.23.36:5555/mscrmservices/2007/crmservice.asmx&#8221;<br />
            service.CrmAuthenticationTokenValue = token<br />
            service.Credentials = New NetworkCredential(&#8220;Administrator&#8221;, &#8220;CrmAdmin123&#8243;, &#8220;MSCRMPUNE&#8221;)</p>
<p>            Dim objDynamicEntity As DynamicEntity = New DynamicEntity()<br />
            objDynamicEntity.Name = &#8220;customeraddress&#8221;</p>
<p>            Dim arrlProp As ArrayList = New ArrayList()<br />
            Dim addressName As String = &#8220;Street 1&#8243; + &#8221; &#8221; + &#8220;Street 2&#8243; + &#8221; &#8221; + &#8220;SAngola&#8221;</p>
<p>            Dim Nameprop As StringProperty = New StringProperty()<br />
            Nameprop.Name = &#8220;name&#8221;<br />
            Nameprop.Value = addressName<br />
            arrlProp.Add(Nameprop)</p>
<p>            Dim line1prop As StringProperty = New StringProperty()<br />
            Nameprop.Name = &#8220;line1&#8243;<br />
            Nameprop.Value = &#8220;street1&#8243;<br />
            arrlProp.Add(line1prop)</p>
<p>            Dim line2prop As StringProperty = New StringProperty()<br />
            Nameprop.Name = &#8220;line2&#8243;<br />
            Nameprop.Value = &#8220;street2&#8243;<br />
            arrlProp.Add(line2prop)</p>
<p>            Dim cityProp As StringProperty = New StringProperty()<br />
            Nameprop.Name = &#8220;city&#8221;<br />
            Nameprop.Value = &#8220;city&#8221;<br />
            arrlProp.Add(cityProp)</p>
<p>            &#8216;&#8230;. add other details as necessary &#8230;.<br />
            Dim FaxProp As StringProperty = New StringProperty()<br />
            Nameprop.Name = &#8220;fax&#8221;<br />
            Nameprop.Value = &#8220;020-12345&#8243;<br />
            arrlProp.Add(FaxProp)</p>
<p>            Dim ContactProp As StringProperty = New StringProperty()<br />
            Nameprop.Name = &#8220;primarycontactname&#8221;<br />
            Nameprop.Value = &#8220;contactName&#8221;<br />
            arrlProp.Add(ContactProp)</p>
<p>            &#8216; &#8230;. this is the important property that you should add &#8230;<br />
            Dim objEntityNameReference As EntityNameReference = New EntityNameReference()<br />
            objEntityNameReference.Value = &#8220;account&#8221;</p>
<p>            Dim objEntityNameReferenceProperty As EntityNameReferenceProperty = New EntityNameReferenceProperty()<br />
            objEntityNameReferenceProperty.Name = &#8220;ObjectTypeCodeId&#8221;<br />
            objEntityNameReferenceProperty.Value = objEntityNameReference<br />
            arrlProp.Add(objEntityNameReferenceProperty)</p>
<p>            Dim accountLookup As Lookup = New Lookup<br />
            Dim accountlookupprop As LookupProperty = New LookupProperty<br />
            accountLookup.name = &#8220;accountid&#8221;<br />
            accountLookup.Value = New Guid(&#8220;1045C1DE-4E9E-DF11-987A-001AA0C32354&#8243;)<br />
            accountLookup.type = &#8220;account&#8221;<br />
            accountlookupprop.Name = &#8220;ParentId&#8221;<br />
            accountlookupprop.Value = accountLookup</p>
<p>            arrlProp.Add(accountlookupprop)<br />
            objDynamicEntity.Properties = CType(arrlProp.ToArray(GetType([Property])), [Property]())</p>
<p>            Dim objtargetCreate As TargetCreateDynamic = New TargetCreateDynamic()<br />
            objtargetCreate.Entity = objDynamicEntity<br />
            Dim objrequest As CreateRequest = New CreateRequest()<br />
            Dim objresponse As CreateResponse = New CreateResponse()</p>
<p>            objrequest.Target = objtargetCreate<br />
            objresponse = CType(service.Execute(objrequest), CreateResponse)<br />
            Return objresponse.id.ToString()</p>
<p>        Catch ex As SoapException</p>
<p>        Catch ex As Exception</p>
<p>        End Try<br />
    End Function</p>
<p>Still i m getting error.<br />
Please upload the whole code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

