Class Company

Represents a company.

Examples

Company c;

c.load(2); // Loads company with ID = 2
print(c.getValue("primContact"));
c.setValue("name", "SuperOffice");
Bool b = c.checkFieldRights("contact", "read");
print(b.toString());
c.save();

Constructors

Company()

Initializes a new instance of the Company class.

Declaration

Company

Examples

Company c;

c.load(2);

Methods

checkFieldRights(String,String)

Checks if the current user has access to the field.

Declaration

Bool checkFieldRights(String field, String fieldRight)

Examples

Company c;

c.load(3);
Bool b = c.checkFieldRights("contact", "read");
print(b.toString());

Parameters

Type Name Description
String field The field to check.
String fieldRight Type of access to check for - read or write.

Returns

Type Description
Bool True if the current user has access to the field; otherwise, false.

checkTableRights(String)

Checks if the current user has access to this company.

Declaration

Bool checkTableRights(String tableRight)

Examples

Company c;

c.load(3);
Bool b = c.checkTableRights("select");
print(b.toString());

Parameters

Type Name Description
String tableRight Type of access to check for - select, update, or insert.

Returns

Type Description
Bool True if the current user has access to the company; otherwise, false.

findFromDomain(String)

Find and load company object given a domain.

Declaration

findFromDomain(String domain)

Parameters

Type Name Description
String domain Domain of the company.

Returns

Type Description
Bool True if successfully loaded; otherwise, false.

getFormattedAddress()

Gets the formatted company address.

Declaration

NSLocalizedField[][] getFormattedAddress()

Returns

Type Description
NSLocalizedField[][] The formatted company address.

getValue(String)

Gets a String with the value of a given column.

Declaration

String getValue(String colName)

Examples

Company c;

c.load(3);
print(c.getValue("name"));

Parameters

Type Name Description
String colName The column to get data from.

Returns

Type Description
String A string value of the given column.

load(Integer)

Load object with values from company with given ID.

Declaration

Bool load(Integer id)

Examples

Company c;

Bool b = c.load(3);
print(b.toString());

Parameters

Type Name Description
Integer id The ID of the company.

Returns

Type Description
Bool True if successfully loaded; otherwise, false.

loadFromAgentAndKey(Integer,String)

Loads a company based on agent ID and external key.

Declaration

Bool loadFromAgentAndKey(Integer agent, String key)

Parameters

Type Name Description
Integer agent The ID of the agent that owns this company.
String key The external key of this company.

Returns

Type Description
Bool True if successfully loaded; false if the company does not exist.

save()

Saves the object and returns its ID.

Declaration

Integer save()

Returns

Type Description
Integer The company ID.

setFormattedAddress(NSLocalizedField[][])

Sets the formatted address for a company.

Declaration

Void SetFormattedAddress(NSLocalizedField[][] name)

Parameters

Type Name Description
NSLocalizedField[][] name The new address.

Returns

Type Description

setValue(String,String)

Sets a value in a column of a company.

Declaration

Void SetValue(String colName, String value)

Examples

Company c;

c.load(3);
Bool b = c.checkTableRights("select");
print(b.toString());

c.setValue("name", "Test");

Parameters

Type Name Description
String colName Column name.
String value Value that should be stored.

Returns

Type Description

toParser(Parser)

Puts a lot of fields into the input parser.

Declaration

toParser(Parser parser)

Parameters

Type Name Description
Parser parser The parser to put the field-value-pairs to.

Returns

Type Description