You need to sign in to do that
Don't have an account?
SirTrav
Test method for OpportunityPartner
I have a class that makes some updates based on OpportunityPartner. I am working on the test method but am not sure how to create an OpportunityPartner to use for the test. When I try to insert an OpportunityPartner it says that DML is not allowed which makes sense because OpportunityPartner is a read only object. So what I want to know is how do I run a test method when my class relies on at least 1 OpportunityPartner being created?
If i am in your place i will create all the necessary record to run the test method. Since OpportunityPartner is Read only object
i will take care while creating the records should meet the one of the specific opportunityPartner. Then i will do query in the test method and utilise it for the test method.
If this helps u make this as a solution. give KUODs
All Answers
If i am in your place i will create all the necessary record to run the test method. Since OpportunityPartner is Read only object
i will take care while creating the records should meet the one of the specific opportunityPartner. Then i will do query in the test method and utilise it for the test method.
If this helps u make this as a solution. give KUODs
I tried this and in my test method when I use list<OpportunityPartner> OP = [select id from OpportunityPartner]; it returns 0 results even though there are some in the system.