You need to sign in to do that
Don't have an account?
Apex Trigger Test
I built this trigger and it works fine in the sandbox before I can move it to production it has to meet 75% or better. Can anyone help me write a test class for this trigger so that I can get it moved to production? Here is the trigger.
1 2 | trigger OpportunitySubmitForApproval on Opportunity (after insert) { |
Hi,
Here you have Hardcoded with Id which is not suggestible and will not work properly with different environments.
So first please make sure get Record type id dynamically which is best practice.
And Below links will be helpful to understand about test Coverage
http://teachmesalesforce.wordpress.com/2011/05/07/how-to-write-a-trigger-test/
http://wiki.developerforce.com/page/An_Introduction_to_Apex_Code_Test_Methods