You need to sign in to do that
Don't have an account?
fredka
Selecting a List value in Test
I am trying to write test code for a page/class that is used to select a value. A user launches the page from the opportunity object. This page opens and displays a listing of products (custom object) when the user selects a product from the list, fields from the record are passed to another custom object.
My issue is trying to select something from that list in my test. I first thought I would assign the the ID so I used "controller.products[0].p.id = WellnessHP.id;" however, I recieved an error that the list was null... I did create a record for the same object in my test class which is named "WellnessHP"
Here is the code.. how can I "select" my test record? THanks!!!! Fred
My issue is trying to select something from that list in my test. I first thought I would assign the the ID so I used "controller.products[0].p.id = WellnessHP.id;" however, I recieved an error that the list was null... I did create a record for the same object in my test class which is named "WellnessHP"
Here is the code.. how can I "select" my test record? THanks!!!! Fred
All Answers
If your code touches Price Books, you may want to try adding annotating your test method with @isTest(SeeAllData = true) just in case that's a culprit behind the problem as well.