Class: RecordTypesLibrary

x2node-records~ RecordTypesLibrary

Record types library.

new RecordTypesLibrary(libraryDef)

Note: The constructor is not accessible from the client code. Instances are created by using factory's buildLibrary() method.
Parameters:
Name Type Description
libraryDef Object Library definition.

Members


<readonly> definition :Object

The original library definition provided to the factory.
Type:
  • Object

Methods


getRecordTypeDesc(recordTypeName)

Get descriptor for the specified record type.
Parameters:
Name Type Description
recordTypeName string | Symbol Record type name.
Throws:
If no such record type in the library.
Type
module:x2node-common.X2UsageError
Returns:
Record type descriptor.
Type
module:x2node-records~RecordTypeDescriptor

hasRecordType(recordTypeName)

Tell if the library has the specified record type.
Parameters:
Name Type Description
recordTypeName string | Symbol Record type name.
Returns:
true if there is such type.
Type
boolean

refToId(recordTypeName, ref)

Convert reference to a record of the specified record type to the record id.
Parameters:
Name Type Description
recordTypeName string Record type name.
ref string Record reference.
Throws:
If no such record type in the library.
Type
module:x2node-common.X2UsageError
Returns:
Record id.
Type
string | number