Give us contact

Do you prefer to ask us directly?

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

or use this contacts

API for Client-Side programming

Related links


Framework Core functionality
FI - Finance Management

API – Data object

Purpose of the Client-Side API

Client-Side API is the cornerstone of the RAD (Rapid Application Development).
Client APID allows instant changes, custom-specific functionality as well as completely customised UI with the same application

Client-Side API usage

The following example presents common usage of the API - definition of a single UI-function (check new message in the mailbox

"checkNew":{
    "icon":"COreload|MMC2extMessage", 
    "command":[
      "server.this.checkUserNewMessages",   // Call server function of this object
      "window.makeChecks(windowClass=frmPrincipalDashboard,noError=Y)",   // initiate basic window function 
      "window.message",   // display user message
      "window.reload"     // reload view to show changes
    ]
},

For steps in the method orchestrate server functionality with the client-side behaviour. Almost whole AyMINE business functionality is implemented by this way.

API principal objects

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.

Each script work with none or a single object. Scripts without object defined are related with the general UI behaviour,

Mostly single object is defined – master object of the view that is processing the script. However, there is single important difference: For list and clip list view evaluation of the rights to use the list view gets master object to the obj object

Data object definition

(Definition is valid for year 2025. Developers have always actual documentation in the release.)


class DataObject  {

/** Marks that object is open readonly.
 * Set by detail when detail is open in read only 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 attribute 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 disregarded
 * @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 description 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 


}