+ Start a Discussion
krishnagkrishnag 

test class issue

hi,

 

I have a controller which reads the values of an object and display it in the outputpanel according to some criteria we give.

The problem here is when we write a test class i know we need to insert test data for objects we use.My object which i am using here is readonly object we cannot insert data into it manually they have siome formula fields in it.

So when i try to create a new test data for this object it throws an exception saying insertion failed since the object is readonly dont have enough permissions. So how can i write this test class.

MandyKoolMandyKool

Hi,

As you told you are displaying the data from Formula fields, you will need to first identify from which objects you are pulling the data. Then insert those objects first and then try to cover the test method..

Hope this makes sense.

Thanks,

Mandar.