This project has moved and is read-only. For the latest updates, please go here.

CAMLViewName not working?

Sep 3, 2014 at 10:06 AM
I am sucesssfully using the SPGetListItemsJson function, but it seems to ignore the CAMLViewName parameter. I'm taking that this parameter should limit the columns and the sorting to whatever is specified in the specified SharePoint list view.

For instance, I've created a list view named "Recent", where only the columns "Title" and "Created" are selected, and set the default sorting to "Created" in reverse order, but when setting the CAMLViewName parameter to either "Recent" or its GUID "{C1A43BDF-4F07-42ED-A101-CC28AECF65D0}", but the output does not change, it displays the items in the default order and with all the regular columns.
Sep 6, 2014 at 7:11 PM

I'll check on this, as it ought to work.

However, as a general practice I discourage using views to determine what's brought back from a call. This is simply because it's too easy for someone to change the view settings and have the call start to fail. I think it's better to use the settings available with GetListItems to determine what's returned.

Sep 6, 2014 at 7:12 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.