Represents a field in a list on a SharePoint Foundation Web site.
0
votes
0answers
8 views
Multichoice boxes in SharePoint (SPFieldType)
I have the following code:
SPList targetList = spWeb.Lists["Certification"];
list.Fields.AddLookup("MemberCertifications", targetList.ID, false);
...
1
vote
0answers
31 views
JavaScript function in URL field value
Is it possible to set the value for the URL field so that when clicked it runs a JavaScript function? I have created a field which stores links to files in SharePoint, but when clicked, the file is ...
1
vote
0answers
84 views
SPListItem.Update Not working
So I have this really simple function which updates a couple of fields on two different lists (one is a document library)
The thing is on the document library does not updates any of the fields I need ...
2
votes
2answers
338 views
Using PowerShell how do I change the column ordering for a SharePoint List
Been trying to search for the answer to this, what I need to do is re-order the fields of a SharePoint list and propagate that change down to 300+ sites (should have used a content type, but oh well)
...
0
votes
1answer
17 views
Editing SPFieldMultiColumn and saving updated value
I can get a reference to my SPFieldMultiColumn
var documentLinkFieldValue = listItems[i]["DocumentLink"] as SPFieldMultiColumnValue;
var oField = listItems[i].Fields["Document Link"] as ...
0
votes
1answer
354 views
Modifying XSL for multi lookup field
I'm trying to create custom XSLT for a multi lookup field, based on this article.
When changing disable-output-escaping to yes I can see the html I want to modyify:
<a ...
1
vote
0answers
16 views
Is it actually possible to instantiate SPField?
I want to create a custom List programmatically from scratch:
First I add:
Guid listID = web.Lists.Add(title, description, SPListTemplateType.GenericList);
list = web.Lists[listID];
Then I want to ...
0
votes
0answers
27 views
Adding SPFieldCalculated to a Document Library not working
I am using this piece of code to copy Fields from Document Library "A" to Document Library "B". I have only one issue when adding a calculated. This is the code.
private static string ...
2
votes
2answers
480 views
Create custom SPFieldLookUp that allows multiple values
I am pretty new to creating a custom field tupe and I have recently come across a need to create a custom SPLookUPField that allows multiple values.
The main requirement is to change the way the ...
0
votes
1answer
21 views
Retrieve reference for list from Lookupfield
I have a sharepoint 2007 and in a document library eventhandler: in ItemUpdating, i would like to be able to retrieve the value by id's from lookupfield. So with other words i have to get the ...
1
vote
2answers
52 views
ItemAdding in document library
I have an issue with setting the field in item updating event in document library with SharePoint 2007.
I have following situation, I have a document library, and when i add a document based on one ...
0
votes
0answers
14 views
Retrieving the SPLookupFieldCollection with particular ID's
The situation is following:
I have this kind of string = 58;#value;#59;#value2;#60;#value3;....
So as you see this is just if i do:
SPFieldLookupValueCollection collection= new ...
3
votes
1answer
59 views
Changing enterprise keywords column title programatically
I'm trying to rename an enterprise keywords column in a specific list of a subsite. In a Feature Activated event receiver i tried to set the column's display name by setting its title using the ...
0
votes
2answers
65 views
How to display and get the value chosen in an User field?
I'm very new at Sharepoint and I faced to a trick issue.
Here is the situation :
in an .aspx.cs file, I've created an EventHandler called btnValidate_Click, raised on a click on a button. In this ...
0
votes
1answer
764 views
BaseFieldControl in SPControlMode.Display not display correct values
I'm creating my own Display Form based on a view in a webpart. I'm getting the list (Document Library), and view, and then iterating through the fields, and creating a BaseFieldControl and then adding ...
0
votes
1answer
128 views
Custom Field PropertySchema Type=User
I have a custom field in my SP Project. In my .xml file, I have a propertySchema and a user field inside it. Currently the field does not accept multiple users/groups. How can I change that?
I ...
0
votes
1answer
23 views
Dates and times in Properties vs Fields
I'm trying to roll my own archiver for SharePoint. I always try to let the underlying object serialize itself. Only when it fails do I try to use .ToString(). Anyway, while inspecting the Properties ...
0
votes
1answer
30 views
Set SPBuiltInFieldId.WorkflowInstanceID value
I start worklfow programmaticaly on SPListItem (custom ContentType).
When i try to save all fields but "WorkflowInstanceID", its ok. But,
item[SPBuiltInFieldId.WorkflowInstanceID] = ...
1
vote
0answers
26 views
External lists: Field GUIDs always empty?
I want to turn an external list into a DataTable using the ID/GUID values of external list's Fields as the DataTable column names; however, I've noticed for the external list I'm using, all of the ...
0
votes
2answers
30 views
How to programatically tell if a field is a taxonomy / managed metadata field?
I am going after SPList.fields and getting the collection of fields...
I would like to eventually return only the fields that are managed meta data. Any ideas on how I can do this?
0
votes
2answers
101 views
How to Disabling SharePoint TextField Control Programmatically?
I'm developing a user control containing textfields bound to my list SPListFields and I'm using this user control twice with two different modes ( Edit or New).
In my Edit mode I want to disable a ...
1
vote
1answer
34 views
Find a specific field on a site and the set it to “Required” in a EventReciever
I have created a EventReciever that will be activated when a site gets created. This site have a announcement webpart. When they click on "add announcement", newform.aspx pops up as a dialog and there ...
1
vote
2answers
479 views
How to retrieve Users and Groups seperately from a “Person or Group” column via C# code?
I have a field in the discussion list, which allows the initiator of the discussion to specify the people to share the discussion with.
This field is typed as 'Person or Group' that allows selection ...
0
votes
1answer
76 views
How to set a UserMulti field via a UserField Control?
I have a list similar to the usual Tasks Sharepoint List and I introduced the field assigned to as a multi user field like this (I have read somewhere that with Mult option should always be set to ...
0
votes
1answer
64 views
RichTextField vs NoteField class
I'm about to create a field called details so I was thinking to make it a NoteField then I discoverd RichTextField.
And I found out that RichTextField inherits from NoteField which is a text box for ...
0
votes
0answers
124 views
How to save data in ItemFieldValue of custom lookup field type?
I have created custom field type inherited from SPFieldText successfully. I save a data in the item value as string of the next format: "id;#title". Now I need to convert the base type from ...
0
votes
0answers
83 views
SP 2010 Metadata and Crawled Properties
I'm creating a new custom list in code and when complete, the list looks fine. When I look in the Metadata section, in Crawled Properties specifically, I see most (if not all of my columns) under the ...
1
vote
1answer
257 views
Get all lists and sites using a given site column in sharepoint 2007 using powershell
In other words, is there a SPField.ListsFieldUsedIn() equivalent in SharePoint 2007?
Ref: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.listsfieldusedin.aspx
0
votes
0answers
47 views
Custom SPField error when re-deploying or upgrading WSP
I have created a custom SPField and is working well. But if I retract/deploy or if a upgrade the solution, I've got this error when accessing the item:
SPField Field type is not installed ...
2
votes
2answers
716 views
Programatically add SPFieldChoice (with Choices) to List
I have a list that I want to add a choice field to programatically. I also want to specify the choices. Here is the code:
var fieldChoice = (SPFieldChoice)list.Fields.CreateNewField("Choice", ...
2
votes
1answer
95 views
SPField not visible on default view when SPList created programatically
I'm creating an SPList item programatically. Everything goes fine, I add a list, I add spfields to it.
SPList list = (SPList)oWeb.Lists[listName];
SPField libraryNameField = new ...
2
votes
1answer
157 views
How to update field name for a list?
I am creating custom lists(fields,CT,List Def and list Instance) A and B with visual studio. I have site column called "Status" i have used those column name in ListA and ListB. Suddenly i need to ...
1
vote
2answers
2k views
SetFieldValue for a TaxonomyField
I'm on a solution where I create a term with some subterms in the termstore. After that I create a sitecolumn and a listcolumn. When setting a value to the listcolumns with
...
2
votes
2answers
619 views
Using the ItemAdding EventReceiver to update multiple fields based on values from one field
I have a custom SharePoint 2010 SPfield of type SPFieldMultiColumn. The data in this column is stored in a delimited string, which is parsed and rendered in a readable format in most areas (list view, ...
5
votes
2answers
6k views
How do I convert SPUser to SPFieldUser?
I have a field in a list that accepts an SPFieldUser object. I have an SPUser object that I would like to populate that field with, but I cannot implicitly convert from one to the other.
How would I ...
1
vote
2answers
57 views
What's A Field Group?
I need to create a field programatically, but the field has a required "Group" property. What is this property? What does it do/change? and what's a sensible value? MSDN as usual, failed to enlighten ...
0
votes
1answer
207 views
Sharepoint how to add field to list where field with such name already exists?
I have sharepoint list 'Events' with field Location.
I am trying to add from web existing field with same internal name from other package.
var fields = contentType.ParentWeb.Fields;
SPField ...
0
votes
0answers
16 views
owner field value disappears when coping document to another SC
On RootWeb of both site collections I have created same User field (owner). I mean same user field becuase I used same ID (GUID), name and everything. Then I add the field to a content Type and add ...
0
votes
0answers
111 views
Field display name / static name / title confusion
The msdn documentation for SPFieldCollection.Item[String] says
Gets the field with the specified display name from the collection. In Microsoft C#, this property is an indexer for the ...
0
votes
0answers
113 views
EditForm - custom control and updating field values
I'm using a custom rendering template on a list's EditForm. I created a UserControl with a asp:GridView and I would like to use it to insert mulit lookup field values (the standard multi lookup field ...
0
votes
0answers
33 views
Comments fieldlink not visibile
Here my code to add a field link of comments field to a content type
SPField field = site.RootWeb.Fields["Comments"]
if (field != null)
{
SPFieldLink spFieldLink = new SPFieldLink(field);
...
1
vote
1answer
99 views
difference between item[] and item.fields[]
I want to retrieve let's say the title field of my item so what's the différence between doing these acces methods :
SPList myList = properties.List;
string mytitle1 = ...
0
votes
1answer
142 views
SPFieldCollection TryGetFieldByStaticName bug?
I had expected that if TryGetFieldByStaticName succeeds and returns a value, there would be an SPField in the item that has a static name equal to what I used in the TryGet... call, but no? I.e. can ...
0
votes
1answer
92 views
add field directly to a Document library or via a Content Type
What is differents between adding a field (Site column) directly to a document library or via adding the field to a content type and then add this content type to the list?
Because fields directly ...
0
votes
1answer
198 views
New SPField shows in the view of my SPList but doesn't appear in any forms (edit, new)
I add a new column to a SharePoint list (the list is built on a content type) like this:
SPField textfield = list.Fields.CreateNewField(SPFieldType.Text.ToString(), "new column");
...
0
votes
2answers
301 views
why does the ReadOnlyField hide the field in forms?
i have a field that i want to make not editable for the users. its a field of type text.
I have a read about doing it with javascript and content editor webbpart, but i want to do it ...
0
votes
1answer
67 views
full name of the user in a User Field
I have a list which among other fields contains a user field, shows domain\username. Is there a way to show full name of the user in a User field?
1
vote
1answer
130 views
Custom field type - how inherit attributes from base field type
I need to create custom field type which must inherit ATTRIBUTES from inherited field type (e.g. Note).
I know how to add custom attribute on my custom type (using fldtypes...xml, custom ascx,...) ...
0
votes
1answer
138 views
What is a good way to determine via server object model if a field supports multiple values?
When looking at an SPField object, how can I tell if it supports multiple values?
I.e. a Choice field that is displayed using Checkboxes, a Managed Metadata field that allows multiple values, Person ...
1
vote
2answers
2k views
Try Get Field with client object model without error
Question regarding the client object model. I wrote some client script for a procedure, but i don't know, how can I determine if the list or item has the field available or not?
For example:
...





