webCOMAND

#ENUM

Convert a field choice Value to the corresponding Title.

Prototype

#ENUM($object_or_type, $field, $value = NULL)

Parameters

  • object_or_type - Specifies the content type that contains the field with choices.  The content type may be provided as:
    • Identifier - The content type identifier as a quoted string.
    • Object - A variable that references an object of the desired content type.
    • cPath - A cPath that references the content type as a quoted string.
  • field - Specifies the field within the content type that contains the field with choices.  The field may be provided as:
    • Identifier - The content type field identifier as a quoted string.
    • cPath - A cPath that references the content type field as a quoted string.
    • Object - A variable that references a content type field object.
  • value - The value of the choice to be translated into the Title.  This field is not required if an object is provided for the first parameter, because the value can be retrieved from the specified field of that object.

Return

Returns the Title that corresponds to the specified object field or field value.

Example

#/ Translate a Web Page Status Value into a Title
#ENUM('WebPage','Status',$Status)

#/ Get a Web Page Status Title
#CONTEXT(WebPage,OID=123)
    #ENUM($this,'Status')
#ENDCONTEXT

Related

ENUM(), cObject::enum()