Uninstalling Customer Portal in CRM 4

Jan 19, 2012 at 5:10 PM

Hi All,

We are trying to unistall the portal. Does anyone have any information on how to do this.

Jan 19, 2012 at 9:20 PM

I am assuming you are talking about the CRM 4 version of the portal, and not the CRM 2011 version.  One of the features of CRM 2011 is the new solution model, and that solution model supports uninstalling of managed solutions.  Unfortunately, for CRM 4, there is no easy way to uninstall the solution.  The approach for CRM 4 is to remove each entity one by one.  You have to remove the entities in the correct order because of the dependencies between them (for example, you have to remove web page before removing website.  You should have no problems removing them one at a time.  I would start by removing the workflows first.  When you get the custom entities all deleted, you can then deconfigure the changes to contact and campaign.  To do that, remove all references to the custom fields in the forms and views, publish your changes, then remove the custom fields.  As you can see, this is quite the process, and is the base premise of why the product team invested so heavily into a solution model for CRM 2011.

Jan 2, 2014 at 4:55 PM
I received the following error after trying to uninstall Customer Portal from CRM 2013:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: 1 is not a valid status code for state code SavedQueryState.Inactive on savedquery.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147187704</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>1 is not a valid status code for state code SavedQueryState.Inactive on savedquery.</Message>
<Timestamp>2014-01-02T16:24:48.7507766Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>
Jan 2, 2014 at 9:08 PM
@anasdib: Did you do anything to the views that were included in the customer portal solution file? I have seen some other posts on the forums related to the same error message you are having and some of them were related to deactivating some of the public views. The solution was to reactivate them before deleting. I don't have a repro for your particular error message with the customer portal solution. Can you share some details on the history of the solution in your CRM? ie: CRM online, or on-prem? When was your org created (ie: which update rollup was it created in)? Was the customer portal solution installed prior to upgrading to CRM 2013? Which version of the customer portal solution do you have installed? Did you upgrade from CRM 4 or a previous version of the customer portal? I cannot seem to reproduce the issue, so I have to have more information to see if I can isolate the problem further.
Jan 5, 2014 at 4:36 PM
Edited Jan 5, 2014 at 4:36 PM
Did you do anything to the views that were included in the customer portal solution file?
NO

CRM online, or on-prem?
CRM 2011 on-premises

When was your org created (ie: which update rollup was it created in)?
CRM 2011 organization created in 2012, updated until rollup 14. This month we upgraded the Crm 2011 to Crm 2013.

Was the customer portal solution installed prior to upgrading to CRM 2013?
customer portal solution installed in CRM 2011.

Which version of the customer portal solution do you have installed?
MicrosoftXrmCustomerPortal Version: 1.0.0015 Installed On: 27/08/2012

Did you upgrade from CRM 4 or a previous version of the customer portal?
No we didn't use CRM 4. Customer Portal installed in CRM 2011.



The reason why we want to remove CustomerPortal because after we upgraded the CRM 2011 to CRM 2013. The CRM 2013 in Production Mode has alot of errors we can't publish customizations because the customerportal doesn't working. So we need ASAP to remove CustomerPortal to continue working on the CRM 2013 without any errors. After that we will reintall the CustomerPortal later because it is very important solution to us and we need it.
Jan 5, 2014 at 4:53 PM
We received the following error from CRM 2013 after we are trying to create a new main from for Account. The problem from Customer Portal Solution:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The dependent component SavedQuery (Id=73bc2d9b-4e0e-424c-8839-ed59d6817e3a) does not exist.  Failure trying to associate it with SystemForm (Id=311a6f36-5644-4378-be67-a3d8bcbf2323) as a dependency. Missing dependency lookup type = PrimaryKeyLookup.Detail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147160010</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    <KeyValuePairOfstringanyType>
      <d2p1:key>0</d2p1:key>
      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">73bc2d9b-4e0e-424c-8839-ed59d6817e3a</d2p1:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <d2p1:key>1</d2p1:key>
      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">SavedQuery</d2p1:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <d2p1:key>2</d2p1:key>
      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">dependent</d2p1:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <d2p1:key>3</d2p1:key>
      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">SystemForm</d2p1:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <d2p1:key>4</d2p1:key>
      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">311a6f36-5644-4378-be67-a3d8bcbf2323</d2p1:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <d2p1:key>5</d2p1:key>
      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">PrimaryKeyLookup</d2p1:value>
    </KeyValuePairOfstringanyType>
  </ErrorDetails>
  <Message>The dependent component SavedQuery (Id=73bc2d9b-4e0e-424c-8839-ed59d6817e3a) does not exist.  Failure trying to associate it with SystemForm (Id=311a6f36-5644-4378-be67-a3d8bcbf2323) as a dependency. Missing dependency lookup type = PrimaryKeyLookup.</Message>
  <Timestamp>2014-01-05T16:51:33.1050759Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>
We need to remove it. How?!
Jan 6, 2014 at 5:10 PM
Everything you have described sounds good and you should not be having this problem.

I am looking at the 1.0.0015 solution file and I cannot find any reference to the Guid for the view or system form mentioned in the error you have indicated. The good news is that this is on-premise, so you can go into the SQL database and query the view and forms tables to see if you can locate the entity/form/view information to see if it is something you can isolate the problem to. You can probably also examine SQL Profile traces to locate the actual error in SQL and determine which component it is trying to query that is missing.

If that doesn't help, I would recommend that you open a ticket with support. From what I can see, everything you have done is by-the-book and is supported. You should not be getting this error unless something is corrupt in your CRM database. I have not seen this error myself before, so it must be something specific about your org. Microsoft support should be able to help isolate the issue further.
Jan 8, 2014 at 2:11 AM
Hello,

I traced the CRM database, and here is the following three queries that SQL executed before the error show.


1st Query
exec sp_executesql N'select 
"importjob0".Data as "data"
, "importjob0".CreatedBy as "createdby"
, "importjob0".ImportJobId as "importjobid"
, "importjob0".OrganizationId as "organizationid"
, "importjob0".CreatedByName as "createdbyname" 
from
 ImportJob as "importjob0" (NOLOCK)  
where
 ("importjob0".ImportJobId = @ImportJobId0 and ("importjob0".ImportJobId = @ImportJobId1 and "importjob0".CreatedBy = @CreatedBy0))',N'@ImportJobId0 uniqueidentifier,@ImportJobId1 uniqueidentifier,@CreatedBy0 uniqueidentifier',@ImportJobId0='D2D9841E-B120-7763-0667-30690A7E4EBB',@ImportJobId1='D2D9841E-B120-7763-0667-30690A7E4EBB',@CreatedBy0='69F44F5F-0782-E011-9CD2-0019D1DE11A1'
2nd Query
exec sp_executesql N'select 
"importjob0".ImportJobId as "importjobid"
, "importjob0".OrganizationId as "organizationid" 
from
 ImportJobBase as "importjob0" 
where
 ("importjob0".ImportJobId = @ImportJobId0)',N'@ImportJobId0 uniqueidentifier',@ImportJobId0='D2D9841E-B120-7763-0667-30690A7E4EBB'
3rd Query
exec sp_executesql N'update [ImportJobBase] set [Data]=@Data0, [CreatedBy]=@CreatedBy0 where ([ImportJobId] = @ImportJobId0)',N'@Data0 ntext,@CreatedBy0 uniqueidentifier,@ImportJobId0 uniqueidentifier',@Data0=N'<importexportxml succeeded="false" errorcode="0x80048408" errormessage="&lt;error xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;&lt;code&gt;0x80048408&lt;/code&gt;&lt;exception&gt;Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: 1 is not a valid status code for state code SavedQueryState.Inactive on savedquery.Detail: &#xA;&amp;lt;OrganizationServiceFault xmlns:i=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://schemas.microsoft.com/xrm/2011/Contracts&quot;&amp;gt;&#xA;  &amp;lt;ErrorCode&amp;gt;-2147187704&amp;lt;/ErrorCode&amp;gt;&#xA;  &amp;lt;ErrorDetails xmlns:d2p1=&quot;http://schemas.datacontract.org/2004/07/System.Collections.Generic&quot; /&amp;gt;&#xA;  &amp;lt;Message&amp;gt;1 is not a valid status code for state code SavedQueryState.Inactive on savedquery.&amp;lt;/Message&amp;gt;&#xA;  &amp;lt;Timestamp&amp;gt;2014-01-08T00:55:11.0539402Z&amp;lt;/Timestamp&amp;gt;&#xA;  &amp;lt;InnerFault i:nil=&quot;true&quot; /&amp;gt;&#xA;  &amp;lt;TraceText i:nil=&quot;true&quot; /&amp;gt;&#xA;&amp;lt;/OrganizationServiceFault&amp;gt;&#xA;&#xA;&lt;/exception&gt;&lt;parameters /&gt;&lt;displaytitle&gt;State code or status code is invalid.&lt;/displaytitle&gt;&lt;displaytextencoded&gt;State code is invalid or state code is valid but status code is invalid for a specified state code.&lt;/displaytextencoded&gt;&lt;displaytext&gt;State code is invalid or state code is valid but status code is invalid for a specified state code.&lt;/displaytext&gt;&lt;description&gt;1 is not a valid status code for state code SavedQueryState.Inactive on savedquery.&lt;/description&gt;&lt;file&gt;Not available&lt;/file&gt;&lt;line&gt;Not available&lt;/line&gt;&lt;details&gt;1 is not a valid status code for state code SavedQueryState.Inactive on savedquery.&lt;/details&gt;&lt;traceInfo /&gt;&lt;requesturl&gt;https://internalcrm.crmsvr.com/HorizonsforWebDesignCompanyLtd/AppWebServices/Solution.asmx&lt;/requesturl&gt;&lt;pathAndQuery&gt;/HorizonsforWebDesignCompanyLtd/AppWebServices/Solution.asmx&lt;/pathAndQuery&gt;&lt;source&gt;SOAP&lt;/source&gt;&lt;stacktrace&gt;[CrmException: 1 is not a valid status code for state code SavedQueryState.Inactive on savedquery.]&#xA;   at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()&#xA;   at Microsoft.Crm.Application.WebServices.SolutionWebService.DeleteSolution(Guid importJobId, Guid id)&#xA;&#xA;&lt;/stacktrace&gt;&lt;/error&gt;"></importexportxml>',@CreatedBy0='69F44F5F-0782-E011-9CD2-0019D1DE11A1',@ImportJobId0='D2D9841E-B120-7763-0667-30690A7E4EBB'
If the information isn't enough to solve the problem, i can send you the trace file to your email.
Jan 8, 2014 at 2:22 AM
I think the CRM trace file would be useful to examine as well. Please send them along. My direct email is first name dot last name at Adxstudio.com.

Thanks,
Shan McArthur
Jan 11, 2014 at 9:30 PM
Did you receive my email?