Questions tagged [addfieldasxml]
AddFieldAsXml method creates a field based on the specified schema, Boolean value, and field options.
11 questions
1
vote
2
answers
46
views
Roadblocks in adding fields via CSOM in SPO
I have a program that is creating some lists and adding the necessary fields to the lists in SPO.
I have marked some of these fields as Required, but in list settings they do not show up as Required. ...
0
votes
1
answer
781
views
SharePoint Framework - Create a lookup column using feature
My requirement is to create a Custom List using the Feature (SPFx solution). I have created a custom list using the SPFx feature, I have created a different type of field. But now I want to create a ...
1
vote
1
answer
241
views
Add Sharepoint calculated field using AddfieldasXML - key cannot be null
I am trying to add a calculated field using the AddFieldAsXML method. And below is how I constructed the field xml.
> fieldXML ="<Field ID=\"{ABB544B1-5433-4B49-A629-7B242D3548E5}\"
> ...
0
votes
1
answer
661
views
Exception calling AddFieldAsXml with "1" argument
I am trying to add the column below via PowerShell
<Field
ID="{1920c575-d592-40eb-a163-5a302b78aa65}"
Type="Note"
DisplayName="1920c575d59240eba1635a302b78aa65"
StaticName="...
1
vote
1
answer
476
views
SP16 - Cannot create Calculated column with Powershell
This XML syntax is working:
$HolidayWorkID = "<Field Type='Number'
Name='HolidayWorkID'
DisplayName='HolidayWorkID
Group='Holidays' />"
But this doesn't working:
$HolidayReportMonth =...
4
votes
0
answers
107
views
How to provision "Content types" in SharePoint online
Short version
How do I provision Content Types and Site defs in Sharepoint online, onto my host web? I would prefer reusing existing content type definitions
Long version
We are migrating a fairly ...
1
vote
1
answer
3k
views
add multiple fields using AddFieldAsXml in csom
is it possible to add multiple fields at one go in SharePoint CSOM?
I tried
List list = context.Web.Lists.GetByTitle(listname);
string fieldSchema = "<Field Type='Text' DisplayName=...
3
votes
1
answer
4k
views
How to create lookup field programmatically using AddFieldAsXml Method?
i have two lists(Invoice & Client) which i had created dynamically through code and i want to create lookup field programmatically for relationship between this two list.
In Invoice List i have ...
1
vote
1
answer
762
views
Field names in announcement list in Sharepoint Online
I am trying to add fields to an announcement list. I have successfully added various fields with single-word names:
announcementy.Fields.AddFieldAsXml("<Field Type='User' DisplayName='CreatedBy'/&...
1
vote
1
answer
106
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 ...
4
votes
1
answer
700
views
AddLookup using the client object model?
Trying (desperately) to find the Microsoft.Sharepoint.Client equivalent of
SPList.Fields.Addlookup
My code:
ClientContext ctx = new ClientContext("http://sharepoint/");
Web website = ctx.Web;
...