Tag Info

New answers tagged

1

Option 1 Use Web.Webs property to get a web sites immediately beneath the Web site: using (var ctx = new ClientContext(webUri)) { var subWebs = ctx.Web.Webs; ctx.Load(subWebs); ctx.ExecuteQuery(); } Option 2 The following example demonstrates how to retrieve all web sites: public static void LoadAllWebs(Web web,List<Web> allWebs) { ...


2

function RetriveSites() { currentcontext = new SP.ClientContext(‘/collaboration/KeyWordsDemo’); /* to get the current context use this instead -à.get_current();*/ /*more info http://msdn.microsoft.com/en-us/library/ee658863.aspx*/ currentweb = currentcontext.get_web(); ...


1

Follow these links having good examples: http://khakicampbelldeveloper.wordpress.com/2012/06/28/sharepoint-2010-client-object-model-populate-drop-down-lists-and-save-list-items/ https://social.msdn.microsoft.com/Forums/sharepoint/en-US/5e96d47f-e3b9-4502-bb66-6feb728bcabf/populate-list-fields-in-dropdown?forum=sharepointdevelopmentprevious small example ...


1

I'm not sure what you mean with freeze, but I can't see where you call or close the "working on it". I made simple example with dummy code, maybe it will help you. Because I have never seen that async calls have locked the UI etc, so you could try this approach: SP.UI.ModalDialog.showWaitScreenWithNoClose("title", "message", 400, 400); var ...


0

Since you error message says Remote server. I am assuming this is SharePoint online. If that is the case then you need to pass the Credentials to the clientcontext as below using (ClientContext clientContext = new ClientContext(url)) { SecureString passWord = new SecureString(); foreach (char c in "yourpassword".ToCharArray()) ...


0

This article explains every scenario for the datetime picker control. I've used it without issue. http://theway4ward.wordpress.com/2013/07/30/211/


1

We have used Spin.js in several such scenarios. Usage Define a <div> in the HTML markup <div id="userTableSpinner"></div> Then in Javascript code find the div and start spinner and finally stop it once all processing is done: var userTableSpinner; function someProcessStartsHere() { if (userTableSpinner == null) { userTableSpinner ...


0

I think this should work RegisterModuleInit('/<yourSiteName>/SiteAssets/<yourJSfilename>.js', updateTitle); updateTitle(); function updateTitle() { var priorityFiledContext = {}; priorityFiledContext.Templates = {}; priorityFiledContext.Templates.Fields = { "Title": { "View": priorityFiledTemplate } ...


0

This happens only when you refresh the opened page more than once. Try opening the record again newly and you will not see this issue.


0

Personnaly, the method with the SP.ClientContext didn't worked. So I used an asynchronous request to the Web API of SP like this : $.getScript("/_layouts/15/SP.UserProfiles.js"); SP.SOD.executeOrDelayUntilScriptLoaded(checkAdminRights, "SP.UserProfiles.js"); function checkAdminRights() { var userId = _spPageContextInfo.userId; var groupId = 7; ...


1

clientContext.Load(listItems, "Include(EffectiveBasePermissions, HasUniqueRoleAssignments)"); // Follow the statement above with this if you need special "fields" like // HasUniqueRoleAssignments, EffectiveBasePermissions as well as the normal fields clientContext.Load(listItems);


-1

The property is exposed in the V16 Client DLLS for SharePoint online


0

dont use new keyword for the instation of sharepoint javascript object. the below declaration is the correct SP.ClientContext.get_current();


0

You need to use ExecuteOrDelayUntilScriptLoaded function : ExecuteOrDelayUntilScriptLoaded(internalOpenDialog, "SP.JS"); function internalOpenDialog(){ ...... //code .... }


1

termValue = string.Format("{0}|{1}", term.Name, term.Id) if there is more values, they should be separated with ";"


0

I found the solution. Someone changed a column of my content type in required and when you savebinary the document, it doesn't have the required value so it's in check out


1

Thanks to Oleg's post: http://www.thedotnotcorner.com/2012/12/12/add-a-query-string-parameter-to-spnavigationnode/ It seems that in a site with the Publishing feature enabled, the query string is stored in a separate property: UrlQueryString. So to access the full Url+QueryString you would need: bar[0].Url+bar[0].Properties["UrlQueryString"]


0

Microsoft.SharePoint.Client.FieldUserValue.LookupValue should give the username. Have a look at FieldUserValue members You can also query the user from User Information List to get full details of the user, as shown below: var spUser = user as FieldUserValue; var userInfoList = context.Web.SiteUserInfoList; context.Load(userInfoList); var query = new ...


0

I normally use this function below. You can modify it depending on how you want to use it. function getUserInformation(){ var context = new SP.ClientContext.get_current(); var web = context.get_web(); var currentUser = web.get_currentUser(); currentUser.retrieve(); context.load(web); context.executeQueryAsync( function(){ //On ...


0

You need to enclose the query with <View> tag camlQuery.set_viewXml('<View><Query><Where><And><Geq><FieldRef Name=\'Created1\' /><Value IncludeTimeValue=\'TRUE\' Type=\'DateTime\'>2014-10-29T10:07:07Z</Value></Geq><Leq><FieldRef Name=\'Created1\' /><Value IncludeTimeValue=\'TRUE\' ...


0

As far as I remember to my experiences with W8 vs. SP 2013 / O365, Managed Client Object Model assemblies (like Microsoft.SharePoint.Client.dll) cannot be directly referenced from a Windows Store App. Include your code into a wrapper class implemented as Class Library (Windows Store Apps), and reference this one from your Windows Store App.


0

Alright, here's what I ended up doing. Since I couldn't actually move the file without the references also being redirected, I had to first make sure that the original master page content was saved. I simply made a copy of the original file under a different name. Now, I still had the problem of updating my master page throughout my site collection (since ...


1

I recently did something similar. I had to add references to the following:- Microsoft.SharePoint Microsoft.SharePoint.Client Microsoft.SharePoint.Client.Runtime Once had added all three of these it seemed to work fine Hope this helps!


0

Using CSOM you can change the master page before moving as below using (var ctx = new ClientContext(siteURL)) { var web = ctx.Web; var masterPageUrl = String.Format( "{0}/_catalogs/masterpage/custom.master", ctx.Web.ServerRelativeUrl ); web.MasterUrl = masterPageUrl; web.CustomMasterUrl = masterPageUrl; web.Update(); ctx.Load( web ); ...


0

Check this MSDN page: How to: Complete basic operations using JavaScript library code in SharePoint 2013 and look at the paragraph Update a list item Example for update title from MSDN: oListItem.set_item('Title', 'My Updated Title'); Change content type for current item (simply): oListItem.set_item('ContentTypeId', 'your_CTID'); // example ...


0

This query will give you Author column (user) with email from a list 'Test': /_api/Web/Lists/GetByTitle('Test')/Items?$select=Author/EMail&$expand=Author/EMail You can replace 'Author' with any other Person/Group column.



Top 50 recent answers are included