Questions tagged [spfield]

Represents a field in a list on a SharePoint Foundation Web site.

Filter by
Sorted by
Tagged with
0
votes
1answer
716 views

error when saving custom user field in a custom Page Layout

I have created a custom user field as follows <Field ID="{9B49F1A5-7FFB-400B-9B0E-0FC4D6C1417C}" Name="AMtalatFieldEditors" DisplayName="My Editors" Type="UserMulti" Mult="TRUE" ...
2
votes
2answers
1k views

Setting the default value for a taxonomy field

I have been creating a load of site columns with powershell from a .csv file. I am now trying to create new taxonomy or metadata field: $spField = $web.Fields.CreateNewField($...
1
vote
1answer
93 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 ...
2
votes
1answer
702 views

Copy list item field value to newly created custom column

I have the necessity to switch from using a default field to using a custom one in a number of list. I have also to "copy" the value contained in the old to-be-deleted column to the new created one. ...
0
votes
1answer
891 views

Property 'SetShowInEditForm' cannot be found on this object; make sure it exists and is settable.- SharePoint Online

I'm trying to make a field in Edit mode hidden by using this code below :- $web = $context.Web $site = $context.Site $list = $web.Lists.GetByTitle("Test List"); $fields = $list.Fields["TestHidden"];...
3
votes
1answer
5k views

Uncaught TypeError: Cannot read property 'toString' of undefined

I have implemented the jQuery UI autocomplete functionality on a input field using JSLink. It works like a charm when I test it using Internet Explorer 9, 10, 11 and Chrome. Some users are however ...
3
votes
1answer
1k 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 ...
0
votes
1answer
852 views

Efficient way to get all the field (column) values in an array from SharePoint List

I have to get all the field (column) values in an array from a SharePoint list. Right now I am looping through all the items in the list and creating an array. But it is very inefficient if I have ...
0
votes
1answer
838 views

How can I make sure that if linebreaks is inserted inside a multiline textbox it gets displayed like it

I have a field that looks like this in my schema: <Field ID="{7662cd2c-f069-4dba-9e35-082cf976e170}" Type="Note" RestrictedMode="TRUE" NumLines="15" Name="Body" DisplayName="$Resources:Project....
3
votes
0answers
316 views

What is the purpose of “EntityPropertyName” property of field?

I am getting all list fields using REST API, In result, I found there is "EntityPropertyName" property for each field. For some fields, it shows exactly same value as "InternalName" property But for ...
0
votes
1answer
18 views

Get SPField real DisplayName in timer job

I wrote two event revicer. On base on Web scope - this frature creat page and shom on them all list field by their display name, user select interesting to him field and can they use in mail template. ...
0
votes
1answer
2k views

Allow multiple selections on Person or Group field

In SharePoint 2013 on-premise I am trying to create a Person or Group field to use it in a content type. My problem with the field is that I cannot select more than 1 person. I have been googling a ...
-1
votes
1answer
21 views

Sharepoint 2013: Moving a field o be side by side with another field doesn't save it

in an list/EditForm.aspx, I have the following code to copy/paste a field to another place: var dest = $('span[title="MyTitle"]').parents("tr:first"); // place to be copied var source = $("input[id*='...
19
votes
3answers
5k views

set column order of fields using CSOM/REST javascript

I am creting list fields using CSOM ecma script. How do I set the column order of the fields to be displayed in the form programmatically? For eg: I have created the following fields programmatically :...
0
votes
2answers
871 views

Check if required fields are filled or not in SPList programmatically

I want to check if required field in SharePoint list is filled with data or not? Which method or property should i use?
3
votes
2answers
1k views

Get Value from Person or Group Type Field

How can I get Value from Person or Group Type Field from a List form. Context here is a SharePoint list. the point is I need to do this for validation purpose. So I need the value entered in this ...
0
votes
1answer
345 views

REST API couldn't create list field

I am trying to create list fields using REST api. But when I call the code given below many times, it creates some of the fields and not all of them. code: function addnewfield(name){ $.ajax({ ...
0
votes
1answer
283 views

Issue with Document Library (Preview) and Name field appearing in view

When I add a document library (preview) to a modern site page in SharePoint Online, it adds the name field to the view even though it is not in the view in the default library: Original Library View ...
0
votes
1answer
96 views

Set Lookup and User Field Types when Migrating to Sharepoint online using Migration API

I am in the process of writing a c# code to migrate set of files to Sharepoint online(o365) using migration API and I have successfully done migration using the approach mentioned in the below link. ...
0
votes
1answer
34 views

Rendering `Title` and `Edit` columns title description

I'm working on SharePoint 2016 OnPremises. I created a view which renders the columns titles, as the _layouts/15/ViewEdit.aspx does. The result: The original rendering is slightly different: Where ...
0
votes
2answers
3k 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
2answers
415 views

Unable to delete list column because of the error “Cannot change Hidden attribute for this field”

While deleting a list column I see an error: Cannot change hidden attribute for this field. I have changed the Hidden property to False. But still no luck. It keeps on throwing the error. The ...
2
votes
2answers
2k views

Calculated default value in DropDown

I want to set the default value from a dropdown field based on the content type. So basically: If Contenttype equals "HW" than set dropdown default value to "1". Each time I try to set the following ...
1
vote
2answers
908 views

adding link to SummaryLink field using Powershell not working

I have created a Summary Link field and added it to a page layout and created a page based on this page layout. I have tried to add links to the summary link using powershell but the links do not ...
16
votes
5answers
7k views

Is there a way to see if an SPField was created by a user?

I have some code where I am going through all of the Fields that belong to a content type. I'm curious if there is a way to check to see if the SPField was created by a user or if it is a system ...
1
vote
2answers
82 views

SP16 PowerShell - How to update field DisplayName after add in List

I want to know what is the best way to add a field in the list and change his display name. My case adds 20 fields in the list... but the code will get big... This is my code(working) $SPWebHolidays ...
0
votes
1answer
443 views

SharePointWebControls FieldValue Yes/No

Wondering if you could help me please. Currently have a page layout with a SharePointWebControl inserted on the page: <SharePointWebControls:FieldValue FieldName="Boolean1" runat="server" /> ...
20
votes
4answers
71k views

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["...
3
votes
1answer
3k views

How to Get SharePoint field internal name using Display Name?

In SharePoint list I know the field display name. Using display name I want to get Internal name of field, string FieldName = "Test Field"; SPField field = olist.Fields.GetFieldByInternalName(...
3
votes
2answers
230 views

How can I set the ShowAsPercentage property on SP.FieldNumber using REST API?

I am able to successfully create a new List column using the SharePoint REST API with the following JSON: {"Title":"My Title", "StaticName":"MyTitle", "Required":"false", "FieldTypeKind":9, "...
3
votes
0answers
422 views

SPBuiltInFieldId in CSOM?

Is there any alternative to SPBuiltInFieldId in csom /SharePoint online? Should you only reference field only by InternalName in csom/SharePoint online?
3
votes
1answer
149 views

How i can associate an SPFieldUser to a SPGroup

I am working on developing an event receiver inside my sharepoint 2013 farm on-premises. and inside the event receiver i am trying to assign a list column to a SPGroup. what i am trying to do is ...
0
votes
1answer
78 views

SPD - PageLayout set name in tag PageFieldFieldValue:FieldValue

I have two templates for pageLayout and use two fields from some content type. Can u set another name in this tag ?? <!--MS:<PageFieldDateTimeField:DateTimeField FieldName="8336201e-40ba-494c-...
2
votes
1answer
25 views

SP07 - WorkFlow where update ListItem

I want to create a workflow where update list item and increase with 1 her value. This is for like, dislike functionality. Like field is type number: Where put a counter in workflow?
2
votes
0answers
63 views

add Control on field date time

Is there a way to add a control on field datetime in schema.xml file without javascript and without c#. For exemple my date file cant be less than the current date . od date 2 must be more than date 1....
0
votes
1answer
192 views

How to set the “title” in a lookup field

if you have a lookup field, its Html source is depicted as: <option value="79" title="G0058">G0058</option> I could use jquery to change the title from G0058 to company1 (field name: ...
1
vote
2answers
5k views

Find content types for given column

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.listsfieldusedin.aspx $web = Get-SPWeb http://”sitecollectionurl” $column = $web.Fields[“Column Display Name”] $column....
0
votes
1answer
20 views

Which SPField property specifies if one is checked during view creation?

When I create a Standard View via the browser, some of the Columns are checked to be Display-ed by default, and some are not(see bottom of image). I am trying to build a view server side, and have ...
1
vote
1answer
143 views

How to retrieve the value from sharepoint column values contains comma(,)?

In my SharePoint list I have address column with comma values. For example Address1,Address2,Address3. When I was retrieving the value from list only I can get the address1 value. But address column ...
1
vote
1answer
138 views

Default value set, but not used

I am creating a field through the following xml: <Field Name="FieldName" StaticName="FieldName" DisplayName="FieldName" Required="FALSE" Hidden="FALSE" ID="{12345678-1234-...
0
votes
1answer
202 views

Retrieving columns created by user not built in columns

I want to retrieve columns in SPList which are created in the UI not the built in columns, I tried with the !field.FromBaseType but it's not working, I tried with the !field.SourceId.StartsWith("http")...
0
votes
1answer
347 views

CSOM, How to prevent duplicate error when create new list item with a unique enforce column value?

I have a list with 2 columns. These columns have "enforce unique values" enabled. I would like to add a new list item in CSOM. But got sometimes the duplicate error. How can I prevent this error? What ...
2
votes
2answers
4k views

Hide fields in new item menu

I have followed the answer described in Hide list column on new, edit item-OOTB But what I found is when editing the column from the content type, i found the hidden menu is disabled. Content type ...
0
votes
1answer
361 views

Passing a value to a custom JSLink field type

I'm creating a custom field type for Sharepoint using the JSLink method. This field will be used in New List Item / Edit List Item forms. What I want to do is to allow a user to set a custom ...
0
votes
2answers
582 views

Setting Field Formula Programmatically

I have a field formula which is working as intended which I've set in my list settings for the respective list. Now, my question is if it's possible to set this formula programmatically somewhere so ...
3
votes
1answer
120 views

Cannot set list item value

I want to set a ListItem value with PowerShell (SP2013). As the following screenshot shows, I (the current user) have Full Control for this list. However, I cannot edit any field value. The value ...
3
votes
1answer
4k views

The object has been updated by another user since it was last fetched

I am trying to update a site column on my content. When I save the changes, I get the error "The object has been updated by another user since it was last fetched." When I searched the issue, I found ...
4
votes
3answers
12k 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 taxField.SetFieldValue(...
0
votes
4answers
616 views

internal name of Default Task Status field on 2013 OnPrem?

I don't have OnPrem at hand, can someone check what the internal fieldname is for the default Tasks List "Task Status" field. On Office365 it is Status, I know it was TaskStatus in SharePoint 2010 ...
0
votes
1answer
344 views

How to add a content type field to a SPList using PowerShell

This the scenario: I have created a new LookupField (Content Type) called MyLookupField which derives from SPFieldLookup as shown below: public class MyLookupField : SPFieldLookup { ... } Here's ...