Click or drag to resize

IScriptContextGetOrCreateField Method (String, ChoiceFieldItemType)

Gets or creates the field matching both the given name and choice type.

Namespace:  Compiled.EDD.Scripting
Assembly:  Compiled.EDD.Scripting (in Compiled.EDD.Scripting.dll) Version: 7.6.1.3-5cb5c356
Syntax
C#
FieldItem GetOrCreateField(
	string fieldName,
	ChoiceFieldItemType choiceFieldItemType
)

Parameters

fieldName
Type: SystemString
The name of the field.
choiceFieldItemType
Type: Compiled.EDD.ScriptingChoiceFieldItemType
The choice type of the field.

Return Value

Type: FieldItem
The existing field if the field exists and matches the choice type; otherwise, the newly created field.
Exceptions
ExceptionCondition
ExceptionThrown when a matching field name exists but the choice type does not match the field type.
See Also