Tag Info

Hot answers tagged

14

I expect you have "BaseViewID" attribute set to "0" on the "View" element of your custom list definition. You should change this attribute to some other value (in range 1..255) and the problem should vanish then. Although this is actually all you need to solve the issue, I anticipate you might want some more detailed explanations :) Actually, BaseViewID is ...


10

It's always difficult to properly hide / remove the title field, anyway if it's a content type inheriting from Item (which I bet it is based on its ID inheriting from 0x01) you can safely do the following : Set inherits to FALSE, and rely on the RemoveFieldRef to remove the title field. You won't need to re-enter its definition within the Fields node. Here ...


9

The design intention of content types is to support re-use of the list schema (or behaviours). So if there is a requirement to create a lot of lists with the same structure, which is often the case, then the content type enables this. It would be unacceptable to have to create list schemas individually in this situation and would result in repetitive ...


7

First of all you're doing the number one mistake when building Web Parts (or ASP.NET controls for that matter). Never ever write code like this in the Render() method. Use the CreateChildControls() preferrably (IMHO) and if that not suits you use RenderContents(). If you're using/overriding the Render() you can break all kinds of things. Then; never ever ...


6

What Bill (@SPDoctor) said. It depends. Related to #3, as the solutions you work with get larger, you will tend to split up your solutions across several Site Collections. Since Content Types has site collection scope, this can become a problem if you dont want to have redundant maintenance of your content types. To solve this you can use the new SP2010 ...


6

If you want to declaratively attach the event receiver, you may specify ListUrl in the Receivers Element. <Receivers ListTemplateId = "Text" ListTemplateOwner = "Text" ListUrl = string RootWebOnly = TRUE | FALSE Scope = Site | Web> </Receivers> How to: Create an Event Receiver for a Specific List Instance


6

Yes, actually the recomanded way is to Hide that field or to use the FromBaseType="TRUE" Required="FALSE" Hidden="TRUE" Also if you inherited from other CT use RemoveFieldRef http://msdn.microsoft.com/en-us/library/aa543602.aspx


5

Create a custom permission level based on Contribute that does NOT have the Delete Items option selected. Apply this permission level to the list for the desired users. See this article for full details, http://mssharepointtips.com/tip.asp?id=1019, the screenshots are from 2007 but the premise is exactly the same in 2010.


5

(This answer assumes you're asking how to implement a solution like which you're asking): Best way to do this I think is to create a new Content Type which inherits from Page, and includes a PublishingImage column, and maybe some other columns for the details. Make the various columns for the details Optional or Required as needed. When people create their ...


5

Many of the "Fabulous 40" templates have customized forms. (You'll probably debate the fabulous part of the name at this point.) It looks like you are doing roughly the right things in the forms, but it's a little hard to tell where it's going south on you. When you created the new column, did you give it a name of "fStaffType"? If not, that's the issue. ...


5

Create custom list, and then enable attachments from List Settings -> Advanced Settings. This will automatically add a column of type Attachments to the list. But there is no way to have two columns of such type in a list.


4

Rewrite your formula with if-statements and nest them, something like this: =if(AND([Region1]="A",[Region2]="B"),"NO",if(AND([Region1]="C",[Region2]="D"),"YES","N/A")) The first if does the first test, if that statement doesn't hold: use the second if (nested in the first if).


4

Looks like ff12 is already defined somewhere else in the page and it's probably re-writing with _1 at the end. Can you just try drag and drop the field from the Data Source and let the designer figure out the field names? OR Can you try adding the "Custom Edit Form" in another page and then copy the FieldDescription?


4

Create a feature that upon activation have the proper code to attach to a specific list for e.g. : public override void FeatureActivated(SPFeatureReceiverProperties properties) { SPWeb site = null; try { //Adds the overridden ItemUpdated Event Receiver to a list site = ...


4

Update list item using powershell - $SPAssignment = Start-SPAssignment $SPWeb = Get-SPWeb http://SP -AssignmentCollection $spAssignment Next step is to get the list: $SPList = $SPWeb.Lists["Announcements"] When we have located the list we can retrieve the item. The quickest way is to use the GetItemByID() method: $SPItem = $SPList.GetItemById("1") ...


4

Lookup uses internal ID to do the mapping to the lookup list. Lookup list will have different ID in the other environment which will break lookups. Disclaimer: my answer is not based on factual knowledge, but in generic understanding of how these things tend to work in SharePoint. You will probably find the list ID used for the mapping somewhere in the ...


4

Do you want to show this field in the Display Form? If not you should mark your field as hidden in the content type properties it won't be shown in the forms (in InfoPath too). If you want to show it on the Display form only read this post


4

First connect to your list, then get the 'Fields' property which is of type SPFieldCollection, then call the 'Add' method. They key to answering your question is the SPFieldType enumerable. Check out this link to see what types of fields you can add list.Fields.Add("User", SPFieldType.User, isRequired); How to add a field


3

I cannot test this because I dont have a dev environment at the moment, but the following should work: ListCreationInformation lci; List list; lci = new ListCreationInformation(); lci.Title = title; lci.Description = description; ListTemplate lt = ...


3

Yes that is possible with out of the box web parts. You can leverage data view web part to display items from your custom list and query string filter web part to send filter values to the data view webpart. Check out a nice series of articles here: ...


3

I always create Site Columns and Content Types. Harsh experience has told me that anything implemented will probably seen as a cool idea by someone and will request it to be implemented elsewhere on the same site collection. If you have a hierarchy of content types in use across multiple lists inside web sites, and a change request means you need to, for ...


3

To the first question - yes. Some data is common across many places. For example, you might have a 'Financial Quarter' site column, and this could be used in many places; the financial quarter is still the financial quarter whether it's an expense request or a report of some kind, so it makes sense to be able to share that column between types. Conceptually, ...


3

You can use DisableAttachments="TRUE" on the top of Schema.xml and you should be good to go: For e.g. <List Title="Test List" Description="Test desc" Direction="0" BaseType="0" Url="Lists/TestList" DisableAttachments="TRUE" FolderCreation="FALSE" Version="8" Type="100" xmlns="http://schemas.microsoft.com/sharepoint/">


3

There is no way to act when an event is not triggered. That would sort of go against the logic of event handlers. As per your other thread, you might have a code error in your event receiver, causing it to throw an exception and exit unfinished. You might also have concurrency issues. Are you disabling event triggers while you are executing them ...


3

It could be restored from the recycle bin. Please check article below for broad understanding versions and recycle bin. Note that versions protect you restore previous version of item/document whereas recycle bins help you restore deleted item/document. Plan to protect content by using recycle bins and versioning (SharePoint Server 2010)


3

After SP1 for SharePoint 2010 some calendar scripts may stop working. We are using this script to determine when calendar loaded (it includes your expand all requirement): _spBodyOnLoadFunctionNames.push('WaitForCalendarToLoad'); function WaitForCalendarToLoad() { if (typeof SP.UI.ApplicationPages.CalendarNotify.$4a == 'undefined') { // post ...


3

Check if listItem.Properties["columnName"] is null And you don't have to go through a string if not just use (bool)listItem.Properties["columnName"] So a full test could be: if (listItem.Properties["columnName"] != null && (bool)listItem.Properties["columnName"]) { // Checked } else { // Not Checked }


3

Another way to do it (if "Open with Explorer" works for you) In the form library, on the ribbon navigate under "Library Tools" to the "Library" tab. In the "Connect & Export" section find "Open with Explorer". Depending on your screen resolution the full label may not be displayed; the icon looks like a folder with an arrow pointing to a computer ...


3

You can try creating a dynamic string and place that column in the configuration of it and then using that variable in your CC section. In detail: Add a step prior to all the email steps On this step, use the action "Build Dynamic String" Click the 'dynamic string' link in the new action, to open the "String builder" dialog Click the "Add lookup..." ...


2

You'll want to use IF statements, look at this MSDN article or this Office document for references. It also helps to mock it up in Excel and then copy/paste it into the calculated column. Edit: just about had it figured out and Dribble beat me to the formula, nested Ifs which can go up to 7 deep.



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