You need to sign in to do that
Don't have an account?

Need test class for this one
trigger trgopp2 on Opportunity (before insert,before update) {
for(Opportunity opp:trigger.new){ if(opp.Name != null){ user usr=[select id,name from user where id =: opp.ownerid]; opp.Owner_field__c=usr.name; } } }
@isTest
public class trgopp2Test {
static testMethod void trgopp2 () {
Opportunity opp1 = new Opportunity();
opp1.name = 'Test 1';
opp1.Type = 'New Customer';
opp1.CloseDate = system.today();
opp1.StageName = 'New Opportunity';
insert opp1;
}
}
Check the debug log is it its throwing any error , because its giving 100% code coverage for me