Tag Info

Hot answers tagged

29

There's an out-of-the-box way to remove the Add new item link. If you edit the webpart properties using the Modify Shared Web Part command, you'll find the Toolbar Type dropdown in the List Views section. If you choose No Toolbar there and save the page, the footer link will be gone. No code required, no unghosting/customization, and no effect on other web ...


24

The most efficient way to a lot of transaction in SharePoint is using of SPWeb.ProcessBatchData method. For deleting operations there are very helpfull post. Code exaple from that post: // We prepare a String.Format with a String.Format, this is why we have a {{0}} string command = String.Format("<Method><SetList ...


23

The main advantage is a small performance benefit. Internally SharePoint is always using the GUID so the other methods have to find the GUID and the do the lookup using the GUID. The second advantage is that the user can't change the GUID.


22

Although in most of the UI and API they can be manipulated the same way, there are some significant differences between Lists and Libraries. The latter is a specialized type of the former. Lists: Can have attachments Have major versions only Do not have Check-in/Check-out features Libraries: Cannot have attachments (files are directly in the library) ...


19

This is related how instance of SPListItem is being created. Actually in both cases new item is added to the collection of items in list, in first case new item is added explicitly, in the second one implicitly. The point is, that for initializing collection of items in list is used the same method GetItems but with different queries. ...


18

No No No No No No Yes, apparently: Create a view and select a Sort By column, then set that view as the default view The DataSheet view does not play ball. The problem is that the DataSheet view is a Microsoft Access generated data table, so there are none of the usual SharePoint hooks for interacting with it. Here are some more related questions: ...


15

In addition to your "Deactivated" field, create a Calculated field named "ActiveTitle" (or whatever you want to call it). Use the following formula: =IF(Deactivated,"",Title) The ActiveTitle field will be empty when the Deactivated field is set. When you configure your lookup column, tell it to use the value from ActiveTitle instead of Title. Empty values ...


14

If you just want to hide it, you can use following css (you must override sharepoint core css with your custom css file) td.ms-addnew{ display:none; }


12

You can associate your custom action to a specific list by using the RegistrationId property. Example: <CustomAction ControlAssembly="MagicalProject.Actions" ControlClass="MagicalProject.Actions" ControlSrc="/_layouts/MagicalSite/MagicalPage.aspx" Description="This is my custom action which does magical ...


12

Open the AllItems.aspx page for the specific list. Search for the <ViewFields> tag List item LinkToItem="TRUE" to whichever column you want the link: <ViewFields><br/> <FieldRef Name="Attachments"/><br/> <FieldRef Name="LinkTitle"/><br/> <FieldRef Name="linkThisColumn" ...


11

I had the Similar Issue. You need to do that same thing for the LinkTitle as well to get Name in the Default View. Though in the <ViewFields> <FieldRef> tag you have an option for DisplayName it didnt work as expected. Only way I found is to <Field Name="LinkTitle" DisplayName="Serial Number" Type="Text" />


11

A library is "just" a special type of list where the focus is on the File linked to the listitem Anything you can do with a list you can do with a library and then some


10

As Sean says one option is to make a template, and create a new list using that. http://grounding.co.za/blogs/neil/archive/2008/10/05/moving-a-list-with-content-between-sharepoint-servers.aspx If its simple you can perhaps use the DataSheet view to copy and paste the data to the new list if you've already setup the structure. You can IIRC do a ...


10

Yes this can be achieved by using an SPSiteDataQuery. See: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.aspx. This will require some programming. If you do not want to develop against the SharePoint Object model, then use the Content Query Webpart (requires SharePoint Publishing Infrastructure feature activated). You will ...


10

I like IAfanasov's response. ProcesBatchData is the way to go. But you are asking about the "most efficient way to delete all the items of a large list". The most efficient way is to delete the list and re-create it, if you really want to delete all items. It will be a lot quicker than doing any iterative actions.


10

You should recreate context. SPSecurity.RunWithElevatedPrivileges(delegate() { using(SPSite site = new SPSite(properties.SiteId) { using(SPWeb web = site.OpenWeb(properties.Web.ID) { //code } } }); //Edited for this bracket


9

Just to be clear: title is only "mandatory" if you create lists using the GUI. When you provision your own list using code or CAML you can create lists without Title. If you insert the formula =Me&" - "&TEXT(Today,"dd-mm-yyyy") into your calculated value, you should get something close to what you want. Be aware though that at any time the user ...


9

Q: Is there a max number of columns in a sharepoint list? A: SharePoint Server 2010 capacity management: Software boundaries and limits / Column limits Q: Can we use reporting services to read from two lists? A: Yes: if you are using SQL Server 2008 R2 reporting service Q: Is it possible to display information from two lists in a single view even if the ...


9

I took a stab at converting IAfanasov's answer into PowerShell. Seems to work for me, but would be interested in any feedback. [System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, ...


9

http://www.stum.de/2008/02/06/querying-the-person-or-group-field-using-spquery/


9

The key word in your question is "farm", and this answers your question for you: HIVE. THE HIVE The SharePoint hive was designed to house a single instance of those files which are used across all the sites and web apps within a SharePoint farm (regardless of the site type or branding etc). An example... A typical corporate SharePoint topology ...


9

You can also add the following line for each <row>: <Field Name="ID">1</Field> For example: <Row> <Field Name="Title">DevScanner</Field> <Field Name="ID">1</Field> </Row> As the ID is still the same it won't add a new record, so it prevents duplicate rows.


9

Do you try this solution? In this solution you should modify field declaration on a view through SharePoint Designer.


8

First of all, quickly learn that any SharePoint Development should not talk to the database directly, especially with SQL Queries. SharePoint has a fully-featured and very robust API framework for getting data in and out of SharePoint Lists, and (although it is a steep learning curve), it's just the way development is done in SharePoint. Now, you want to ...


8

I hate answering my owner questions here but found the problem. There's a flag on lists you can set a list to AllowDelete or not (this is for lists that are critical to the operation of a feature). The flag on these lists were set to False and wouldn't allow deletion. It still doesn't explain why the list was showing up twice both in the UI and SharePoint ...


8

Have you taken a look at the business data catalog (BDC) on moss 2007? The BDC (renamed Business Connectivity Services in SP2010) is an out of box feature enabling external business data (in your case a list of offices) to be surfaced within SharePoint site collections without writing any code. It may not be the perfect fit for your requirements, since if ...


8

web.Lists[guid] is the fastest. web.GetList(url) calls a couple of methods to get the guid and then returns web.Lists[guid]


8

Are you talking about SP 2010? Then you can use either the REST API or you can use the Client Object Model.


8

You can find list template ID in Visual studio by looking at Schema.xml but you won't going to find list ID. To get list ID you can use this code in VS, localhost.Lists ls = new WebApplication3.localhost.Lists(); ls.Credentials = new System.Net.NetworkCredential("sunil", "password"); ls.Url = "http://mossserver/_vti_bin/Lists.asmx"; var lsturl = ...


7

you can get the built in list templates using the SPListTemplateType enumeration: $listTemplate = [Microsoft.SharePoint.SPListTemplateType]::Contacts if you want to access custom list templates saved as STP files on your site, you have to fetch them from your sites list templates and access them through the list name: $site = Get-SPSite http://site ...



Only top voted, non community-wiki answers of a minimum length are eligible