Wednesday 24 September 2014

The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested

I was trying to read a list column data. I have added that  column name in the caml query as ViewFields

<ViewFields><FieldRef Name='Column1' /><FieldRef Name='Column2' /></ViewFields>

I was expecting my column will come...
But i got this error..

The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested

Solution:

I have added my columns in the below way..

 objctx.load(objListData, 'Include(Column1, Column2)');

I was trying like this...
  objctx.load(objListData);