Show / Hide Table of Contents

Class ExtraFieldsInfo

With this class, you can retrieve meta-information about an extra field.

The class will only retrieve information, thus it is not possible to change an extra field from this class.
Syntax
Examples
ExtraFieldsInfo e;

e.getExtraFields("person"); // Finds extraFields in table person

Constructors

ExtraFieldsInfo()

Initializes a new instance of the ExtraFieldsInfo class.

Declaration
ExtraFieldsInfo
Examples
ExtraFieldsInfo e;

e.getExtraFields("person"); // Finds extraFields in table person

Methods

eof()

Checks if there are no more fields in the result.

Declaration
Bool eof()
Returns
Type Description
Examples
ExtraFieldsInfo efi;

for (efi.getTicketChildrenFields(); !efi.eof(); efi.next())
{
  // do something with information from efi
}

getChildrenFields(Integer,Integer)

Loads extra fields of the type given in the first parameter. If the type is an extra table relation, the second pointer is the ID of the extra table it points to.

Declaration
Void getChildrenFields(Integer type, Integer extraTableTarget)
Parameters
Type Name Description
Integer type
Integer extraTableTarget
Returns
Type Description
Void
Remarks

Unless type is 20 (extratable), the second parameter won't do anything.

Types can be:Integer = 1, Text (long) = 2, Date = 3, DateTime = 4, Time = 5, Bool = 6, TimeSpan = 7, Text (short) = 10, Customer relation = 16, Company relation = 17, Ticket relation = 18, User relation = 19, Extra table relation = 20, Attachment relation = 22, Link = 23, Category relation = 24, Priority relation = 25, FAQ relation = 26
Examples

If you want all extra fields pointing to the extra table with ID 5, you'd call getChildrenFields(20, 5)

If you want all extra fields of type Dat you'd call getChildrenFields(3, 0)

getCompanyChildrenFields()

This is a helper function for getting company relation fields. It is equivalent to calling getChildrenFields(17, 0).

Declaration
getCompanyChildrenFields()
Returns
Type Description
Void
Examples
ExtraFieldsInfo e;

e.getExtraFields("person"); // Finds extraFields in table person

getCustomerChildrenFields()

This is a helper function for getting customer relation fields. It is equivalent to calling getChildrenFields(16, 0).

Declaration
Void getCustomerChildrenFields()
Returns
Type Description
Void
Examples
ExtraFieldsInfo e;

e.getExtraFields("person"); // Finds extraFields in table person

getDisplayField()

Returns the display field of the current field.

Declaration
String getDisplayField()
Returns
Type Description
String
Remarks

The display field is a format of the field that can be used to address the field in functions such as SearchEngine.

Examples
ExtraFieldsInfo e;

e.getExtraFields("person");
print(e.getDisplayField());

getExtraFields(String)

Gets extra fields related to the given table. Using this method will make it possible to access the information in the extra fields by using the other functions in the class.

Declaration
Void getExtraFields(String table)
Parameters
Type Name Description
String table
Returns
Type Description
Void
Examples
ExtraFieldsInfo e;

e.getExtraFields("person");

getFieldName()

Returns the field name of the current field.

Declaration
String getFieldName()
Returns
Type Description
String

The field name of the current field.

Examples

This code prints all field names of extra fields:

ExtraFieldsInfo e;

e.getExtraFields("person");

while(!e.eof()){
  print(e.getFieldName());
  e.next();
}

getFlags()

Returns the flags for the current extra field.

The flags can be accessed by wrapping the returned Integer in a FHBitSet.
Declaration
Integer getFlags()
Returns
Type Description
Integer
Remarks
FlagDescription
0The field is searchable
1The field is public (external)
2The field is viewed in new-ticket form
3The field is set (datetime) when clicked
4The field cannot change after being set
5The field is a dropdown (extra string fields)
6The field is directly readable from database
7Do not HTML-escape the value when displaying field
8The field is deleted
9The field is the ID
10The field is a foreign ID
11The field is not writeable
12Use default value for field if no value is supplied
13List relations
14View this field when listing rows
15Hide the header for this list if there are no entries
16Hide the function buttons for this relation
17The field cannot be empty
18The field is not shown anywhere
19The field is indexed
20The field is viewed in relational searches
21The field listed with the other main properties for the entity (i.e. for 'Edit ticket' it is shown on the first pane)
22The field is a FK, and in Archives this relation should be followed and columns in the target table should be available in the archive
Examples
FHBitSet flags;

flags.set(extraField.getFlags());

flags.getBitNo(17);  // returns true if the extra field cannot be empty

getName()

Returns the descriptive name (not the database name) of the current field.

Declaration
String getName()
Returns
Type Description
String
Examples

This code prints all names of extra fields:

ExtraFieldsInfo e;

e.getExtraFields("person");

while(!e.eof()) {
  print(e.getName());
  e.next();
}

getParam(String,String)

This function returns the value of the given parameter.

Declaration
String getParam(String parameter)
Parameters
Type Name Description
String parameter

The info to get, see list of values.

Returns
Type Description
String
Remarks

Available values:

VariableAvailable toDescription
defaultNowall typesuse current time and date as default value
defaultActiveUserall typesuse active user as default value
fieldsTimeSpannumber of fields
heightText long
linkNameDynamic link
linkValueDynamic linkurl
onlyLeafNodeExtra table relation
precisionFloatnumber of decimals
optionText long, Text short
useDaysTimeSpan
useHoursTimeSpan
useMinutesTimeSpan
useTextAreaText long
targetLabelContact relation, Company relation, Request relation, Extra table relationheader
Examples
ExtraFieldsInfo e;

e.getExtraFields("person"); // Finds extraFields in table person

getTableName()

Returns the name of the table the current field belongs to.

Declaration
String getTableName()
Returns
Type Description
String

The table the current field belongs to.

Examples
ExtraFieldsInfo e;

e.getExtraFields("person");
print(e.TableName());

Will print "person".

getTicketChildrenFields()

This is a helper function for getting ticket relation fields. It is equivalent to calling getChildrenFields(18, 0).

Declaration
Void getTicketChildrenFields()
Returns
Type Description
Void
Examples
ExtraFieldsInfo e;

e.getExtraFields("person"); // Finds extraFields in table person

next()

This function moves to the next field in the result.

Declaration
Void next()
Returns
Type Description
Void
Remarks

A common usage is in the increment section in a for loop.

Examples
ExtraFieldsInfo efi;

for (efi.getTicketChildrenFields(); !efi.eof(); efi.next())
{
  // do something with information from efi
}
In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top