You need to sign in to do that
Don't have an account?
Gorka Sanz
test production
I'm new in Salesforce.
I create a trigger in Opportunities (very easy...):
trigger ClosedOpportunityTrigger on Opportunity (after insert) {
List<task> carry=New List<task>();
for(opportunity opp:trigger.new){
task t=new task(
whatid=opp.id,
Status = 'Active',
Subject = 'Seguimiento Automatico',
ActivityDate = system.today()
);
carry.add(t);
}
insert carry;
}
I Create also a test, very easy and copies:
@isTest
private class TestAccountDeletion {
@isTest static void TestDeleteAccountWithOneOpportunity() {
Account acct = new Account(Name='Test Account');
insert acct;
test.startTest();
Opportunity opp = new Opportunity(Name=acct.Name + ' Opportunity',StageName='Prospecting',CloseDate=System.today().addMonths(1),AccountId=acct.Id);
insert opp;
test.stopTest();
}
}
Work's fine, without errors and a 100% of code validate.
I create a change set, but i cant validate in production. What is the step missing?
Thanks in advance
I create a trigger in Opportunities (very easy...):
trigger ClosedOpportunityTrigger on Opportunity (after insert) {
List<task> carry=New List<task>();
for(opportunity opp:trigger.new){
task t=new task(
whatid=opp.id,
Status = 'Active',
Subject = 'Seguimiento Automatico',
ActivityDate = system.today()
);
carry.add(t);
}
insert carry;
}
I Create also a test, very easy and copies:
@isTest
private class TestAccountDeletion {
@isTest static void TestDeleteAccountWithOneOpportunity() {
Account acct = new Account(Name='Test Account');
insert acct;
test.startTest();
Opportunity opp = new Opportunity(Name=acct.Name + ' Opportunity',StageName='Prospecting',CloseDate=System.today().addMonths(1),AccountId=acct.Id);
insert opp;
test.stopTest();
}
}
Work's fine, without errors and a 100% of code validate.
I create a change set, but i cant validate in production. What is the step missing?
Thanks in advance
What is the error you are getting?
If you getting code coverage issues because of the other codes, Run only specific test class by specifying TestAccountDeletion
All Answers
What is the error you are getting?
If you getting code coverage issues because of the other codes, Run only specific test class by specifying TestAccountDeletion
Thanks for the clue!!