You need to sign in to do that
Don't have an account?
ShawnaFisher
Trigger test class
I am very new to APEX code, and I have created a trigger:
trigger AddSRSplit on Opportunity (after insert) {
Sales_Rep_Split_Revenue__c[] splitList = new Sales_Rep_Split_Revenue__c[]{};
for (Opportunity o : Trigger.new) {
splitList.add(new Sales_Rep_Split_Revenue__c
( Name = 'No Split',
opportunity__C = o.ID,
Split__c = 100,
Sales_Rep__c = o.OwnerId )); }
insert splitList; }
that i need a test case for. I have not a clue on what I need to do. Any help would be appreciated!
Since your trigger on Opportunity you will need to craete and insert Opportunity record programatically.
Plus you have to make sure you give all the required fields for your opportunity record. Now this mandatory fields could themself be some other records likwe for example it may have account look up, so u have to make sure you craete all such records in avance before u insert yourn opportunity record.
Thanks,
Salesforce Example at my blog.