New answers tagged

0

The error could be misleading, because it requires the "The server-relative URL to the root folder of a list, such as /sites/sitecollection/subsite/Lists/Announcements." . Try the following: SPList spList = spWeb.Lists.TryGetList("Site Assets"); // if you only have the display name of the list; OR SPList wfList = spWeb.GetList((spWeb.ServerRelativeUrl + ...


-1

You can try below mentioned code. string richtext = li["Enhanced_x0020_Rich_x0020_Text"] != null ? li.FieldValuesAsText["Enhanced_x0020_Rich_x0020_Text"] : string.Empty; The error message you provided is for the different thing. It says that you are not loading the content in clientcontext properly. You need to try context.load(li, ...


0

Read the data as HTML and then remove tags using string manipulation or Regex String plaintext = Regex.Replace(richTextContent, "<.*?>", string.Empty);


0

This was really misunderstood the error given by visual studio. It was happen due to the fact that the unexpected shutdown of my machine, it affected to the ongoing process of taking site collection backup. This was found after so many blogs read and so many user permissions changed in SharePoint. This mainly happen due to power shell command being ...


1

Make sure you have started visual studio using an account that has necessary permissions. Alternatively you can try deploying using SharePoint Management She'll.


0

Sorry, I don't think it's possible in claims authentication because until and unless it is intercepted by ADFS it won't be authorized and hence SAML token won't be issued to particular user after issuing SAML token identity field under HttpContext is populated, Please read the below link Claims-based Authentication, ADFS 3.0, and SharePoint 2013 – ...


0

for displaying months in gantt view. I did little modifications to fancy thing above. <script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(function(){ var oldGanttControl = SP.GanttControl SP.GanttControl = function(){ oldGanttControl.call(this) var oldInit = this.Init this.Init = function(jsGridControl, jsRawGridData, ...


0

If you turn on versioning for the list, you will be able to see the accumulated changes in the version history of each item.


2

Try this : ---> createdDate.ToString("s")


2

Please note that date you are passing in CAML query need to be in ISO8601DateTime format. string createdDate = startDate.ToString("yyyy-MM-ddTHH:mm:ssZ"); then pass this in CAML query. Reference: http://www.codeproject.com/Articles/414414/SharePoint-Working-with-Dates-in-CAML


3

Which event is your Event Receiver trigging on? Because the -ed receivers are asynchronous by default (which could explain the behavior you're seeing). So, either use ItemUpdating event for your receiver, or explicitly mark your ItemUpdated receiver as synchronous (in the XML or code based on how you are adding the receiver) For XML: ...


0

Try putting this in your REST search call: &refiners='ManagedProperties(filter%3d600%2f0%2f*)' It will return all managed properties of the found item as refiners (you could restrict your query to content type for example). Have a look at this search tool. It is great for testing search queries and seeing all managed properties: ...


0

As per below example code: using System; using Microsoft.SharePoint.Client; using SP = Microsoft.SharePoint.Client; namespace Microsoft.SDK.SharePointServices.Samples { class DeleteListItem { static void Main() { string siteUrl = "http://MyServer/sites/MySiteCollection"; ClientContext clientContext = new ...


0

Try the below REST End point, _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Videos')/items?files?$filter=Id eq 1&$select=File$expand=File" or _spPageContextInfo.webAbsoluteUrl +"/_api/web/lists/getbytitle('Videos')/getitembyid(1)?$select=File&$expand=File" Get the file name with extension by accessing Name property and url ...


0

use /_api/web/lists/getbytitle('Videos')/Files and you should be able to get the file name and extension


2

HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default; This solve my problem :)


0

The best way to get the data from external SQL database into SharePoint would be through Business Connectivity Services. SharePoint 2013 has a new type of List called the External List which is used for displaying data that comes from Business Connectivity Services (BCS). You can connect with any external source (in your case it is a SQL database table) and ...


0

You can easily add SQL Server data to SharePoint list using one of the following way. Use BCS to insert data in SharePoint list from SQL Server table. Have a look at this link for better understanding. SharePoint List From SQL Server Table (External Content Type with SharePoint Designer) You can refer this article What is the best way to import SQL table ...


0

The current version is the base URL, without the /_vti_history/nnn/ part of the URL. With respect to versions there is x Versions + 1 which is the current URL, not to be confused with the current published.


0

Why not create a simple workflow that runs when the item is changed. Inside the workflow, you can check the value of Item Status and if it equals to Published, do your calculation!


0

Have you tried to use the ParentFolderId instead? Discussions have two different content types, Discussion for a new topic posted and Message for a reply to that topic. The ID for the original discussion (topic) post is the column "ID" on that item. But the reply messages store this same number in the "Parent Folder ID" column.


0

This is the code i use to get videos info from a "Asset Library", maybe this can help you. I don't know how to get the preview pic but should be right there: getDataFormVideosList:function(next){ var camlQuery = new SP.CamlQuery(); camlQuery.set_viewXml('<View>' + '<ViewFields>' + ...


0

You need to add the the microsoft.sharepoint.client dll as reference in your project and then import (using Microsoft.SharePoint), then you can use all the predefined SharePoint classed in your class without any issue. Below link details all the classes that are available under the namespace. ...


2

You should refer this link once. This post contains the code for authenticating with your SharePoint Online and upload a file into the given library. class Program { static void Main(string[] args) { using (ClientContext clientContext = new ClientContext("https://xxxx.sharepoint.com/sites/SiteName")) { ...


2

Document sets are just "fanzy" folders, so you have to use scope RecursiveAll. query.ViewXml = "<View Scope=\"RecursiveAll\" /> "; Or simply use the CreateAllItemsQuery that sets the same caml markup: CamlQuery query = CamlQuery.CreateAllItemsQuery();


0

[SharePoint Online] I've had this problem too, it was not the App principal that was returned but the site admin as current user. The problem for me was that I had not yet added this to the app manifest: <AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" ...


2

Query should be like camlQuery.ViewXml = "<View><Query><Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Test1</Value></Eq></Where></Query></View>";


0

Found the answer. If you want to retrieve all list items just don't put anything for the CamlQuery. private static ListItemCollection GetListItems(List docLibrary, ClientContext ctx) { CamlQuery query = new CamlQuery(); var listItems = docLibrary.GetItems(query); ctx.Load(listItems); ...


2

On your SPQuery object, you can set the scope in the ViewAttributes property, as documented here: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.spquery.viewattributes.aspx ... SPQuery spQuery_temp = new SPQuery(); spQuery_temp.Query = "<OrderBy><FieldRef Name='Modified' Ascending='False' /></OrderBy>"; ...


2

try this one: SPSite site = SPContext.Current.Site; SPWeb web = SPContext.Current.Web; SPList list = web.Lists[“Shared Documents”]; SPQuery query = new SPQuery(); //Condition to check the item type is folder or not query.Query = “<Where><Eq><FieldRef Name=’FSObjType’/><Value ...


1

I don't think there is any official documentation about that. After decompiling DLLs, this is what I found : Microsoft.SharePoint.Navigation.SPNavigationNode.Properties are coming from SPRequest.GetNavigationNodeProperties The latter gets those properties from an internal class, which seems to point to OWSSRV.dll that I cannot decompile. See also : ...


1

Yes, it is possible to create custom HTML, Javascript and CSS in your SharePoint site. A tool called SharePoint Designer is also available that shall help you to perform this. It is suggested that rather than this IDE it would better if you would use SharePoint Designer as it is designed for SharePoint specifically. You would be able to download this ...


2

You can use a couple of approaches: Save last item id in SPList properties and then retrieve the value next time you're adding an item: //set - after setting all field values and updating the item itemAdd.Update(); wayList.RootFolder.SetProperty("LastItemID", itemAdd.ID); //you need AddProperty if it doesn't exist //get //then subtract 1 if needed var ...


2

You can perform this activity using CAML query with the below logic Get the list items in descending order Set row limit as one and retrive the record CAML Query: <View><Query><OrderBy><FieldRef Name='ID' Ascending='False'/></OrderBy> <Where> <Eq> <FieldRef Name='Title' /> <Value ...



Top 50 recent answers are included