Sharepoint Multiple Values Column? - sharepoint

I want to create a custom field with multiple values like it may store array variables.
also this field is not a lookup field.
what can be the field type that I should inherit from to achieve this ?
thanks

SPFieldMultiColumn may well be the class you're looking for. Here is the relevant MSDN article:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldmulticolumn.aspx
Good luck with it though, custom fields can be a pain in the ears at the best of times.

Related

Sitecore check if an item has a delta with presentation details standard template

We have a lot of products that are stored as a Sitecore item.
Many of them use the presentation details defined on the Standard Values of the product template.
Now I would like the check for each product, if the presentation details is the same as the standard values.
And if they are not the same as in the standard values, I need to see the delta.
Someone an idea how to achieve this?
You can query all items and look at the "__renderings" field and come the value of it to the same field on the standard values. This field is the XML that stores the presentation settings. Any pages that have a value that doesn't match the standard values has been changed.

Depending fields in Document Library?

I would like to know if it's possible and how to do something like this in SharePoint 2010:
I want to add to a document library some custom columns; 2 of them will be of type choice.
I want one of them to be populated after the first has been selected and it will be populated based on the valued chosen by the user in the first drop down list.
Is that possible? How?
Thanks a lot, bye!
you are talking about a master-detail field. There are lots of ways to solve those problem and they all involve creating a custom field. Here's a write up of my offered approach, with links to various alternatives.
http://www.turimsaint.com/turimBlog/Lists/Posts/Post.aspx?ID=2

searchin value according to custom field in liferay

i have create one custom field in calender i want to search event whic meets custom field criteria how it can be possible because there is no method which in service class
Custom attributes are stored in the Expando* tables in Liferay and depending on how you define the custom fields it can also provide indexing and searching for you. It's a bit hard to say more without knowing more, I guess.

SharePoint list.items.GetDataTable column names not match field names

I am binding an SPGridView to a SPList. As code samples suggest, I am using the following code to create a dataview based on the list.
dim data as DataView = myList.Items.GetDataTable.DefaultView
grid.DataSource = data
etc...
What I am finding is that the column names in the resulting dataview do not always match the source fields defined in the SPList. For example I have columns named
Description
ReportItem
ReportStatus
these show up in the resulting dataview with column names like
ReportType0
ReportStatus1
This leads me to think that I have duplicate field names defined, but that does not seem to be the case.
Seems like I am missing something fundamental here?
Thanks.
The GetDataTable method is returning the internalName (or staticName -- I can't remember for sure which but they are frequently the same) representation of the columns, rather than the Title representation, which is what you see in the Web interface. I believe GetDataTable does a CAML query under the covers, and you have to use that internalName for field references in CAML.
This blog talks about it in a little more detail.
So I posted about this on my blog, but I wrote a little utility method that you can use, right after you get the data table it basically remaps the column names in the DataTable to their friendly names.
DataTable table = list.GetItems(list.DefaultView).GetDataTable();
foreach(DataColumn column in table.Columns)
{
column.ColumnName = list.Fields.GetFieldByInternalName(column.ColumnName).Title;
}
Hope that helps!
What you also could do (if you´re using .NET 3.5) is to use an anonymous type and bind against that. If you´re doing this you might wanna go with a Linq DataSource as well.
I have made a post that explains this here.

Auto number column in SharePoint list

In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?
Sharepoint Lists automatically have an column with "ID" which auto increments. You simply need to select this column from the "modify view" screen to view it.
You can't add a new unique auto-generated ID to a SharePoint list, but there already is one there! If you edit the "All Items" view you will see a list of columns that do not have the display option checked.
There are quite a few of these columns that exist but that are never displayed, like "Created By" and "Created". These fields are used within SharePoint, but they are not displayed by default so as not to clutter up the display. You can't edit these fields, but you can display them to the user. if you check the "Display" box beside the ID field you will get a unique and auto-generated ID field displayed in your list.
Check out: Unique ID in SharePoint list
If you want to control the formatting of the unique identifier you can create your own <FieldType> in SharePoint. MSDN also has a visual How-To. This basically means that you're creating a custom column.
WSS defines the Counter field type (which is what the ID column above is using). I've never had the need to re-use this or extend it, but it should be possible.
A solution might exist without creating a custom <FieldType>. For example: if you wanted unique IDs like CUST1, CUST2, ... it might be possible to create a Calculated column and use the value of the ID column in you formula (="CUST" & [ID]). I haven't tried this, but this should work :)
I had this issue with a custom list and while it's not possible to use the auto-generated ID column to create a calculated column, it is possible to use a workflow to do the heavy lifting.
I created a new workflow variable of type Number and set it to be the value of the ID column in the current item. Then it's simply a matter of calculating the custom column value and setting it - in my case I just needed the numbering to begin at 100,000.
it's in there by default. It's the id field.
If you want something beyond the ID column that's there in all lists, you're probably going to have to resort to an Event Receiver on the list that "calculates" what the value of your unique identified should be or using a custom field type that has the required logic embedded in this. Unfortunately, both of these options will require writing and deploying custom code to the server and deploying assemblies to the GAC, which can be frowned upon in environments where you don't have complete control over the servers.
If you don't need the unique identifier to show up immediately, you could probably generate it via a workflow (either with SharePoint Designer or a custom WF workflow built in Visual Studio).
Unfortunately, calculated columns, which seem like an obvious solution, won't work for this purpose because the ID is not yet assigned when the calculation is attempted. If you go in after the fact and edit the item, the calculation may achieve what you want, but on initial creation of a new item it will not be calculated correctly.
As stated, all objects in sharepoint contain some sort of unique identifier (often an integer based counter for list items, and GUIDs for lists).
That said, there is also a feature available at http://www.codeplex.com/features called "Unique Column Policy", designed to add an other column with a unique value. A complete writeup is available at http://scothillier.spaces.live.com/blog/cns!8F5DEA8AEA9E6FBB!293.entry
So I am not sure I can really think of why you would actually need a "site collection unique" id, so maybe you can comment and let us know what is actually trying to be accomplished here...
Either way, all items have a UniqueID property that is a GUID if you really need it: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.uniqueid.aspx
Peetha has the best idea, I've done the same with a custom list in our SP site. Using a workflow to auto increment is the best way, and it is not that difficult. Check this website out: http://splittingshares.wordpress.com/2008/04/11/auto-increment-a-number-in-a-new-list-item/
I give much appreciation to the person who posted that solution, it is very cool!!

Resources