function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rajat Maheshwari 6rajat Maheshwari 6 

Managed Package - Unable to undelete the trigger

Hi there,

Hope you are doing great !!!

Could you please help me to resolve this issue  - 

ApexTrigger get delete from "RealDesk"Managed Released Package before 7 days, that need to be undelete but when we click on undelete it giving option "The record you attempted to access has been deleted. The user who deleted this record may be able to recover it from the Recycle Bin. Deleted data is stored in the Recycle Bin for 15 days. " but those trigger Not available in Recycle Bin to recover and those are still accessible with query
"select ID,Name from ApexTrigger where Status='deleted'" 
Id Name
1 01qi0000000jWjIAAU AccountTrigger
2 01qi0000000jWjKAAU TaskTrigger
3 01qi0000000jWjOAAU ContactTrigger

we want those 3 trigger to be undelete.

Thanks
Rajat Maheshwari

 
Alain CabonAlain Cabon
Hi,

You are using a managed package?

The field Body contains the complete source code (perhaps, if not hidden) if the undelete is impossible.

select ID,Name,Body from ApexTrigger where Status='deleted'

Deleted - The trigger is marked for deletion. This is useful for managed packages, because it allows a trigger to be deleted when a managed package is updated.
rajat Maheshwari 6rajat Maheshwari 6
Hi Alian,

Thanks for your prompt response !!!

Actually Body specifies trigger body...It seems good...but my concern is , When I paste the deleted trigger id, It alraedy showing me the trigger but with status = Deleted. 

I want to recover status from deleted to undelete. Actually as a workaround I copy the whole code and try to create in managed package..It says that

 "Trigger is already with same name exist. You are not allowing to create trigger with same name."

In short, I am not able to create new trigger with same name.

Thanks

 
Alain CabonAlain Cabon
Delete Components in Managed Packages

After you've uploaded a  Managed - Released package, you may find that a component needs to be deleted from your org. One of the following situations may occur:
  • The component, once added to a package, can't be deleted (... totally?).
  • The component can be deleted, but can be undeleted from either the Deleted Package Components page or through the Recycle Bin
https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/packaging_managed_component_deletion.htm

Although a component is deleted, its Name remains within Salesforce. You can never create another component with the same name. The Deleted Package Components page lists which names can no longer be used.

To access the Deleted Package Components page, from Setup, enter Packages in the Quick Find box, then select Packages. Select the package that the component was uploaded to, and then click View Deleted Components. If a component can be retrieved through the Recycle Bin, it can also be retrieved through this page.  You can retrieve the following types of components from here.
  • Apex classes and triggers that don't have global access.
http://​https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/isv_viewing_deleted_components.htm

If you have written triggers with global access, you are perhaps in a damned situation. You can never create another component with the same name anymore and you cannot undelete the trigger. So these deleted triggers are totally lost even if you can see them again with SOQL and they  prevent new creations with the same names.

Cheers
Alain