Click or drag to resize

IScriptContextTryGetOrCreateField Method (String, ChoiceFieldItemType, FieldItem)

Gets or creates the field matching both the given name and choice type. A return value indicates an existing field with type was found or a new field instance was created successfully.

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

Parameters

fieldName
Type: SystemString
The name of the field.
choiceFieldItemType
Type: Compiled.EDD.ScriptingChoiceFieldItemType
The choice type of the field.
outputField
Type: Compiled.EDD.ScriptingFieldItem
When this method returns, contains the result of an existing or created field.

Return Value

Type: Boolean
false if a field exists and type does not match true otherwise.
Exceptions
ExceptionCondition
ExceptionThrown when a matching field name exists but the choice type does not match the field type.
See Also