Most Popular

1500 questions
22
votes
4 answers

SharePoint 2013 - Change URL of document library

I created a Document Library called Resource Documents. Would it be possible for us to set a friendly URL on this library so that files may be read with the following URL pattern... http://site/my-resource-documents/... rather…
klewis
  • 1,353
  • 5
  • 29
  • 55
21
votes
3 answers

C# CSOM Create Folders in Lists programmatically

I am trying to programmatically (C# CSOM)create folders inside a custom List inside one of my SharePoint 2013 Online site.I have tried 2 code solutions , but both of them are behaving in a weird manner: This code works perfectly for creating…
Unnie
  • 8,819
  • 1
  • 22
  • 36
21
votes
1 answer

Advanced Search web part giving error

I am trying to add an "Advanced Search" web-part to my web-part page. Currently the web part is raising an error object reference is not set to instance of object. Full stack trace recovered from SharePoint log is shown below: AdvancedSearchBox…
Jon
  • 567
  • 2
  • 11
  • 20
21
votes
4 answers

How to set ListItem Lookup Field value

How do I set a ListItem's Lookup field using code? SPFile file = list.RootFolder.Files.Add(destUrl, iStream, true); SPListItem item = file.Item; item["DocumentID"] = DocID.ToString(); item["Priority"] = "2"; item["StatusLookup"] = "Draft"; …
John Hansen
  • 523
  • 1
  • 5
  • 13
21
votes
3 answers

Fastest way to delete all items with C#

Possible Duplicate: Deleting all the items from a large list in SharePoint What is the fastest way to delete all items in a list programmatically? I do not want to remove list and re-create it, but I need to get rid of all items. The way I do it…
Tschareck
  • 2,155
  • 7
  • 35
  • 52
21
votes
6 answers

Why is my column not shown under “Add a column to show each of these additional fields”?

I want to get 2 columns from another list and merge these columns. But when I am trying to do this via Lookup, they are not shown under "Add a column to show each of these additional fields". But when I tried a simple text one (not lookup) it is…
alicanbatur
  • 407
  • 2
  • 6
  • 16
21
votes
4 answers

Getting my head round spsite vs spweb vs anything else

I am fairly new to Sharepoint development (But learning it rapidly due to some initiatives I have in place - not exams). Anyway, one of my biggest stumbling blocks is the naming convention for objects. That is, spweb, spsite, etc. Is there an easy…
GurdeepS
  • 707
  • 2
  • 9
  • 13
21
votes
4 answers

Why is Word document created from template saved locally, instead of to the document library?

I have created a custom content type at the root of my Site Collection and set this content type to use a Word document template, which resides in a different document library on the root site. (The content type inherits from Document). I then…
Geir Smestad
  • 1,680
  • 5
  • 29
  • 46
21
votes
2 answers

How do I check if a site already exists from PowerShell?

I have a script that exports a site and restores it in another web application. I want to check if the target site already exists. Is there an easy way to tell if www.example.org/sites/asite/ is free, without throwing an error in Powershell?
Dan
  • 1,190
  • 3
  • 14
  • 25
21
votes
2 answers

Multiple Sharepoint projects in one solution - how to package correctly?

I have multiple Sharepoint projects in a solution: MySolution.WF MySolution.Webparts MySolution.UI I also have some common code in a MySolution.Common project. All of the aboe projects reference MySolution.Common. I first thought the way to go…
Dennis G
  • 4,775
  • 7
  • 55
  • 90
20
votes
6 answers

How do I trigger the default form validation without submitting the form

I'm customizing the NewForm of a list item and need to trigger the default form validation from my JavaScript, but I don't want the form to be submitted, since I'm doing that in a callback later on. Is this possible to do? I've tried searching on…
stinaq
  • 1,080
  • 2
  • 9
  • 20
20
votes
3 answers

How to enable publishing feature using CSOM?

How to enable site collection publishing infrastructure and site publishing features using CSOM?
thomius
  • 2,808
  • 8
  • 35
  • 50
20
votes
2 answers

ExecuteOrDelayUntilScriptLoaded with sp.js when in debug mode Object Expected

I currently have a JavaScript file that gets loaded in my SharePoint pages. jQuery(document).ready(function() { ExecuteOrDelayUntilScriptLoaded(myfunction(), "sp.js"); }); myfunction = function(){ /*Do something here.*/ }; Now the JavaScript…
Cann0nF0dder
  • 1,813
  • 3
  • 20
  • 32
20
votes
1 answer

REST list item delete does not go to Recycle Bin

I have a SharePoint 2013 autohosted app with a number of lists inside of it. I would like to be able to soft delete a list item using the REST API and have it go to the Recycle Bin instead of being permanently deleted. According to this page that…
mossjm
  • 303
  • 2
  • 5
20
votes
8 answers

Customing the newform.aspx of a list using jslink in SharePoint 2013

How do I customise the newform.aspx of a list in SharePoint 2013 using JSLink? A lot of examples seem to be for customising list views. I can't find anything that explains how to customise the new form for adding a new item to the list. Basically I…
ashwnacharya
  • 1,679
  • 3
  • 18
  • 27