Plumtree EDK (Enterprise Web Development Kit) 5.4.0 |

# IPropertyManager.CreateSelectionListProperty Method

Creates a selection list property with an existing selection list.

ISelectionListProperty CreateSelectionListProperty(
string name,
string description,
ISelectionList selectionList
);

#### Parameters

name
  Name of the property The name cannot be `null`, empty, or longer than 255 characters. The string used for the name will be trimmed of leading and trailing whitespace when it is stored and is case-insensitive during name comparison.
description
  Description of the property; cannot be `null` or longer than 255 characters.
selectionList
  An existing selection list; cannot be `null`.

#### Return Value

An `ISelectionListProperty`.

#### Remarks

If the selection list is not a persisted object, an `InvalidOperationException` will be thrown when `IDataEntryTemplate.Store` is called. The following example demonstrates creating a selection list and a selection list property.

    // Create a selection list representing states
    String[] stateOptionValues = {"CA", "MA"};
    ISelectionList stateSelectionList = selectionListManager.CreateSelectionList(rootFolder, "State Selection List", stateOptionValues);
    stateSelectionList.Store();
    // Create a selection list property that uses the selection list
    ISelectionListProperty stateSelectionListProperty = propertyManager.CreateSelectionListProperty("State Selection List Property", "Choose a state.", stateSelectionList);
    // Get the selection list
    ISelectionList originalSelectionList = stateSelectionListProperty.GetSelectionList();
    // The returned selection list is the same as the stateSelectionList above.
    // Set the selection list on the property
    stateSelectionListProperty.SetSelectionList(originalSelectionList);
    // The selection list is identical, so there
    // is no functional change to the selection list property.

#### Exceptions

Exception Type | Condition
--- | ---
ArgumentException | The name or description is a string longer than 255 characters.

#### See Also

IPropertyManager Interface | Plumtree.Remote.PRC.Content.Property Namespace