Tag Info

New answers tagged

0

For uploading a file into a nested folder you could consider the following approach: ensure the target folder exist using the method provided below upload a file using SPFileCollection.Add method How to ensure a nested Folder exist using SharePoint SSOM internal static class SPFolderExtensions { /// <summary> /// Ensure SPFolder /// ...


0

Below code is used to create a folder under document lib with "CurrentMonth Year" if folder does not exists it creates new folder else add items to the folder . string currentDate = System.DateTime.Now.ToString(Constants.monthDateYearFormat); string[] splitter = currentDate.Split(' '); string folderName = splitter[0].ToString() + " " + ...


0

I have drop-down list that I populate using element fetched from a SharePoint list.Some of the rows are repeated, in order to eliminate the repeats this is what I use. JQuery: var alreadyUsed = {}; $("#dropdownCharts > option").each(function () { if (alreadyUsed[this.text]) { $(this).remove(); } else { alreadyUsed[this.text] = this.value; ...


0

According to Use OData query operations in SharePoint REST requests, Grouping is not supported. The solution, is to apply grouping for the JSON results returned from REST endpoint. How to group array results using jQuery function groupBy(items,propertyName) { var result = []; $.each(items, function(index, item) { if ...


0

It turns out that CSOM requires the 'encoded' names, i.e. TextField_x0020_WithSpace If you use the server object model, in context of sharepoint, you can just specify it with the space: listItem["TextField WithSpace"] = "value"; It's an awesome undocumented feature of sharepoint that wasted a cpl hours of my time. Isn't it great how to do the exact same ...


1

First thing to try: listItem["MyFirstTextField"] = "Blah"; //works fine listItem["TextField_x0020_WithSpace"] = "string"; //doesn't work listItem["MyFirstBoolField"] = true; //doesn't work listItem.Update(); Remove the Properties part.. The above actually consider you provide the Internal name of the fields, the internal name is obviously different from ...


1

When you are adding an item it updates the list item only once. But if you are using the ItemAdded there is another update happen on each list item in order to complete the whole operation. From performance perspective it is bad, but it is safe. Mean I also have seen this. Might be your environment has many event receivers. Try debugging and ensure every ...


0

When adding multiple items in SharePoint list then ItemAdded event works better than ItemAdding event. ItemAdding event has never worked for me for bulk uploads but yes ItemAdded event always works good. Hope this helps.



Top 50 recent answers are included