New answers tagged

0

<# .SYNOPSIS Add managed properties to the Search Service Application. .DESCRIPTION Add managed properties to the Search Service Application. .NOTES File Name: Create-ManagedProperty.ps1 Author : Bart Kuppens Version : 1.0 .PARAMETER ConfigFile Specifies the location and name of the config file which ...


1

For SharePoint Online / Office 365, you can use JSOM to make cross-site collection calls as long as the site collections are all in the same tenant. There are only two scenarios where you can make cross-site collection calls using the JavaScript Object Model in a SharePoint on-premises farm: Both site collections are located in the same web application ...


3

I've not provided whole code but you can call cross site connection using JavaScript. Take a reference from below code: var crossSiteContext = new SP.ClientContext("http://url-of-another-siteCollection/"); var crossSiteWeb = crossSiteContext.get_web(); crossSiteContext.load(crossSiteWeb); crossSiteContext.executeQueryAsync(function(){ var ...


0

Change your onSuccessMethod with below one with proper id: function onSuccessMethod(sender, args) { document.getElementById("your input control's id").value = web.get_title(); }


0

As far as I can tell, it seems like MS made an unannounced change related to this at some point in the last 2-4 weeks. You used to be able to prevent the threshold error by filtering based on indexed/built-in fields, (so long as the filtered results counted less than 5000) but that no longer seems to be the case. That said, I have two suggestions that might ...


0

Specifying FeatureDefinitionScope.Farm as the FeatureDefinitionScope scoped worked for me. I have tried both Web and Site scopes but they did not work. I have succesfully activated publishing feature after web provisioned event from a remote event receiver using csom ref:https://social.msdn.microsoft.com/Forums/en-US/d063e579-8cbe-4522-8c1e-eec83329a12b/how-...


1

grup.Owner returns Principal object. so you can't load it using LINQ. You can load owner object for group inside foreach loop like this. ` GroupCollection collGroup = context.Web.SiteGroups; context.Load(collGroup); context.Load(collGroup, grups => grups.Include(grup => grup.Title, grup => grup.Description, grup => grup....


0

This is better as it only pulls back the document libraries rather than all the lists which you then have to check in a loop. var Libraries = clientContext.LoadQuery(Web.Lists.Where(l => l.BaseTemplate == 101)); clientContext.ExecuteQuery(); Also note that I've used the BaseTemplate property which has more granularity than BaseType. You can get ...


1

You can use below mentioned code to get the details version of specific item from SharePoint list using Client Object Model. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint.Client; using System.Net; namespace AccessVersionItems { class Class1 { File file; ...


1

When doing a CAML query for the page web URL I use: var fieldsToRead = "<ViewFields>" + "<FieldRef Name='WebPage' />" + "</ViewFields>"; as my CAMLViewFields var web = ($(this).attr("ows_WebPage")); gets the URL for the page. $("#relatedTable").append("<tr>" + "<td>" + "<a href=" + web + ">" + name + "</a>" + "...


0

You may require custom service to be written. Other than that I dont see any method. REST is the more capable when quering SharePoint even we think of other methods like CSOM or server side code.


0

Example url for the rest query, you can use this query and replace with your fields _spPageContextInfo.webServerRelativeUrl + "/_api/web/lists/getbytitle('Projects')/items?$select=userfield/Title&$expand=userfield/Title


0

I have found a workaround using lists.asmx web service using (var listsWS = new ListsService(url, cookie)) { string updateXml = string.Format("<Batch OnError='Continue'><Method ID='1' Cmd='Update'><Field Name='ID'>{0}</Field><Field Name='MetaInfo' Property='vti_contenttypeorder'>0x010100E1A96B0CF4FC4C4E8EABF3AB52EED1A3</...


0

For me it was enough to place RoleAssignments.Add() operation inside $context.Load(): # User or group name $name = "User1" # Principal $principalInfo = [Microsoft.SharePoint.Client.Utilities.Utility]::ResolvePrincipal($context, $context.Web, $name, [Microsoft.SharePoint.Client.Utilities.PrincipalType]::All, [Microsoft.SharePoint.Client.Utilities....


0

The answer provided by Ahmed Mahmoud is not wrong (and should perhaps be marked accepted), calling set_welcomePage on SPWeb RootFolder is the correct approach. But the provided examples doesn't run, so I have decided to provide a couple of alternative code examples. Note, they use features from ES6, and the variable subWeb refer to server-relative or ...


0

Technically I HttpGet will have issue if the URL length goes beyond 2000 characters. In that case, it's better to use HttpPost or redesign the URL schema. Check here for pretty well explanation: https://boutell.com/newfaq/misc/urllength.html In Summary: The maximum length of a URL in Internet Explorer is 2,083 characters Firefox: 65,536 characters Safari:80,...


0

Just for the sake of clarity, there are two properties: UniqueContentTypeOrder ContentTypeOrder ContentTypeOrder is a read-only field but if you're working with folders, you can use the property UniqueContentTypeOrder (available in CSOM) like so: Folder.UniqueContentTypeOrder = ContentTypeOrder//maybe some additional tweaking I actually made a ...


2

I tried your code and got an unknown error. So i tried removing each field in the LINQ query and I found the error is due to grup => grup.Owner. I have changed it to grup => grup.OwnerTitle and the code worked fine. Also for getting each property value of a group loop the group collection object and get its value as per below code. GroupCollection ...


0

You can simply add your credentials in Credential Manager under Windows Credentials. It will authenticate the site without giving the actual credential in the code.


0

Try putting the column name in square brackets like [Approval_x0020_Date]. The name should be the internal name of the column.



Top 50 recent answers are included