Someone previously set up an APEX trigger for my org and the custom object is not working when triggered because the trigger is inactive. It looks like people have had issues previously with the ability to activate a trigger. I'm not sure if I should start over and have this inactive trigger in production or try to fix the current trigger. Screenshots below. Trigger nameTrigger Trigger here:
trigger createOnboardingOnOpportunityWon on Opportunity (after update) {
List <Onboarding__c> OnboardingToInsert = new List <Onboarding__c> ();
// or whatever your custom object name put instead of Sponsorship__c
for (Opportunity o : Trigger.new) {
// here is where you check if opportunity that is being inserted
//meets the criteria
if (o.StageName == 'Closed Won'){
Onboarding__c b = new Onboarding__c (); //instantiate the object to put values for future record
// now map opportunity fields to new vehicle object that is being created with this opportunity
b.Name = o.Name; // and so on so forth untill you map all the fields.
b.Account__c = o.AccountId;
//Monthly_Transactions__c
//Current_Software_Platform__c
//Operating_States__c
//Underwriters__c
//Number_of_employees__c
//Pains__c
//LeadSource
//**Next Step = "Send intro email"
//once done, you need to add this new object to the list that would be later inserted.
//don't worry about the details for now
onboardingToInsert.add(b);
}//end if
}//end for o
//once loop is done, you need to insert new records in SF
// dml operations might cause an error, so you need to catch it with try/catch block.
try {
insert OnboardingToInsert;
} catch (system.Dmlexception e) {
system.debug (e);
}