Hello friends, In this post, I am going to show you how you can inactive salesforce apex trigger using workbench. You can use this method to make inactive trigger of any salesforce org. Most of the developers don't know to inactive trigger of salesforce production org because edit button not present in salesforce production orgs, So by using this method you can easily achieve this task. So let's get started.
Make trigger inactive in salesforce production org.
1. Created a .xml (Package.xml) file with following code.
a) To retrieve all apex triggers from salesforce org.
<?xml version="1.0" encoding="UTF-8"?>b) To retrieve specific trigger from salesforce org.
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ApexTrigger</name>
</types>
<version>50.0</version>
</Package>
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>TriggerName</members>
<name>ApexTrigger</name>
</types>
<version>50.0</version>
</Package>
2. Visit the Workbench site and login with salesforce org credentials and Navigate to Migration | Retrieve and select the package.xml file that you created in step 1. Click on Next button.
3. Click on Retrieve button.
4. After success of retrieve action, click on Download ZIP file link. A zip file will downloaded.
5. Extract the downloaded file, you will see a triggers folder and a package.xml file. Open trigger folder and edit the triggername.trigger-meta.xml file in notepad that you want to make inactive. In trigger meta xml file change status tag to Inactive and save the file.
6. Create a zip file including triggers folder and package.xml file that you extract in step 5. Make sure zip file name is package.zip.
7. Go back to Workbench site and Navigate to Migration | Deploy and select the package.zip file that you created in step 6. Checked the Rollback On Error and Single Package checkboxes and select Test Level to get code coverage of your deployed items. In my example, I am choosing NoTestRun because of developer org. Hit the Next button.
Before deploying package see the trigger status in below image.
8. Hit the Deploy button and wait for status.
After successfully deployment. Go to apex trigger and check the status. You will see it successfully inactivated by this method.
Hope you like this post, for any feedback or suggestions please feel free to comment. I would appreciate your feedback and suggestions.
Thank you.
0 Comments
Post a Comment