Give us contact

Do you prefer to ask us directly?

Call us +420 605 203 938 (the Czech Republic)

or use this contacts

AyMINE

Related links


FI - Finance Management

API – Data object

Data object primarily encapsulated data and methods of the persistent object defined by system. However, additional functionality is linked with object for easier object presentation.


class DataObject  {

/** Marks that object is open readonly.
 * Set by detail when detail is open in readonly mode – seta after the evaluation of the readonly value i.e. after evaluation of the methods
 * __WARNING__ Methods cannot use it!!!
 */
get isReadonly(): boolean
set isReadonly(value: boolean)

/** returns object ID (oID) */
get ID(): iAttrVal

/** Allow set ID value – only if not already set or if value is the same as original
 * Used by object Detail when new object saved
 */
set ID(value: iAttrVal)

/** Returns true iff object is new – has no id */
get isNew(): boolean 

/** Returns object name */
get myObjName(): string

/** Returns translated object name
 * Translation is loaded from frm enum with object name translations
 */
get objNameTranslated(): string 

/** Return classID from json (about.classID) or undefined if class id is not defined for object */
get getClassID(): string 

/** Returns name of the if field name */
get idFieldName(): string

/** Returns name of the object static icon
 * Does not support dynamic icons!
 * @return about.icon (if defined) or icon nothing
 * @example icon for new operation for overloaded object icon:"=`${obj.myIconName}__new"
 */
get myIconName(): string 

/** Returns true, if object is assigned to this client.
 * Functional only for objects that have sysClientID and value is loaded! Throw exception otherwise
 * Use for checking object in case that detail allows open both client and non-client objects (like events)
 * 
 * Use to distinguish between system-wide definition (e.g. system-defined role) and client-defined object (e.g. a role defined internally by client)
 */
get isClient(): boolean 


/** Returns icon of the field that is enum-type
 *
 * Name of the enum is found from the field definition
 * @param fieldName – name of the object attribute. Should be name not value!!!
 * @param nameOnly optional, when true, function returns only icon name, not icon
 * fieldName must be field from object, use global.enumIcon of field is not of the object
 */
enumIcon(fieldName: string, nameOnly: boolean = false): string 

/** Returns icon of the field that is enum-type
 *
 * Name of the enum is found from the field definition
 * @param fieldName – name of the object attribute. Should be name not value!!!
 * fieldName must be field from object, use global.enumIcon of field is not of the object
 * @param presForm { I | T | TI | IT} – what to show Text, Image
 * @pararm short optinal value to use, by default value from the object is used, but this optional aattribute can override it 
 *    used in case that value should hace different name
 */
enumVal(fieldName: string, presForm?: enumPresentation, short?: string, spanClass?: boolean | string): string 

/** Returns name of the enum used by field
 * Does not support enumLimits!
 * @param fieldName name of the field with enum defined
 */
getFieldEnumName(fieldName: string): string 

/** Returns object icon 
 * WARNING: It does not return safely dynamic icon, e.g. when used in the list eval, dynamic icon is not evaluated for lines
*/
getIcon(firstPart?: string, secondPart?: string): string 

/** Check option in the attribute of multi-select options
 * return true if option list is no defined (all values allowed) or when what obj[attrName].includes(key)
 * @param key what to search
 * @param attrName name of the field in which is searched
 * @return booelan true – key in attrName or attrName not defined
 */
inOrNull(attrName: string, key: string,): boolean 

/** Checks if attribute attrName is null or equal to to the value  */
isOrNull(attrName: string, value: iAttrVals): boolean 

/** Returns description of this object if stored in the objDesc cache or translated objet name
 * Does not evaluate object name because it has no access to the eval function!
 * @param nameOnly : boolean = false – when true, function returns only translated name of the object, not real object description
 *    when true, the second attribute is disregardfed
 * @param internal : boolean = true – when true (default) – function used the loaded data to get the object evaluation
 *    when false, function try to load the object descrption from the cache – it is probably there. 
 *    the false value is disregarded and could be used only if object is technically defined but not loaded (e.g. when created
 *    by clip)
 */
getObjDesc(nameOnly: boolean = false, internal: boolean = true): string 


}  // end of evalObjectObj