- Home [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
- Getting started
- Use cases
-
API
- Object types
- Data types
- Global constants
-
Work with apps
- ApplicationBatchDeleteBuilder
- ApplicationBatchSaveBuilder
- ApplicationBatchSaver
- ApplicationBatchUpdateBuilder
- ApplicationBatchUpdater
- ApplicationBatcher
- ApplicationFieldOperand
- BaseFieldOperand
- BaseGlobalFilters
- ComparableFieldOperand
- ContextOperand
- DirectoriesSearch
- DocflowSettings
- FieldArrayOperand
- FieldOperand
- FilesSearch
- FolderSettings
- GlobalFilters
- GlobalFiltersWithWhere
- LineApplicationFieldOperand
- MailMessageSearch
- NomenclatureRegistrationSettings
- OrganisationStructureSearch
- PhoneFieldOperand
- ProcessInstanceSearch
- ProcessInstanceTaskSearch
- RefItemFieldOperand
- RegistrationSettings
- ReminderSearch
- ReplacementSearch
- ReportSearch
- ResetSettings
- Search
- SerialData
- SerialSettings
- SignatureSettings
- StatusHistorySearch
- StringFieldOperand
- TDocTemplate
- TFolder
- TNomenclature
- TNomenclatureDirectory
- TSettings
- UpdateOperations
- UserGroupSearch
- UserSearch
- Web requests
- Access permissions
- Document flow
- Live Chats
- “Code” widget
- Signatures
- Business calendars
- Integration with IP telephony
- Integration with email marketing services
Folder located in an app
Hierarchy
Properties
Optional __deletedAt
Date and time of deletion.
id
ID of the folder.
level
Nesting level of the folder located in an app.
name
Name of the folder.
Methods
createFolder
The method creates a child folder.
In this example, we use the method to get a folder that an app item is located in and create a new folder in it.
const folder = await Context.data.item?.getFolder(); const childFolder = await folder. createFolder('name');
Parameters
name: string
Returns Promise<TFolder>
getChildren
The method returns an array of child folders.
The example below shows how to use the method to get all folders of the second nesting level. They are considered child folders of folders inside the app.
const folders = await Application.getFolders(); const allChildren: TFolder[] = []; folders.forEach(folder => { const children = await folder.getChildren(); allChildren.push(...children); });
Returns Promise<TFolder[]>
Child folders.
getParent
The method returns the parent folder.
The example shows how to get the parent folder of a folder in an app.
const folder = await Context.data.item?.getFolder(); const parentFolder = await folder.getParent();
Returns Promise<TFolder | undefined>
Parent folder or
undefined
if the folder is top-level.getPermissions
The method returns access permissions set for the folder.
Use this method if you need to add new access permissions to those that already exist. In the example, we used the method to get the current permissions to the folder and add new update permissions for the process initiator.
const folder = await Context.data.item?. getFolder(); const user = Context.data.__createdBy; if (folder) { const currPermissions = await folder.getPermissions() currPermissions. values.push(new PermissionValue(user, [PermissionType.UPDATE])) await folder.setPermissions(currPermissions); }
Returns Promise<TPermissions>
Access permissions set for the folder.
setName
The method allows you change the folder name.
Example:
const folders = await Application.getFolders(); if (folders.length !== 0) { const folder = folders[0]; await folder. setName('NEW_NAME'); }
Parameters
name: string
Returns Promise<void>
setPermissions
The method sets new access permissions for the folder.
The method completely replaces the existing access permissions with new ones. In the example, we used the method to set new permissions to a folder for the process initiator.
const folder = await Context.data. item?.getFolder(); const user = Context.data.executor; if (folder) { const permissions = new Permissions([new PermissionValue(user, [ PermissionType.DELETE, PermissionType.UPDATE])]); await folder. setPermissions(permissions); }
Parameters
permissions: TPermissions
Returns Promise<void>
Properties
Methods