Hierarchy

  • DocflowApplicationItemRef

Methods

deleteRegistration

  • deleteRegistration(nomenclatureId: string): Promise<boolean>
  • The method deletes an app item’s registration.

    Example of deleting registration in all folders for an item of a Document type app:

    const item = Context.data.d1!
    const settings =  await Application.getSettings(); 
    settings.registrationSettings. nomenclatureIds.forEach(nomenclatureId => { 
         item.docflow(). deleteRegistration(nomenclatureId); 
    }) 
    

    Parameters

    • nomenclatureId: string

      Folder number.

    Returns Promise<boolean>

    Deletion result.

deleteReservation

  • deleteReservation(nomenclatureId: string): Promise<void>
  • The method cancels the reservation of a registration number in a specific folder for an item of a Document type app.

    Example of canceling the reservation of a registration number for an app item:

    const item = Context.data.d1!
    const settings = await  Application.getSettings(); 
    const nomenclatures = []; 
    for (const  nomenclatureId of settings.registrationSettings.nomenclatureIds) { 
         const nomenclature = await item.docflow().getNomenclature(nomenclatureId);  
        if (nomenclature !== undefined) { 
            nomenclatures. push(nomenclature); 
        } 
    } 
    const nomenclatureName = 'Folder name' 
    const  nomenclatureForReservation = nomenclatures.find(nom => nom.name ===  nomenclatureName); 
    if (nomenclatureForReservation !== undefined) { 
         await item.docflow().deleteReservation(nomenclatureForReservation.__id); 
    }  
    

    Parameters

    • nomenclatureId: string

      Folder number.

    Returns Promise<void>

getApprovalArchivedLists

  • getApprovalArchivedLists(): Promise<BaseList[]>
  • The method loads archived approval sheets.

    const item = await Context.data.n1;
    const approvalLists =  await item.docflow().getApprovalArchivedLists(); 
    

    Returns Promise<BaseList[]>

    Archived approval sheets.

getApprovalLists

  • getApprovalLists(): Promise<BaseList[]>
  • The method loads active approval sheets.

    const item = await Context.data.n1;
    const approvalLists =  await item.docflow().getApprovalLists(); 
    

    Returns Promise<BaseList[]>

    Active approval sheets.

getInformArchivedLists

  • getInformArchivedLists(): Promise<BaseList[]>
  • The method loads archived lists of informed users.

    const item = await Context.data.n1;
    const approvalLists =  await item.docflow().getInformArchivedLists(); 
    

    Returns Promise<BaseList[]>

    Archived lists of informed users.

getInformLists

  • The method loads active lists of informed users.

    const item = await Context.data.n1;
    const approvalLists =  await item.docflow().getInformLists(); 
    

    Returns Promise<BaseList[]>

    Active lists of informed users.

getNomenclature

  • getNomenclature(nomenclatureId: string): Promise<TNomenclature | undefined>
  • The method gets a folder by its number.

    Example of getting a folder where an item of a Document type app is registered:

    const item = Context.data.d1!
    const settings =  await Application.getSettings(); 
    const nomenclatures = []; 
    for (const  nomenclatureId of settings.registrationSettings.nomenclatureIds) { 
         const nomenclature = await item.docflow().getNomenclature(nomenclatureId);  
        if (nomenclature !== undefined) { 
            nomenclatures. push(nomenclature); 
        } 
    } 
    

    Parameters

    • nomenclatureId: string

      Folder number.

    Returns Promise<TNomenclature | undefined>

    Folder (if found).

getRegistrations

  • The method gets the list of registrations for an item of a Document type app.

    const item = Context.data.d1!
    await item.docflow(). getRegistrations(); 
    

    Returns Promise<ApplicationItemRegistration[]>

    List of an app item’s registrations.

manualRegister

  • manualRegister(nameReg: string, nomenclatureId: string): Promise<boolean>
  • The method manually registers an item of a Document type app.

    To be able to use this method, you need to enable manual registration in the folder’s settings. Example of manual registration of all app items in folders that registration is enabled in for this app:

    const  item = Context.data.d1!
    const settings = await Application.getSettings();  
    settings.registrationSettings.nomenclatureIds.forEach(nomenclatureId => {  
         item.docflow().manualRegister('Number 1', nomenclatureId); 
    }) 
    

    Parameters

    • nameReg: string

      Registration number.

    • nomenclatureId: string

      Folder number.

    Returns Promise<boolean>

    Registration result.

register

  • register(nomenclatureId: string): Promise<boolean>
  • The method automatically registers an item of a Document type app.

    The registration number will be generated automatically according to the template set in the folder’s settings. Example of automatic registration of an item in all folders available for the app:

    const item =  Context.data.d1!
    const settings = await Application.getSettings(); 
    settings .registrationSettings.nomenclatureIds.forEach(nomenclatureId => { 
         item. docflow().register(nomenclatureId); 
    }) 
    

    Parameters

    • nomenclatureId: string

      Folder number.

    Returns Promise<boolean>

    Registration result.

reserve

  • reserve(nomenclatureId: string): Promise<string>
  • The method reserves a registration number in a specific folder for an item of a Document type app.

    The folder’s number is generated automatically based on the template in the document categorization settings. Example of reserving a registration number for an app item in a specific folder:

    const item =  Context.data.d1!
    const settings = await Application.getSettings(); 
    const  nomenclatures = []; 
    for (const nomenclatureId of settings. registrationSettings.nomenclatureIds) { 
        const nomenclature = await item. docflow().getNomenclature(nomenclatureId); 
        if (nomenclature !==  undefined) { 
            nomenclatures.push(nomenclature); 
        } 
    } 
    const  nomenclatureName = 'Folder name'; 
    const nomenclatureForReservation =  nomenclatures.find(nom => nom.name === nomenclatureName); 
    if ( nomenclatureForReservation !== undefined) { 
        const reservedNumber =  await item.docflow().reserve(nomenclatureForReservation.__id); 
    } 
    

    Parameters

    • nomenclatureId: string

      Folder number.

    Returns Promise<string>

    Reserved number.

unarchiveApprovalList

  • unarchiveApprovalList(listId: string): Promise<void>
  • The method unarchives an approval sheet and makes it active.

    Example of activating all archived sheets:

    const item =  await Context.data.n1;
    const approvalLists = await item.docflow(). getApprovalArchivedLists(); 
    approvalLists.forEach(list => item.docflow(). unarchiveApprovalList(list.__id)) 
    

    Parameters

    • listId: string

      Sheet number.

    Returns Promise<void>