Tag Info

Hot answers tagged

3

The following example demonstrates how to return web sites sorted by last modified date: function getWebs(success,error) { var ctx = SP.ClientContext.get_current(); var web = ctx.get_web(); var webs = web.getSubwebsForCurrentUser(null); ctx.load(webs); ctx.executeQueryAsync( function(){ var result = []; ...


2

Based on your question, i understand that you want to get ID of Department item which is referenced in Article list. Correct me if i am wrong. To get ID of lookup list item, include following in you code(Assuming field name of lookup field from Department is "Department" in article list : var childIdField = listItem["Department"] as FieldLookupValue; if ...


2

One thing you can do is use SP.List.getItems(query) to query the 'Department' list for the item with the Title value you want. Once you get the list item, you can get its ID. (Keep in mind that the getItems(query) method will return a list item collection, even though that collection may only contain one item.) Your CAML query would look something like ...


1

The following example demonstrates how to update enterprise wiki page content: function updateWikiPage(pageUrl,pageContent,success,error) { getFileWithProperties(pageUrl, function(file){ var listItem = file.get_listItemAllFields(); var itemProperties = {'PublishingPageContent': pageContent}; ...


1

Ok, thanks for all the help everyone. It was a good insight into how to go about doing what I wanted. The closest way I could get to 'almost' work was Francoise Becker's idea using SPServices jQuery library, however I think ive discovered that in the DISPFORM.aspx, the code behind is different to other pages as I couldnt get the code to run when the ...


1

You can do it in Singleline of code var siteCollectionURL = _spPageContextInfo.siteAbsoluteUrl;



Only top voted, non community-wiki answers of a minimum length are eligible