jeudi 19 février 2015

How can I see the fields available for retrieval via get_item()?



I'm using Javascript CSOM to try and integrate a Discussion list into a site I'm working on. However, I can't figure out what Discussion item fields are available for me to access via get_item(). I tried digging through the returned SPListItemCollection manually but it's so incredibly convoluted that diving into it only lead to recursion madness.


Here's the code I'm using to access the list of Discussion topics:



var commCtx = new SP.ClientContext('/sites/developer_mm');
var communityList = commCtx.get_web().get_lists().getByTitle("Discussion");

camlQuery = new SP.CamlQuery.createAllFoldersQuery();

communityItemsCollection = communityList.getItems(camlQuery);

commCtx.load(communityItemsCollection);
commCtx.executeQueryAsync(onGetCommunityPostsSucceeded, onGetDiscussionPostsFailed);


Through trial and error I've discovered that Title, Body, and Author are valid fields, but I still need to retrieve A) the date a discussion was posted, and B) something that will help me link back to that discussion. Is there somewhere I can look to see what fields are attached to a Discussion when I create it via Site Contents?








0 commentaires:

Enregistrer un commentaire