Getting Started > Use Lua Scripts > Method Reference > Field Methods

Field Methods
addField
This method adds a sub field with the specified name and value.
Syntax
addField (String fieldname, String fieldvalue)
Arguments
 
Returns
The LuaField object.
copyField
This method copies the sub field to another sub field.
Syntax
copyField (String fieldname, String destination [, Boolean case])
Arguments
 
copyFieldNoOverwrite
This method copies the sub field to another sub field but does not overwrite the destination.
Syntax
copyFieldNoOverwrite (String fieldname, String destination [, Boolean case])
Arguments
 
countField
This method returns the number of sub fields that exist with the specified name.
Syntax
countField (String fieldname [, Boolean case])
Arguments
 
Returns
The number of sub fields that exist with the specified name.
deleteAttribute
This method deletes the attribute specified by the name passed in.
Syntax
deleteAttribute (String name)
Arguments
 
deleteField
This method deletes the sub field with the specified name.
Syntax
deleteField (String fieldname [, Boolean case])
Arguments
 
getAttributeValue
This method gets the value of the attribute specified as a string.
Syntax
getAttributeValue (String name)
Arguments
 
Returns
Atribute values.
getField
This method gets the sub field specified by the name.
Syntax
getField (String name [, Boolean case])
Arguments
 
Returns
A single field object.
getFieldNames
This method returns a table containing strings representing all the sub fields’ names.
Syntax
getFieldNames ()
Returns
A table containing strings representing all the sub fields’ names.
getFields
This method gets all the sub fields specified by the name.
Syntax
getFields (String name [, Boolean case])
Arguments
 
Returns
A table of field objects.
getFieldValues
This method returns a table of strings of all the values of sub fields with the specified name.
Syntax
getFieldValues (String fieldname [, Boolean case])
Arguments
 
Returns
A table of strings of all the values of sub fields with the specified name.
hasAttribute
This method returns a Boolean specifying if the field has the specified attribute passed in by name.
Syntax
hasAttribute (String name)
Arguments
 
Returns
A Boolean specifying if the field has the specified attribute passed in by name.
hasField
This method returns a Boolean specifying if the sub field exists or not.
Syntax
hasField (String fieldname [, Boolean case])
Arguments
 
Returns
A Boolean specifying if the sub field exists or not.
insertXML
This method inserts a portion of XML as a new piece of metadata for the document.
Syntax
insertXML (LuaXMLNode node)
Arguments
 
Returns
A LuaField object of the inserted data.
name
This method returns the name of the field object in a string.
Syntax
name ()
Returns
The name of the field object in a string.
renameField
This method renames the sub field.
Syntax
renameField (String oldname, String newname [, Boolean case])
Arguments
 
setAttributeValue
This method sets the value for the specified attribute of the field.
Syntax
setAttributeValue (String attribute, String value)
Arguments
 
setValue
This method sets the value of the field to be passed in a string.
Syntax
setValue (String value)
Arguments
 
value
This method returns the value of the field object in a string.
Syntax
value ()
Returns
The value of the field object in a string.