Questions tagged [addfieldasxml]

AddFieldAsXml method creates a field based on the specified schema, Boolean value, and field options.

Filter by
Sorted by
Tagged with
1
vote
1answer
23 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
1answer
438 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
1answer
215 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
0answers
97 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
1answer
2k 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=...
2
votes
1answer
3k 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
1answer
669 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
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 ...
4
votes
1answer
691 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; ...