Type aliases

ReplacementTypeEnumBase

ReplacementTypeEnumBase: Information | Reassign | Full

Substitution types

  • Information: informing
  • Reassign: task reassignment
  • Full: complete transfer of access permissions

RoleType

RoleType: "user" | "group" | "orgstruct"

Types of objects in Role type fields

  • User
  • Group
  • Org chart item

TApplication

TApplication: Data extends object ? ApplicationProjectItemRef<Data & ProjectItemData, Params, TProcesses> : Data extends object ? ApplicationProjectPlanElementItemRef<Data & ProjectPlanElementItemData, Params, TProcesses> : ApplicationItemRef<Data, Params, TProcesses>

TBoolean

TBoolean: boolean

TCategory

TCategory: CategoryItemRef<C>

Category (Folder)

Link to an app item category. For the files structure or an app’s folder hierarchy, it’s a link to a folder.

TDirectory

TDirectory: DirectoryItemRef

TFile

TFloat

TFloat: number

Number

To learn more, visit [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/ Global_Objects/Number).

TImage

TImage: ImageItemRef

TJSON

TJSON: any

Arbitrary type (JSON)

This type is used to pass or store arbitrary data in the context.

Context.data.json = {
    'my-string': 'string data', 
    'my- num': 1234, 
    'my-bool': true, 
    'my-array': [ 'string', 999, false ],  
    'my-object': { 
        // You can use a nested object here as well  
    } 
}; 

Note that if you use this type in a serializable context ( for example, in the server context of a widget), its value can only be of JSON basic data types. However, it is possible to use this type to pass arbitrary values between widgets on the client side using binding of incoming variables.

//  Widget 1 (external) 
async function  onInit() { 
    Context.data.json = { 
        onSaveCallback: async () =>  await saveFunction() // Writing the link to the function
    }; 
} 
async  function saveFunction() { 
    // Event processing logic 
} 
// Widget 2  (internal) 
async function onSaveClick() { 
    await Context.data.in_json?. onSaveCallback?.(); 
} 

TLink

TLink: string

Link (URL)

The type is used as a plain string. It is not validated.

Context.data.site_url = 'https://elma365.com/en/';

TOAuth2

TOAuth2: OAuth2Record

TRole

TRole: Role

TString

TString: string

String

To learn more, visit [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/ Global_Objects/String).

TUser

TableCellChangeDoneEvent

TableCellChangeDoneEvent: object[Exclude<keyof TableRowType, TableRowSystemKeys>] | object[Exclude<keyof TableRowType, TableRowSystemKeys>]

TableCellChangeDoneEvents

TableCellChangeDoneEvents: TableCellChangeDoneEvent<ExtractTableDataType<TableDataType>>[]

Table cell edit completion event

Represents an array of objects with the following fields:

  • currentValue — current cell value;
  • rootRowIndex — root table row index;
  • rootColumnCode — root table column code;
  • subTableRowIndex — nested table row index;
  • subTableColumnCode — nested table column code. Usage example:
    const table = Context.data.clients_table;
    for  (const event of events) { 
      // Check if changes occurred in the nested  table 
      if (event.subTableColumnCode) { 
          // Check if changes were  made in the column with the `client` code 
          if  (event.subTableColumnCode === 'client') { 
              const clientRef =  event.currentValue; // type `UserItemRef` 
              const clientApp =  await clientRef.fetch(); // type `UserItem` 
              // Change the value  of the cell in the `client_phone` column in the same nested table row  
              // based on the new value of the `client` cell 
               const rootRow = table[event.rootRowIndex]; 
              const subTable =  rootRow[event.rootColumnCode]; 
              const subTableRow = subTable [event.subTableRowIndex]; 
              subTableRow.client_phone =  clientApp.data.mobilePhone; 
              return; 
          } 
      } else {  
          // Changes occurred in the root table 
          // ... 
      } 
    }  
    Context.data.clients_table = table; 
    

TableCellChangeEvent

TableCellChangeEvent: object[Exclude<keyof TableRowType, TableRowSystemKeys>] | object[Exclude<keyof TableRowType, TableRowSystemKeys>]

TableCellChangeEvents

TableCellChangeEvents: TableCellChangeEvent<ExtractTableDataType<TableDataType>>[]

Table cell change event

Represents an array of objects with the following fields:

  • previousValue — the previous value of the cell;
  • currentValue — the current value of the cell;
  • rootRowIndex — the index of the root table row;
  • rootColumnCode — the code of the root table column;
  • subTableRowIndex — the index of the nested table row;
  • subTableColumnCode — the code of the nested table column. Usage example:
    const table =  Context.data.clients_table;
    for (const event of events) { 
      // Check  that the changes occurred in the nested table 
      if  (event.subTableColumnCode) { 
          // Check that the changes were in the  column with the code `client` 
          if  (event.subTableColumnCode === 'client') { 
              const clientRef =  event.currentValue; // type `UserItemRef` 
              const clientApp =  await clientRef.fetch(); // type `UserItem` 
              // Change the value  of the cell in the `client_phone` column in the same nested table row  
              // based on the new value of the `client` cell 
               const rootRow = table[event.rootRowIndex]; 
              const subTable =  rootRow[event.rootColumnCode]; 
              const subTableRow = subTable [event.subTableRowIndex]; 
              subTableRow.client_phone =  clientApp.data.mobilePhone; 
              continue; 
          } 
      } else {  
          // Changes occurred in the root table 
          // ... 
      } 
    }  
    Context.data.clients_table = table; 
    

TableRowDeleteEvent

TableRowDeleteEvent: object | object[keyof TableRowType]

TableRowDeleteEvents

TableRowDeleteEvents: TableRowDeleteEvent<ExtractTableDataType<TableDataType>>[]

Table row deletion event

Represents an array of objects with the following fields:

  • row — deleted row;
  • currentValue — current cell value;
  • rootRowIndex — root table row index;
  • rootColumnCode — root table column code;
  • subTableRowIndex — subtable row index. Usage example:
    for  (const event of events) {
      // Check that changes occurred in the  subtable 
      if (event.rootColumnCode) { 
          // Check that the changes  were in the column with code `products_table` 
          if  (event.rootColumnCode === 'products_table') { 
              const deletedRow  = event.row; 
              const productRef = deletedRow.product;  
              const productApp = await productRef.fetch(); 
              //  Perform additional logic based on the data from the deleted row 
               console.log(`Row with product ${productApp.data.__name} has been deleted!`);  
              continue; 
          } 
      } else { 
          // Changes occurred  in the root table 
          // ... 
      } 
    } 
    

TableRowMoveEvent

TableRowMoveEvent: object | object[keyof TableRowType]

TableRowMoveEvents

TableRowMoveEvents: TableRowMoveEvent<ExtractTableDataType<TableDataType>>[]

Table row move event

Represents an array of objects with the following fields:

  • row — the moved row;
  • oldRootRowIndex — previous index of the root table row;
  • newRootRowIndex — new index of the root table row;
  • rootColumnCode — code of the root table column;
  • oldSubTableRowIndex — previous index of the nested table row;
  • newSubTableRowIndex — new index of the nested table row. Usage example:
    const table =  Context.data.clients_table;
    for (const event of events) { 
      // Check  that changes occurred in the nested table 
      if (event.rootColumnCode) {  
          // Check that changes were in the column with the code  `products_table` 
          if (event.rootColumnCode === 'products_table') {  
              const movedRow = event.row; 
              const productRef =  movedRow.product; 
              const productApp = await productRef.fetch();  
              // Further side logic based on the data from the moved row  
              console.log (`The row with the product ${productApp.data.__name} has been moved!`);  
              continue; 
          } 
      } else { 
          // Changes occurred  in the root table 
          // ... 
      } 
    } 
    Context.data.clients_table =  table;