Skip to main content

Knowledge Base

Go Search
Home > Support > Knowledge Base > Pages > 98282.aspx  

Create and manage SharePoint fields 
Category: Bug 
Applies to: Kivati Studio 

This article describes how to create and manage SharePoint fields using Kivati.

Details

SharePoint fields are a key building block of good composite applications in SharePoint.  You can use Kivati's field tasks to manage SharePoint fields easily in your lists.

Creating Fields

Kivati provides several choices of tasks for creating fields, depending on what type of field you want to create.

  • If you want to create a choice field, use the Create Choice Field task.
  • If you want to create a lookup field, use the Create Lookup Field task.
  • If you want to create another type of field, use the Create Field task.

Kivati also provides a Create Field from XML task that can be used to create any type of field if you have a valid XML field definition fragment.  This task is very powerful and can be an extremely fast way to create fields.

Setting Field Properties

The Set Field Properties task is used to change properties on all types of fields.  For this reason, you will see many categories on this task in the task design view, not all of which will apply for every situation.  There are a few properties that are important to mention as they have special behavior:

  • DefaultFormula and DefaultValue.  You can set either a default value or a default formula, but not both.  If both are specified, a formual takes precedence over a default value.  The default value you provide must be a valid value for the type of field you are working with or you will receive a warning at runtime.
  • Hidden.  Some fields cannot have their hidden bit toggled.  If this situation is encountered, you will see a warning at runtime.
  • Sealed.  Some fields, in particular built-in fields, cannot be marked sealed.  You will receive a warning at runtime if this situation is encountered.
  • Title.  Two fields cannot have the same title, and you will receive a warning at runtime if you attempt to set two titles to the same title.  Additionally, if you want to set the title for a field, you must chain a SPFieldCollection object into the FieldCollection property of this task.
  • TranslationXml.  This property can only be set if the list associated with the field is null.
  • Type.  Although some field type changes are supported, others are not.  If you try to change a field's type to a type for which a conversion is not supported, you will receive a runtime error.  You also cannot change a field's type to Invalid.

List Fields and Site Columns

The field tasks in SharePoint can be used to manage both list fields as well as site columns.  To manage list fields, associate the tasks with properties of list tasks, such as Fields on Get List Properties.  To manage site columns, associate the tasks with properties of site tasks, such as Fields on Get Site Properties.

More Information

The SharePoint SDK contains a wide variety of information about fields and may be useful to reference if you are using this task.

Last update: 5/1/2008 
Copyright 2000-2008 Kivati Software, LLC.
Home| Support| Terms of Use| Privacy| Legal