+ Start a Discussion
SabrentSabrent 

Random Trigger Question

is there a possibility to write a test class for this  -

 

trigger  duplicatecandidate on Candidate__c (after insert) {


}

 

why i ask? 

 

I have a triiger in Production (long story how it got there),

 

when i am trying to deploy some components, deployment fails giving me an erro that duplicatcandidate trigger needs atleast 1% coverage.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
giorgio70giorgio70

I would de-activate the trigger in PRD. With that, you should be able to delete it (as you deploy all the triggers with the Force IDE, the name of this one should be listed in RED and flagged as DELETE (granted you deleted that trigger in your Sandbox)

Once you deploy it will be deleted

Cheers

Giorgio

All Answers

~Onkar~Onkar

Hi Rov

 

Did you written testClass for this trigger. If not write a testClass fot this trigger as insert dummy data.

 

Seems that you don’t need this trigger any more, If so delete trigger and deploy back into production you can delete trigger by using ANT or Eclipse deployment as change in XML file IsDeleted = true.

 

 

Please let me know if this work for you.

~Thanks

Onkar Kumar

 

 

 

 

giorgio70giorgio70

I would de-activate the trigger in PRD. With that, you should be able to delete it (as you deploy all the triggers with the Force IDE, the name of this one should be listed in RED and flagged as DELETE (granted you deleted that trigger in your Sandbox)

Once you deploy it will be deleted

Cheers

Giorgio

This was selected as the best answer
SFDC-SDSFDC-SD

I faced this situation, code coverage will be always 0% since there is no code in the trigger.

 

I suggest you contact your admin and request him to delete the Obsolete trigger using IDE. 

 

SabrentSabrent

Thanks to everyone. All responses were relevant.