Hi,
I am facing an issue with a plugin registered on pre-validate stage of delete of a solution record.
No matter what logic is written in the plugin, I always get the following error on delete of solution record.
"The requested record was not found or you do not have sufficient permissions to view it"
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: plugintype With Id = e72e444c-d784-e211-89e2-000c29ce87a4 Does Not ExistDetail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ErrorCode>-2147220969</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>plugintype With Id = e72e444c-d784-e211-89e2-000c29ce87a4 Does Not Exist</Message>
<Timestamp>2013-03-04T14:33:11.5887386Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>
However, the components are deleted successfully, but the solution record stays back and only gets removed when deleted 2nd time. Strange!
The plugin is a part of a managed solution. Plugin aims to remove objects that depend on component(s) of the managed solution. By removing dependencies in pre-validation stage will allow the system to proceed with the removal of the solution (and the included components).
Note - Everything works as desired when the delete plugin is not a part of the solution to be deleted.
Awaiting positive response on this asap.
Thanks,
Mayank