You need to sign in to do that
Don't have an account?
NaiveUser
Apex test class for OpportunityPartner object
Hi,
I am trying to write a test class around OpportunityPartner object. This object being a read-only one, it does not allow me to insert/update test records in test class. Any Help!!!
You cannot able to insert/update data in a non-updatable object. Instead if your org contains data in that object, then you can fetch data from that object in the test method like the following.
@isTest(SeeAllData=True)
public class MytestClass{
public testmethod void myTestMethod(){
List<OpportunityPartner> oppPartnerList = new List<OpportunityPartner>();
oppPartnerList = [SELECT Id FROM OpportunityPartner];
//then USE "oppPartnerList" for your operation.
}
}
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks