Blogger

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

    Recent items

Login

Thursday, 04 July 2013 10:54

System.ArgumentException with SPUserFields (Author, Editor, ...)

Written by
Rate this item
(0 votes)

"The ViewFields property contains a string that corresponds to the inner XML of the ViewFields element in Collaborative Application Markup Language (CAML).

The Type attribute is particularly useful for Lookup and User fields. Otherwise, without that attribute, the query may not return the expected results. In some cases, the query may fail completely."


After two days that I and my collegue This email address is being protected from spambots. You need JavaScript enabled to view it. are having an unexpected error, we found an easy solution after that we've read the previous paragraph.

We are reading our list via a WCF and all fields are displayed except the SPUserField values. We tried to put "SPSecurity.RunWithElevatedPrivileges", the impersonate but nothing else (we think plus a rights problems".

After a lot of test, we say: try to define each fields into the ViewFields property of the SPQuery object and et voilà, it works fine.

So, in the future, I think that I'll use always the ViewFields property to not spent a lot of my time to undestand why SharePoint sometimes give me unexpected problems Risatona but everytime I need to specify all Fields Arrabbiato

 

 

Read 36447 times Last modified on Wednesday, 10 July 2013 22:08

1 comment

  • Comment Link Download No Hands SEO Friday, 12 July 2013 14:56 posted by Download No Hands SEO

    We've learn quite a few just right information listed here. Undoubtedly truly worth book-marking intended for revisiting. We astonish exactly how a whole lot efforts you set to make this type of wonderful informative site.

    Report

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.