You need to sign in to do that
Don't have an account?
MikeCloud
Trigger coverage problem - Create new Project record when Opp Custom field picklist value = Yes
Trigger: When a custom field picklist value in Opp = Yes, I want to create a new Project, make new Project name the same as the Opp name:
trigger CreateM1Project on Opportunity (after insert) {
List<Milestone1_Project__c> NewProjects = new List<Milestone1_Project__c>();
for (Opportunity opp: trigger.new) {
if (opp.Start_Project_Site_Id_Stage__c == 'Yes') {
Milestone1_Project__c freshProject = new Milestone1_Project__c();
freshProject.Name = opp.Name;
}
}
insert NewProjects;
}
so you want to write a test class for this one?
Try below code for Test Class :
Changed stage name which needs to be 'Closed Won' (set as field depencency), test failed am I missing something in the orignal code?
I have no code coverage, test failed
what is the error message you are getting while running the test ??
I figured it out, I had anothe trigger running that needed to be edited, thanks for your reply.