4

I used grid view to display SharePoint 2010 list data. To have data filtered (used Sp-query for that), I used 'Author' field in C# which is similar to 'Created By' in SharePoint list. It's working fine in the local development. But when deploy the code in test environment, it was throwing error:

Field not found: Author

Sp Query is queryRR.Query = "<Where><And><Eq><FieldRef Name='Author' /><Value Type='User'>" + userName + "</Value></Eq><Eq><FieldRef Name='Publish' /><Value Type='Boolean'>0</Value></Eq></And></Where>"

Then I changed the code and put all the list data in grid (without any condition). Again deployed the code in test and checked it, I found both columns were missing - Author (Created By) and Editor (Modified By). It was strange. I checked many blogs but no use.

Is there any configuration problem on the test server or something missing in the code?

  • It is resoled. The problem was different. I used View, Add & Edit permission on the list for the end user. Note here I did not use view application pages permission level, it means user is able to add/edit item (by custom application) in the list but cannot see (access denied) the list. To test the root cause, I give Full permission to one of the user and checked the list. List was giving error - 'This view cannot be displayed because the number of lookup and workflow status columns it contains exceeds the threshold (8) enforced by the administrator.’ – Harish H Jul 16 '14 at 11:38
  • This was the cause as I used 7-8 workflows and some views in the list. I changed it through Central Admin -> Resource Throttling. It worked with the view, add & edit permission. – Harish H Jul 16 '14 at 11:38
  • You should add an answer – Taran Goel Sep 13 '15 at 4:56
0

perhaps you want to add viewfields

e.g. http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spquery.viewfields.aspx

for the test case causing an exception, perhaps check the internal name of the created by field and that all items contain a valid value

  • I used viewfileds also but was the same error. I resolved it. Check my comments just below the question. – Harish H Jul 16 '14 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.