push ru help
All checks were successful
Deploy Static Site / deploy (push) Successful in 6m55s

This commit is contained in:
2025-05-28 05:24:40 +04:00
parent 0113fb8289
commit 041abbbd24
4459 changed files with 121310 additions and 86248 deletions

View File

@ -1,19 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<html lang="ru">
<head>
<title>Batch actions with app items in scripts</title>
<title>Массовые действия с элементами приложений в скрипте</title>
<meta name="generator" content="Help+Manual" />
<meta name="keywords" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="In BRIX, you can add and delete items, as well as update their fields in batches using batch methods in scripts written in the TypeScript language. This allows you to reduce..." />
<meta name="description" content="В ELMA365 вы можете массово добавлять или удалять элементы, а также обновлять их поля через скрипт, используя методы на языке TypeScript. Это позволяет снизить нагрузку на..." />
<meta name="picture" content="" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Full documentation for BRIX365 platform. Low-code developer guide. User guide. Admin guide. Developer guide." />
<meta property="og:url" content="https://brix365.com/en/help" />
<meta property="og:image" content="" />
<meta property="og:title" content="Cправка по Low-code платформе ELMA365" />
<meta property="og:url" content="https://elma365.com/ru/help" />
<meta property="og:image" content="" />
<meta property="og:site_name" content="ELMA365" />
<link rel="icon" href="favicon.png" type="image/png" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
@ -23,6 +24,7 @@
<link rel="stylesheet" href="./article.css" />
<link rel="stylesheet" href="./glossary.css" />
<link rel="stylesheet" href="./theme.css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="helpman_settings.js"></script>
<script type="text/javascript" src="helpman_topicinit.js"></script>
@ -34,16 +36,16 @@
</head>
<body>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-M6ETBEC1R9"></script><script>window.dataLayer=window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date()); gtag('config', 'G-M6ETBEC1R9');</script>
<script>!function(e,t,c,n,r,a,m){e.ym=e.ym||function(){(e.ym.a=e.ym.a||[]).push(arguments)},e.ym.l=1*new Date;for(var s=0;s<document.scripts.length;s++)if(document.scripts[s].src===n)return;a=t.createElement(c),m=t.getElementsByTagName(c)[0],a.async=1,a.src=n,m.parentNode.insertBefore(a,m)}(window,document,"script","https://mc.yandex.ru/metrika/tag.js"),ym(83179930,"init",{clickmap:!0,trackLinks:!0,accurateTrackBounce:!0,webvisor:!0})</script><noscript><div><img alt=""src=https://mc.yandex.ru/watch/83179930 style=position:absolute;left:-9999px></div></noscript>
<header class="header elma-365">
<div class="container">
<a class="header__logo" href="https://brix365.com/en/help">
<img src="./logo-en.svg" alt="header logo">
<a class="header__logo" href="https://elma365.com/ru/help">
<img src="./logo.svg" alt="header logo">
</a>
<!-- <div class="hero__search-form" id="search-panel">
<form class="search-form" onsubmit="ym(83180416,'reachGoal','poisk')">
<form class="search-form" onsubmit="ym(83179930,'reachGoal','poisk')">
<label class="search-form__label">
<span id="reset-search" class="search__icon"></span>
<input class="search-form__input" type="text">
@ -63,7 +65,7 @@
</div>
<div class="header__navi">
<ul class="header__list"><li><span class="solution-select"><span class="solution-select__selected"></span><svg width="7" height="4" viewBox="0 0 7 4" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L3.5 3.5L6 1" stroke="white" stroke-linecap="round" stroke-linejoin="round"/></svg><ul class="solution-select__list"><li><a class="project-link" href="https://brix365.com/en/help/platform/get-trial.html">Platform</a></li><li><a class="project-link" href="https://brix365.com/en/help/ecm/ecm-functions.html">ECM</a></li><li><a class="project-link" href="https://brix365.com/en/help/crm/crm_overview.html">CRM</a></li><li><a class="project-link" href="https://brix365.com/en/help/service/service-functions.html">Service</a></li><li><a class="project-link" href="https://brix365.com/en/help/projects/projects-functions.html">Projects</a></li><li><a class="project-link" href="https://brix365.com/en/help/business_solutions/-elma365-store.html">Business Solutions</a></li></ul></span></li><li><a href="https://api.brix365.com/en/" target="_blank">API</a></li><li><a href="https://tssdk.brix365.com/" target="_blank">SDK</a></li></ul>
<ul class="header__list"><li><span class="solution-select"><span class="solution-select__selected"></span><svg width="7" height="4" viewBox="0 0 7 4" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L3.5 3.5L6 1" stroke="white" stroke-linecap="round" stroke-linejoin="round"/></svg><ul class="solution-select__list"><li><a class="project-link" href="https://elma365.com/ru/help/platform/get-trial.html">Платформа</a></li><li><a class="project-link" href="https://elma365.com/ru/help/ecm/ecm-functions.html">ECM</a></li><li><a class="project-link" href="https://elma365.com/ru/help/crm/crm_overview.html">CRM</a></li><li><a class="project-link" href="https://elma365.com/ru/help/service/service-functions.html">Service</a></li><li><a class="project-link" href="https://elma365.com/ru/help/projects/projects-functions.html">Проекты</a></li><li><a class="project-link" href="https://elma365.com/ru/help/business_solutions/-elma365-store.html">Бизнес-решения</a></li></ul></span></li><li><a href="https://api.elma365.com/ru/"target="_blank">API</a></li><li><a href="https://tssdk.elma365.com/"target="_blank">SDK</a></li><li><a href="https://community.elma365.com/" target="_blank">Community</a></li><li><a href="https://elma-academy.com/ru/" target="_blank">Академия</a></li><li><a href="https://elma365.com/ru/" target="_blank">Сайт ELMA365</a></li></ul>
</div>
@ -78,8 +80,8 @@
<aside class="sidebar" id="sidebar">
<div class="sidebar__header">
<a class="header__logo" href="https://brix365.com/en/help">
<img src="./logo-light-en.svg">
<a class="header__logo" href="https://elma365.com/ru/help">
<img src="./logo-light.svg">
</a>
<span class="sidebar__close elma-365-close" id="close"></span>
</div>
@ -92,15 +94,15 @@
<div class="article-inner">
<div class="content">
<header class="article__header">
<div class="article__bread" style="display:flex; gap:10px;">
<div class="article__bread" style="display:flex; gap:10px;">
<span id="subcategory" class="search-res__item-category search-res__item-category_subcategory subcategory article__badge"></span>
<div class="topic__breadcrumbs">
<p>Low-code designer &gt; <a href="360006963072.html">App</a> &gt; <a href="app-data-in-scripts.html">Manage apps in scripts</a> / Batch actions with app items in scripts</p>
<p>Low-code дизайнер &gt; <a href="360006963072.html">Приложение</a> &gt; <a href="app-data-in-scripts.html">Работа с приложением в скриптах</a> / Массовые действия с элементами приложений в скрипте</p>
</div>
</div>
<div class="topic__title"><h1 class="p_Heading1"><span class="f_Heading1">Batch actions with app items in scripts</span></h1>
<div class="topic__title"><h1 class="p_Heading1"><span class="f_Heading1">Массовые действия с элементами приложений в скрипте</span></h1>
</div>
</header>
@ -109,91 +111,92 @@
<a href="#h1-article" class="scroll-top"></a>
</div>
<!-- Placeholder for topic body. -->
<p class="p_Normal">In BRIX, you can add and delete items, as well as update their fields in batches using batch methods in <a href="type-script.html" class="topiclink">scripts</a> written in the <a href="https://www.typescriptlang.org/" target="_blank" class="weblink">TypeScript</a> language. This allows you to reduce the load on the system and the impact of set limits when you need to process a large amount of data. For example, if you have an integration set up with a third-party system, you can import a product catalog into the app from that system.</p>
<p class="p_Normal">You can set the following methods in scripts:</p>
<p class="p_Normal">В ELMA365 вы можете массово добавлять или удалять элементы, а также обновлять их поля через <a href="type-script.html" class="topiclink">скрипт</a>, используя методы на языке <a href="https://www.typescriptlang.org/" target="_blank" class="weblink">TypeScript</a>. Это позволяет снизить нагрузку на систему и уменьшить влияние установленных лимитов, когда нужно обработать большое количество данных. Например, если у вас настроена интеграция со сторонней системой, можно из неё загрузить каталог товаров в приложение.</p>
<p class="p_Normal">Вы можете задать следующие методы в скриптах:</p>
<ul style="list-style-type:disc">
<li class="p_Normal"><code><b>app.batch().save()</b></code> to add app items in batches.</li><li class="p_Normal"><code><b>app.batch().update()</b></code> to update fields of app items in batches.</li><li class="p_Normal"><code><b>app.batch().delete()</b></code> to delete app items in batches.</li></ul>
<p class="p_Normal">When writing scripts with methods for batch actions, please note the following conditions: </p>
<li class="p_Normal"><code><b>app.batch().save()</b></code> — массовое добавление элементов приложения;</li><li class="p_Normal"><code><b>app.batch().update()</b></code> — массовое обновление полей элементов приложения;</li><li class="p_Normal"><code><b>app.batch().delete()</b></code> — массовое удаление элементов приложения.</li></ul>
<p class="p_Normal">При написании скриптов с методами для массовых операций учитывайте следующие условия:</p>
<ul style="list-style-type:disc">
<li class="p_Normal">No more than 10 000 items are processed per request. This limitation applies to all the specified methods.</li><li class="p_Normal">To perform a batch action with items using a method, the user must have <a href="360007527512.html#assign" class="topiclink">permissions to import data from this app</a>.</li></ul>
<p class="p_Normal">In this article, we will look at examples of how to use methods in scripts. You can find more details in <a href="https://tssdk.brix365.com/en/latest/pages/quick-start/intro_batch.html" target="_blank" class="weblink">BRIX TS SDK</a>.</p>
<h2 class="p_Heading2"><span class="f_Heading2">Method for adding app items in batches</span></h2>
<p class="p_Normal">With <code><b>app.batch().save()</b></code>, you can process a batch of app items in a single request. </p>
<p class="p_Normal">Use this method to:</p>
<li class="p_Normal">за один запрос обрабатывается не более 10000 элементов. Это ограничение применяется ко всем указанным методам;</li><li class="p_Normal">чтобы выполнить массовое действие с элементами при помощи метода, у пользователя должны быть <a href="360007527512.html#assign" class="topiclink">права на импорт данных этого приложения</a>.</li></ul>
<p class="p_Normal">В статье рассмотрим на примерах, как использовать методы в скриптах. Подробнее читайте в <a href="https://tssdk.elma365.com/ru/latest/pages/quick-start/intro_batch.html" target="_blank" class="weblink">справке ELMA365 TS SDK</a>.</p>
<h2 class="p_Heading2"><span class="f_Heading2">Метод массового добавления элементов</span></h2>
<p class="p_Normal">С помощью <code><b>app.batch().save()</b></code> пакет элементов приложения обрабатывается за один запрос. </p>
<p class="p_Normal">Используйте этот метод, чтобы:</p>
<ul style="list-style-type:disc">
<li class="p_Normal">Save new items to the app.</li><li class="p_Normal">Update the fields of existing items. In this case, specify their identifiers so that you can use them to find the required items, make changes to them, and save the edited items in the database.</li></ul>
<h3 class="p_Heading3"><a id="use-case-1" class="hmanchor"></a><span class="f_Heading3">Use case for adding items in batches</span></h3>
<p class="p_Normal">Lets assume that a company uses the BRIX system, and marketing employees also work with a third-party service that stores product publications and customer comments.</p>
<p class="p_Normal">You can import information from this external service to BRIX in bulk allowing employees from related departments to view all data in one place. For this:</p>
<li class="p_Normal">сохранить новые элементы в приложение;</li><li class="p_Normal">обновить поля существующих элементов. В этом случае укажите их идентификаторы, чтобы по ним найти нужные элементы, внести в них изменения и сохранить отредактированные элементы в базе данных.</li></ul>
<h3 class="p_Heading3"><a id="example-batch-save" class="hmanchor"></a><span class="f_Heading3">Пример массового добавления</span></h3>
<p class="p_Normal">Предположим, компания использует для работы систему ELMA365. Сотрудники маркетинга также применяют сторонний сервис, в котором хранятся публикации по продукту и комментарии от клиентов.</p>
<p class="p_Normal">Чтобы работники смежных отделов могли увидеть все данные в одном месте, информацию из этого внешнего сервиса можно массово перенести в ELMA365. Для этого нужно:</p>
<ol style="list-style-type:decimal">
<li value="1" class="p_Normal">Create apps for uploading publications and comments.</li><li value="2" class="p_Normal">Set up integration via <a href="extentions.html" class="topiclink">a custom module</a> and add two script buttons to the module interface:</li></ol>
<li value="1" class="p_Normal">Создать приложения для загрузки публикаций и комментариев.</li><li value="2" class="p_Normal">Настроить интеграцию через <a href="extentions.html" class="topiclink">пользовательский модуль</a> и добавить в интерфейс модуля две кнопки со скриптами:</li></ol>
<ul style="list-style-type:disc">
<li class="p_Normal"><span style="font-weight: bold;">Add Posts </span>to import all publications from a third-party service to BRIX.</li><li class="p_Normal"><span style="font-weight: bold;">Add Comments</span> to upload all comments to these publications.</li></ul>
<h3 class="p_Heading3"><span class="f_Heading3">Step 1: Create two apps</span></h3>
<p class="p_Normal">First, create <a href="360007235031.html" class="topiclink">apps</a> to import data into them. As you do so, add properties to the apps to match the fields of the publications and comments in the third-party system. Here is an example: &nbsp;</p>
<li class="p_Normal"><span style="font-weight: bold;">Добавить посты</span> — для массового переноса всех публикаций из стороннего сервиса в ELMA365;</li><li class="p_Normal"><span style="font-weight: bold;">Добавить комментарии</span> — для загрузки всех комментариев к этим публикациям.</li></ul>
<h4 class="p_Heading4"><span class="f_Heading4">Шаг 1. Создать два приложения</span></h4>
<p class="p_Normal">Для начала создайте <a href="360007235031.html" class="topiclink">приложения</a>, чтобы импортировать в них данные. При этом добавляйте свойства приложений в соответствии с полями публикаций и комментариев в сторонней системе. Рассмотрим на примере:</p>
<ol style="list-style-type:decimal">
<li value="1" class="p_Normal"><span style="font-weight: bold;">Посты</span> — содержит свойства:</li></ol>
<ul style="list-style-type:disc">
<li class="p_Normal"><span style="font-weight: bold;">Posts</span>. Contains the following properties:</li></ul>
<ul style="list-style-type:disc"><ul style="list-style-type:disc">
<li style="line-height: 1.20;"><span style="font-weight: bold;">Name</span> (<code><b>__name</b></code>). A system property, created automatically in BRIX.</li><li style="line-height: 1.20;"><span style="font-weight: bold;">Number</span> (<code><b>postID</b></code>). <a href="360009707032.html#number" class="topiclink">The Number (integer) type</a> for the identification number, by which the external system determines the link between the publication and its comments, i.e. the values of this field are equal in related items.</li><li style="line-height: 1.20;"><span style="font-weight: bold;">Creation date</span> (<code><b>__createdAt</b></code>). <a href="360009707032.html#date-time" class="topiclink">The Date/Time type</a> to store the date of post creation.</li><li style="line-height: 1.20;"><span style="font-weight: bold;">Title</span> (<code><b>title</b></code>). <a href="360009707032.html#string" class="topiclink">The String (string) type</a> for the title of the publication.</li><li style="line-height: 1.20;"><span style="font-weight: bold;">Text</span> (<code><b>body</b></code>). The <span style="font-weight: bold;">String (text)</span> type for the text of the publication.</li><li style="line-height: 1.20;"><span style="font-weight: bold;">Comments </span><code><b>comments</b></code>. <a href="360009707032.html#app" class="topiclink">The App (one) type</a> for a link to a related comment.</li></ul></li></ul>
<li class="p_Normal"><span style="font-weight: bold;">Название</span> (<code><b>__name</b></code>) — системное свойство, создаётся автоматически;</li><li class="p_Normal"><span style="font-weight: bold;">Номер</span> (<code><b>postID</b></code>) — тип <a href="360009707032.html#number" class="topiclink">Число (целое)</a> для идентификационного номера, по которому во внешней системе определяется связь между публикацией и комментариями к ней, т. е. значения этого поля равны в связанных элементах;</li><li class="p_Normal"><span style="font-weight: bold;">Дата создания</span> (<code><b>__createdAt</b></code>) — тип <a href="360009707032.html#date-time" class="topiclink">Дата/время</a> для хранения даты создания поста;</li><li class="p_Normal"><span style="font-weight: bold;">Заголовок</span> (<code><b>title</b></code>) — тип <a href="360009707032.html#string" class="topiclink">Строка (строка)</a> для заголовка публикации;</li><li class="p_Normal"><span style="font-weight: bold;">Текст</span> (<code><b>body</b></code>) — тип <a href="360009707032.html#string" class="topiclink">Строка (текст)</a> для текста публикации;</li><li class="p_Normal"><span style="font-weight: bold;">Комментарии</span> (<code><b>comments</b></code>) — тип <a href="360009707032.html#app" class="topiclink">Приложение (один)</a> для ссылки на связанный комментарий.</li></ul>
<ol style="list-style-type:decimal" start="2">
<li value="2" class="p_Normal"><span style="font-weight: bold;">Комментарии</span> — содержит свойства:</li></ol>
<ul style="list-style-type:disc">
<li class="p_Normal"><span style="font-weight: bold;">Comments</span>. Contains the following properties:</li></ul>
<ul style="list-style-type:disc"><ul style="list-style-type:disc">
<li style="line-height: 1.20;"><span style="font-weight: bold;">Name</span> (<code><b>__name</b></code>). A system property created automatically in BRIX.</li><li style="line-height: 1.20;"><span style="font-weight: bold;">Number</span> (<code><b>postID</b></code>). The <span style="font-weight: bold;">Number (integer)</span> type for the identification number by which the external system determines the link between the publication and its comments, i.e. the values of this field are equal in the related items.</li><li style="line-height: 1.20;"><span style="font-weight: bold;">Creation date</span> (<code><b>__createdAt</b></code>). The <span style="font-weight: bold;">Date/Time</span> type to store the date of comment creation.</li><li style="line-height: 1.20;"><span style="font-weight: bold;">User's e-mail</span> (<code><b>email</b></code>). The <span style="font-weight: bold;">Email address</span> type for the email of the user who left the comment.</li><li style="line-height: 1.20;"><span style="font-weight: bold;">Message</span> (<code><b>body</b></code>). The <span style="font-weight: bold;">String (text)</span> type for the text of the comment.</li><li style="line-height: 1.20;"><span style="font-weight: bold;">Posts </span><code><b>post</b></code><span style="font-weight: bold;">.</span> The <span style="font-weight: bold;">App (one)</span> type for the link to the linked post.</li></ul></li></ul>
<p class="p_Normal">These properties will be used in the script to define the fields where the values sent from the external service will be written. Read more about filling in the <span style="font-weight: bold;">Comments</span> and <span style="font-weight: bold;">Posts</span> fields of the <span style="font-weight: bold;">App (one)</span> type in <a href="batch-actions.html#use-case-2" class="topiclink">Use case for updating item fields in batches</a>.</p>
<h3 class="p_Heading3"><span class="f_Heading3">Step 2: Configure data loading via a script</span></h3>
<p class="p_Normal">After creating the app, configure data import from the external system.</p>
<p class="p_Normal">Here is how:</p>
<li class="p_Normal"><span style="font-weight: bold;">Название</span> (<code><b>__name</b></code>) — системное свойство, создаётся автоматически;</li><li class="p_Normal"><span style="font-weight: bold;">Номер</span> (<code><b>postID</b></code>) — тип <span style="font-weight: bold;">Число (целое)</span> для идентификационного номера, по которому во внешней системе определяется связь между публикацией и комментариями к ней, т. е. значения этого поля равны в связанных элементах;</li><li class="p_Normal"><span style="font-weight: bold;">Дата создания</span> (<code><b>__createdAt</b></code>) — тип <span style="font-weight: bold;">Дата/время</span> для хранения даты создания комментария;</li><li class="p_Normal"><span style="font-weight: bold;">Электронная почта пользователя</span> (<code><b>email</b></code>) — тип <a href="360009707032.html#email" class="topiclink">Электронная почта</a> для электронной почты пользователя, оставившего комментарий;</li><li class="p_Normal"><span style="font-weight: bold;">Сообщение</span> (<code><b>body</b></code>) — тип <span style="font-weight: bold;">Строка (текст)</span> для текста комментария;</li><li class="p_Normal"><span style="font-weight: bold;">Посты</span> (<code><b>post</b></code>) — тип <span style="font-weight: bold;">Приложение (один)</span> для ссылки на связанный пост.</li></ul>
<p class="p_Normal">С помощью этих свойств далее в скрипте определяются поля, в которые запишутся значения, переданные из внешнего сервиса. Подробнее про заполнение полей <span style="font-weight: bold;">Комментарии</span> и <span style="font-weight: bold;">Посты</span> типа <span style="font-weight: bold;">Приложение (один)</span> читайте в разделе <a href="batch-actions.html#example-batch-update" class="topiclink">«Пример массового обновления полей»</a>.</p>
<h4 class="p_Heading4"><span class="f_Heading4">Шаг 2. Настроить загрузку данных через скрипт</span></h4>
<p class="p_Normal">После создания приложений настройте импорт данных из сторонней системы.</p>
<p class="p_Normal">Для этого:</p>
<ol style="list-style-type:upper-roman">
<li value="1" class="p_Normal">In the configured integration module, go to the <a href="extention-settings.html" class="topiclink">Settings</a> tab and click <span style="font-weight: bold;">Edit Form</span>.</li><li value="2" class="p_Normal">In the interface designer that opens:</li></ol>
<li value="1" class="p_Normal">В настроенном модуле интеграции перейдите на вкладку <a href="extention-settings.html#settings" class="topiclink">Настройки</a> и нажмите кнопку <span style="font-weight: bold;">Изменить форму</span>.</li><li value="2" class="p_Normal">В открывшемся дизайнере интерфейсов:</li></ol>
<ul style="list-style-type:disc">
<li class="p_Normal">Create the <span style="font-weight: bold;">Add Posts</span> and <span style="font-weight: bold;">Add Comments</span> buttons.</li><li class="p_Normal">On the <span style="font-weight: bold;">Scripts</span> tab, write Client-side code using <code><b>app.batch().save()</b></code>. This code will import data into the app when the user clicks the <span style="font-weight: bold;">Add Posts</span> or <span style="font-weight: bold;">Add Comments</span> buttons.</li></ul>
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A1')">Code example</a></p>
<div id="TOGGLE0186A1" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; line-height: 1.80; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
<li class="p_Normal">создайте кнопки <span style="font-weight: bold;">Добавить посты</span> и <span style="font-weight: bold;">Добавить комментарии</span>;</li><li class="p_Normal">на вкладке <span style="font-weight: bold;">Скрипты</span> на стороне клиента пропишите код, используя <code><b>app.batch().save()</b></code>. Этот код позволит импортировать данные в приложения, когда пользователь нажмёт кнопку <span style="font-weight: bold;">Добавить посты</span> или <span style="font-weight: bold;">Добавить комментарии</span>.</li></ul>
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A1')">Пример кода</a></p>
<div id="TOGGLE0186A1" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
<tr>
<td style="vertical-align:top; padding:0; border:none"><p class="p_CodeExample" style="white-space: normal; page-break-inside: avoid;"><span class="f_CodeExample">/* Client scripts module */</span><br />
<td style="vertical-align:top; padding:0; border:none"><p class="p_CodeExample" style="white-space: normal; page-break-inside: avoid;"><span class="f_CodeExample">&nbsp;</span><br />
<span class="f_CodeExample">/* Client scripts module */</span><br />
<span class="f_CodeExample">declare const console: any;</span><br />
<span class="f_CodeExample">/*</span><br />
<span class="f_CodeExample">//Asynchronous function to import comments from the external service</span><br />
<span class="f_CodeExample">// Асинхронная функция, чтобы импортировать комментарии из внешнего сервиса</span><br />
<span class="f_CodeExample">async function import_comments(): Promise&lt;void&gt; {</span><br />
<span class="f_CodeExample">//Request the external service to get comments</span><br />
<span class="f_CodeExample">// Выполняем запрос к внешнему сервису для получения комментариев</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;const result = await fetch('https://externalservicewebsite.com/comments');</span><br />
<span class="f_CodeExample">//Convert the response to JSON format</span><br />
<span class="f_CodeExample">// Преобразуем ответ в формат JSON</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;const comments = await result.json();</span><br />
<span class="f_CodeExample">//Initialize an array for storing comment items</span><br />
<span class="f_CodeExample">// Инициализируем массив для хранения элементов комментариев</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;const items: any = [];</span><br />
<span class="f_CodeExample">//Check each comment in the received list</span><br />
<span class="f_CodeExample">// Проходимся по каждому комментарию в полученном списке</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;for (let c of comments) {</span><br />
<span class="f_CodeExample">//Create a new comment item in the app</span><br />
<span class="f_CodeExample">// Создаём новый элемент комментария в приложении</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;const item = Context.fields.commentapp.app.create();</span><br />
<span class="f_CodeExample">//Fill in the fields of the comment item</span><br />
<span class="f_CodeExample">// Заполняем поля элемента комментария</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;item.data.__name = c.name;</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;item.data.email = [{ { type: EmailType.Home, email: c.email }];</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;item.data.email = [{ type: EmailType.Home, email: c.email }];</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;item.data.body = c.body;</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;item.data.postID = c.postId; </span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;items.push(item);</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;}</span><br />
<span class="f_CodeExample">//Save all created comment items in a batch</span><br />
<span class="f_CodeExample">// Пакетно сохраняем все созданные элементы комментариев</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;await Context.fields.commentapp.app.batch().save().items(items).all();</span><br />
<span class="f_CodeExample">}</span><br />
<span class="f_CodeExample">//Asynchronous function to import posts from the external service</span><br />
<span class="f_CodeExample">// Асинхронная функция, чтобы импортировать посты из внешнего сервиса</span><br />
<span class="f_CodeExample">async function import_posts(): Promise&lt;void&gt; {</span><br />
<span class="f_CodeExample">//Request the external service to get posts</span><br />
<span class="f_CodeExample">// Выполняем запрос к внешнему сервису для получения постов</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;const result = await fetch('https:// externalservicewebsite.com/posts');</span><br />
<span class="f_CodeExample">//Convert the response into JSON format</span><br />
<span class="f_CodeExample">// Преобразуем ответ в формат JSON</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;const posts = await result.json();</span><br />
<span class="f_CodeExample">//Initialize an array for storing post items</span><br />
<span class="f_CodeExample">// Инициализируем массив для хранения элементов постов</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;const items: any = [];</span><br />
<span class="f_CodeExample">//Check each post in the received list</span><br />
<span class="f_CodeExample">// Проходимся по каждому посту в полученном списке</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;for (let p of posts) {</span><br />
<span class="f_CodeExample">//Create a new post item in the app</span><br />
<span class="f_CodeExample">// Создаём новый элемент поста в приложении</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;const item = Context.fields.postsapp.app.create();</span><br />
<span class="f_CodeExample">//Fill in the fields of the post item</span><br />
<span class="f_CodeExample">// Заполняем поля элемента поста</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;item.data.__name = p.title;</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;item.data.body = p.body; </span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;item.data.postID = p.id;</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;items.push(item);</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;}</span><br />
<span class="f_CodeExample">//Batch save all created post items</span><br />
<span class="f_CodeExample">// Пакетно сохраняем все созданные элементы постов</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;await Context.fields.postsapp.app.batch().save().items(items).all();</span><br />
<span class="f_CodeExample">}</span></p>
</td>
@ -201,30 +204,31 @@
</table>
</div>
<ol style="list-style-type:upper-roman" start="3">
<li value="3" class="p_Normal">Save and publish the changes.</li></ol>
<p class="p_Normal">The buttons will then appear in the <a href="extention-settings.html#settings" class="topiclink">settings</a> of the integration module. The user can now click them to add new items to the <span style="font-weight: bold;">Posts</span> and <span style="font-weight: bold;">Comments</span> apps.</p>
<h2 class="p_Heading2"><span class="f_Heading2">Method for updating item fields in batches</span></h2>
<p class="p_Normal">To update multiple item fields in a single request, use the <code><b>app.batch().update()</b></code> method in the script. This allows you to:</p>
<li value="3" class="p_Normal">Сохраните и опубликуйте изменения.</li></ol>
<p class="p_Normal">После этого кнопки отобразятся в <a href="extention-settings.html#settings" class="topiclink">настройках модуля</a> интеграции. Теперь пользователь может использовать их, чтобы добавить новые элементы в приложения <span style="font-weight: bold;">Посты</span> и <span style="font-weight: bold;">Комментарии</span>.</p>
<h2 class="p_Heading2"><span class="f_Heading2">Метод массового обновления полей элементов</span></h2>
<p class="p_Normal">Чтобы обновить множество полей элементов за один запрос, используйте в скрипте метод <code><b>app.batch().update()</b></code>. При этом вы можете:</p>
<ul style="list-style-type:disc">
<li class="p_Normal">Specify the rules for such an update.</li><li class="p_Normal">Define search criteria for items to be updated.</li><li class="p_Normal">Limit the number of items to be updated.</li></ul>
<h3 class="p_Heading3"><a id="use-case-2" class="hmanchor"></a><span class="f_Heading3">Use case for updating fields in batches</span></h3>
<p class="p_Normal">In <a href="batch-actions.html#use-case-1" class="topiclink">Use case for adding items in batches</a>, we transferred data from the external system to the <span style="font-weight: bold;">Posts</span> and <span style="font-weight: bold;">Comments</span> apps using the <code><b>app.batch().save()</b></code> method in the script. However, the <span style="font-weight: bold;">Posts</span> field in comment pages and <span style="font-weight: bold;">Comments</span> field in post pages are still empty. The links for these fields are not transferred from the external system, but are created in BRIX. </p>
<p class="p_Normal">Let's fill these empty fields with links to related items so that employees can quickly find the necessary information when working in these apps. </p>
<p class="p_Normal">To do this, we will use the <code><b>app.batch().update()</b></code> method to update the fields in bulk. &nbsp;</p>
<p class="p_Normal">In the third-party system, the link between publications and comments is defined through the <span style="font-weight: bold;">Number</span> (<code><b>postID</b></code>) field. The value in this field is the same in all the linked items. We will use this property in the script to find the required publications and add links in the <span style="font-weight: bold;">Posts</span> field to comment pages.</p>
<p class="p_Normal">To do this:</p>
<li class="p_Normal">указать правила такого обновления;</li><li class="p_Normal">определить критерии поиска элементов, которые нужно обновить;</li><li class="p_Normal">ограничить количество обновляемых элементов.</li></ul>
<h3 class="p_Heading3"><a id="example-batch-update" class="hmanchor"></a><span class="f_Heading3">Пример массового обновления полей</span></h3>
<p class="p_Normal">В <a href="batch-actions.html#example-batch-save" class="topiclink">примере массового добавления элементов</a> мы перенесли из сторонней системы данные в приложения <span style="font-weight: bold;">Посты</span> и <span style="font-weight: bold;">Комментарии</span>, используя в скрипте метод <code><b>app.batch().save()</b></code>. При этом поля <span style="font-weight: bold;">Посты</span> в карточках комментариев и <span style="font-weight: bold;">Комментарии</span> в карточках публикаций пока остались пустыми, т. к. ссылки на связанные элементы не передаются из внешней системы, а создаются в ELMA365.</p>
<p class="p_Normal">Чтобы сотрудники при работе в этих приложениях могли быстро находить нужную информацию, заполним эти пустые поля ссылками на связанные элементы.</p>
<p class="p_Normal">Рассмотрим, как массово обновить поля, используя метод <code><b>app.batch().update()</b></code>.</p>
<p class="p_Normal">В сторонней системе связь между публикациями и комментариями определяется через поле <span style="font-weight: bold;">Номер</span> (<code><b>postID</b></code>). Значение в нём одинаково в связанных элементах. Используем это свойство в скрипте, чтобы по нему найти нужные публикации и добавить ссылки в поле <span style="font-weight: bold;">Посты</span> на карточки комментариев.</p>
<p class="p_Normal">Для этого:</p>
<ol style="list-style-type:upper-roman">
<li value="1" class="p_Normal">In the customized integration module, go to the <a href="extention-settings.html" class="topiclink">Settings</a> tab and click <span style="font-weight: bold;">Edit Form</span>.</li><li value="2" class="p_Normal">In the interface designer that opens, add the <a href="button_widget.html" class="topiclink">Button</a> widget and name it <span style="font-weight: bold;">Update Links</span>.</li><li value="3" class="p_Normal">On the <span style="font-weight: bold;">Scripts</span> tab, write the code that will update the links between the items of the <span style="font-weight: bold;">Posts</span> and <span style="font-weight: bold;">Comments</span> apps. When the user clicks the <span style="font-weight: bold;">Update Links</span> button, the links in the <span style="font-weight: bold;">Post</span> fields will be updated in the comment pages.</li></ol>
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A2')">Sample code:</a></p>
<div id="TOGGLE0186A2" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; line-height: 1.80; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
<li value="1" class="p_Normal">В настроенном модуле интеграции перейдите на вкладку <a href="extention-settings.html#settings" class="topiclink">Настройки</a> и нажмите кнопку <span style="font-weight: bold;">Изменить форму</span>.</li><li value="2" class="p_Normal">В открывшемся дизайнере интерфейсов добавьте виджет <a href="button_widget.html" class="topiclink">Кнопка</a> с названием <span style="font-weight: bold;">Обновить поля</span>.</li><li value="3" class="p_Normal">На вкладке <span style="font-weight: bold;">Скрипты</span> пропишите код, с помощью которого пользователь обновит связи между элементами приложений <span style="font-weight: bold;">Посты</span> и <span style="font-weight: bold;">Комментарии</span>. Если нажать кнопку <span style="font-weight: bold;">Обновить поля</span>, в карточках комментариев появятся ссылки в полях <span style="font-weight: bold;">Пост</span>.</li></ol>
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A2')">Пример кода</a></p>
<div id="TOGGLE0186A2" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
<tr>
<td style="vertical-align:top; padding:0; border:none"><p class="p_CodeExample" style="white-space: normal; page-break-inside: avoid;"><span class="f_CodeExample">//Asynchronous function to update the Posts field in comments</span><br />
<span class="f_CodeExample">Async function update_comments(): Promise&lt;void&gt; {</span><br />
<span class="f_CodeExample">//Search for and retrieve posts from the Posts application</span><br />
<td style="vertical-align:top; padding:0; border:none"><p class="p_CodeExample" style="white-space: normal; page-break-inside: avoid;"><span class="f_CodeExample">&nbsp;</span><br />
<span class="f_CodeExample">// Асинхронная функция, чтобы обновить поле Посты в комментариях</span><br />
<span class="f_CodeExample">async function update_comments(): Promise&lt;void&gt; {</span><br />
<span class="f_CodeExample">// Ищем и получаем посты из приложения Посты</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;const posts = await Context.fields.postsapp.app.search().size(100).from(0).all();</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;for (let p of posts) {</span><br />
<span class="f_CodeExample">//Batch update the values in the Posts field in the comment pages by comparing the values in the Number (postID) field. If the values match, a link to the linked item is added to the Posts field.</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;await Context.fields.commentapp.app.batch().update().update().set(“post”, (f, op) =&gt; p).where((f) =&gt; f.postID.eq(p.data.postID ?? 0)).all();</span><br />
<span class="f_CodeExample">// Пакетно обновляем значения в поле Посты на карточках комментариев, сравнивая значения в поле Номер (postID). Если значения совпадают, то в поле Посты добавляется ссылка на связанный элемент</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;await Context.fields.commentapp.app.batch().update().set(&quot;post&quot;, (f, op) =&gt; p).where((f) =&gt; f.postID.eq(p.data.postID ?? 0)).all();</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;}</span><br />
<span class="f_CodeExample">}</span></p>
</td>
@ -232,35 +236,35 @@
</table>
</div>
<ol style="list-style-type:upper-roman" start="4">
<li value="4" class="p_Normal">Save and publish the changes.</li></ol>
<p class="p_Normal">After that, the <span style="font-weight: bold;">Update Links</span> button will appear in the <a href="extention-settings.html#settings" class="topiclink">settings</a> of the integration module. Now, users can click it to update the <span style="font-weight: bold;">Posts</span> field in the comment pages.</p>
<h2 class="p_Heading2"><span class="f_Heading2">Method for deleting items in batches</span></h2>
<p class="p_Normal">You can use the <code><b>app.batch().delete()</b></code> method in the script to delete many app items in a single request. In doing so, you can:</p>
<li value="4" class="p_Normal">Сохраните и опубликуйте изменения.</li></ol>
<p class="p_Normal">После этого кнопка <span style="font-weight: bold;">Обновить поля</span> отобразится в <a href="extention-settings.html" class="topiclink">настройках модуля</a> интеграции. Теперь пользователь может использовать её, чтобы обновить поле <span style="font-weight: bold;">Посты</span> в карточках комментариев.</p>
<h2 class="p_Heading2"><span class="f_Heading2">Метод массового удаления элементов</span></h2>
<p class="p_Normal">Вы можете удалить множество элементов приложения за один запрос, используя в скрипте метод <code><b>app.batch().delete()</b></code>. При этом можно:</p>
<ul style="list-style-type:disc">
<li class="p_Normal">Define search criteria for the items to be deleted.</li><li class="p_Normal">Specify the number of items to be deleted.</li></ul>
<h3 class="p_Heading3"><span class="f_Heading3">Use case for deleting items in batches</span> </h3>
<p class="p_Normal">In the previous use cases, we used a script <a href="batch-actions.html#use-case-1" class="topiclink">to add data from a third-party system</a> to the <span style="font-weight: bold;">Posts</span> and <span style="font-weight: bold;">Comments</span> apps and <a href="batch-actions.html#use-case-2" class="topiclink">update the fields of their items</a>.</p>
<p class="p_Normal">Now let's configure batch deletion of data using a script. We will add two buttons to the page of the third-party system integration module. When clicking them, the user will be able to delete outdated items of the <span style="font-weight: bold;">Posts</span> or <span style="font-weight: bold;">Comments</span> apps, for example, records that were created before 01.01.2024.</p>
<p class="p_Normal">To do this:</p>
<li class="p_Normal">определить условия поиска элементов, которые нужно удалить;</li><li class="p_Normal">указать количество удаляемых элементов.</li></ul>
<h3 class="p_Heading3"><span class="f_Heading3">Пример массового удаления элементов</span> </h3>
<p class="p_Normal">В предыдущих примерах с помощью скриптов мы <a href="batch-actions.html#example-batch-save" class="topiclink">добавили данные из сторонней системы</a> в приложения <span style="font-weight: bold;">Посты</span> и <span style="font-weight: bold;">Комментарии</span> и <a href="batch-actions.html#example-batch-update" class="topiclink">обновили поля их элементов</a>.</p>
<p class="p_Normal">Теперь настроим массовое удаление данных с помощью скрипта. Добавим на страницу модуля интеграции со сторонней системой две кнопки. При нажатии на них пользователь сможет удалить устаревшие элементы приложений <span style="font-weight: bold;">Посты</span> или <span style="font-weight: bold;">Коментарии</span>, например, записи, которые созданы до 01.01.2024 г.</p>
<p class="p_Normal">Для этого:</p>
<ol style="list-style-type:upper-roman">
<li value="1" class="p_Normal">In the integration module of the third-party system, go to the <span style="font-weight: bold;">Settings</span> tab and click the <span style="font-weight: bold;">Edit Form</span> button.</li><li value="2" class="p_Normal">In the interface designer that opens, add the <span style="font-weight: bold;">Button</span> widget, set the <span style="font-weight: bold;">Delete Posts</span> name and the <span style="font-weight: bold;">Script</span> type.</li><li value="3" class="p_Normal">Bind a batch deletion script to this button. Specify in it the criterion of searching for items and the number of records to be deleted in one request. When the script is executed, the number of such requests is determined automatically. In the use case, we will delete items created before 01.01.2024 in batches of 100 pieces.<br />
To do this, specify the <code><b>delete_posts</b></code> function name in the button settings on the <span style="font-weight: bold;">Main</span> tab in the <span style="font-weight: bold;">Executed script</span> field. Then click <span style="font-weight: bold;">Save</span> and <span style="font-weight: bold;">Open</span>.</li><li value="4" class="p_Normal">On the <span style="font-weight: bold;">Scripts</span> tab that opens, add the following script:</li></ol>
<p class="p_CodeExample" style="white-space: normal; page-break-inside: avoid;"><span class="f_CodeExample">// Asynchronous function to delete all items from the Posts app</span><br />
<li value="1" class="p_Normal">В модуле интеграции со сторонней системой перейдите на вкладку <span style="font-weight: bold;">Настройки</span> и нажмите кнопку <span style="font-weight: bold;">Изменить форму</span>.</li><li value="2" class="p_Normal">В открывшемся дизайнере интерфейсов добавьте виджет <span style="font-weight: bold;">Кнопка</span>, задайте название <span style="font-weight: bold;">Удалить посты</span> и тип <span style="font-weight: bold;">Скрипт</span>.</li><li value="3" class="p_Normal">К этой кнопке привяжите скрипт массового удаления. Укажите в нём условие поиска элементов и количество записей, удаляемых за один запрос. В процессе выполнения скрипта количество таких запросов определяется автоматически. В примере будем удалять элементы, созданные до 01.01.2024 г., по 100 штук.<br />
Для этого в настройках кнопки на вкладке <span style="font-weight: bold;">Основные</span> в поле <span style="font-weight: bold;">Выполняемый скрипт</span> укажите название функции <code><b>delete_posts</b></code>. Затем нажмите <span style="font-weight: bold;">Сохранить</span> и <span style="font-weight: bold;">Открыть</span>.</li><li value="4" class="p_Normal">На открывшейся вкладке <span style="font-weight: bold;">Скрипты</span> добавьте следующий скрипт:</li></ol>
<p class="p_CodeExample" style="white-space: normal; page-break-inside: avoid;"><span class="f_CodeExample">// Асинхронная функция, чтобы удалить все элементы из приложения Посты</span><br />
<span class="f_CodeExample">async function delete_posts(): Promise&lt;void&gt; {</span><br />
<span class="f_CodeExample">// specify a variable to track the number of items deleted </span><br />
<span class="f_CodeExample">// указываем переменную, чтобы отследить количество удалённых элементов </span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;let rows = 0;</span><br />
<span class="f_CodeExample">// use a loop to delete all items</span><br />
<span class="f_CodeExample">// используем цикл для удаления всех элементов</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;do {</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp; &nbsp; &nbsp;rows = await </span><br />
<span class="f_CodeExample">// Add a method for mass deletion of items in the Posts app and specify the criterion for selecting items and the number of records in one deletion request. &nbsp; </span><br />
<span class="f_CodeExample">Context.fields.postsapp.app.batch().delete().delete().where((f) =&gt; f.__createdAt.lt(new Datetime('2024-01-01'))).size(100).from(0).all();</span><br />
<span class="f_CodeExample">// Добавляем метод для массового удаления элементов в приложении Посты и указываем критерий отбора элементов, а также количество записей в одном запросе на удаление &nbsp; </span><br />
<span class="f_CodeExample">Context.fields.postsapp.app.batch().delete().where((f) =&gt; f.__createdAt.lt(new Datetime('2024-01-01'))).size(100).from(0).all();</span><br />
<span class="f_CodeExample"> &nbsp; &nbsp;} </span><br />
<span class="f_CodeExample">while (rows &gt; 0) &nbsp; &nbsp;</span><br />
<span class="f_CodeExample">}</span></p>
<ol style="list-style-type:upper-roman" start="5">
<li value="5" class="p_Normal">Now, we need to create another button to delete entries in the <span style="font-weight: bold;">Comments</span> app in a similar way. We will delete items according to the same criteria: depending on their creation date, 100 pieces at a time.<br />
To do this, add the <span style="font-weight: bold;">Button</span> widget on the <span style="font-weight: bold;">Template</span> tab. &nbsp;Perform the same settings as for the <span style="font-weight: bold;">Delete Posts</span> button. When writing the script, use the code of the <span style="font-weight: bold;">Comments</span> app variable.</li><li value="6" class="p_Normal">Save and publish the updates.</li></ol>
<p class="p_Normal">Now, the module settings will display buttons for deleting items from the <span style="font-weight: bold;">Posts</span> and <span style="font-weight: bold;">Comments</span> apps depending on their creation date.</p>
<li value="5" class="p_Normal">Теперь аналогичным образом нужно создать ещё одну кнопку для удаления записей в приложении <span style="font-weight: bold;">Комментарии</span>. Удалять элементы будем по тем же условиям — в зависимости от их даты создания, по 100 штук.<br />
Для этого на вкладке <span style="font-weight: bold;">Шаблон</span> добавьте виджет <span style="font-weight: bold;">Кнопка</span>. Выполните такие же настройки как для кнопки <span style="font-weight: bold;">Удалить посты</span>. При написании скрипта используйте код переменной приложения <span style="font-weight: bold;">Комментарии</span>.</li><li value="6" class="p_Normal">Сохраните и опубликуйте обновления.</li></ol>
<p class="p_Normal">Теперь в настройках модуля отобразятся кнопки для удаления элементов из приложений <span style="font-weight: bold;">Посты</span> и <span style="font-weight: bold;">Комментарии</span> по дате их создания.</p>
<div class="bottom-nav">
@ -277,7 +281,7 @@ To do this, add the <span style="font-weight: bold;">Button</span> widget on the
</div>
<!-- добавляет на страницу строку блок Была ли статья полезной? -->
<div class="feedback" id="feedback"><div class="feedback-help"><span><b>Was this helpful?</b></span><form action="" method="POST" class="feedback-form" id="feedback-form"><div class="feedback__popup feedback__popup-response" id="feedback__popup_thx" style="display: none;">Thanks for your feedback!</div><div class="feedback__popup" id="feedback__popup_why" style="display: none;"><div class="feedback__popup-header">Please specify why:</div><input type="radio" name="category" id="bad_recommendation" value="bad_recommendation"><label for="bad_recommendation">Recommendations did not help me</label><input type="radio" name="category" id="difficult_text" value="difficult_text"><label for="difficult_text">Article is hard to understand</label><input type="radio" name="category" id="no_answer" value="no_answer"><label for="no_answer">Didn`t answer my question</label><input type="radio" name="category" id="bad_header" value="bad_header"><label for="bad_header">Content does not match the topic</label><input type="radio" name="category" id="other_reason" value="other_reason"><label for="other_reason">Other</label></div><div class="feedback__popup" id="feedback__popup-other" style="display: none;"><div class="feedback__popup-header">How we can improve it?</div><textarea class="feedback__textarea" name="other" id=""></textarea><input type="submit" class="feedback__other-btn" value="Submit"></div><div class="feedback-form__btn-group"><input type="radio" name="useful" id="feedback__useful_yes" value="true"><label for="feedback__useful_yes"><img src="like.svg" class="small-img" alt="like"><spanclass="feedback-form__btn-group_yes-btn">Yes</spanclass="feedback-form__btn-group_yes-btn"></label><input type="radio" name="useful" id="feedback__useful_no" value="false"><label for="feedback__useful_no"><img src="dislike.svg" class="small-img" alt="dislike"><spanclass="feedback-form__btn-group_no-btn">No</spanclass="feedback-form__btn-group_no-btn"></label></div><select name="category"><option disabled="">Please specify why</option><option value="bad_recommendation" selected="">Recommendations did not help me</option><option value="difficult_text">Article is hard to understand</option><option value="no_answer">Didn`t answer my question</option><option value="bad_header">Content does not match the topic</option><option value="other_reason">Other</option></select><input type="submit"></form></div><div class="found_typo"><p style="margin: 0px; margin-top: 16px !important;"><span><b>Found a typo?</b></span> Select it and press <i>Ctrl+Enter</i> to send us feedback</p></div></div>
<div class="feedback-wrap"><div class="feedback" id="feedback"><span><b>Была ли статья полезной?</b></span><form action="" method="POST" class="feedback-form" id="feedback-form"><div class="feedback__popup feedback__popup-response" id="feedback__popup_thx">Спасибо за ваш отзыв!</div><div id="feedback-success-popup"><div class="wrap"><button type="button" class="feedback-popup-close">×</button><svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_212_2187)"><path d="M22 0.6875C10.2294 0.6875 0.6875 10.2294 0.6875 22C0.6875 33.7706 10.2294 43.3125 22 43.3125C33.7706 43.3125 43.3125 33.7706 43.3125 22C43.3125 10.2294 33.7706 0.6875 22 0.6875ZM22 40.5625C11.8023 40.5625 3.4375 32.3078 3.4375 22C3.4375 11.8024 11.6922 3.4375 22 3.4375C32.1977 3.4375 40.5625 11.6922 40.5625 22C40.5625 32.1976 32.3078 40.5625 22 40.5625ZM34.1713 16.933L18.6613 32.3186C18.257 32.7197 17.604 32.7171 17.203 32.3128L9.82283 24.873C9.42176 24.4686 9.42434 23.8157 9.82867 23.4146L10.5609 22.6884C10.9652 22.2873 11.6181 22.2899 12.0192 22.6942L17.9468 28.6697L31.9926 14.7366C32.3969 14.3356 33.0498 14.3382 33.4509 14.7425L34.1772 15.4747C34.5783 15.879 34.5757 16.532 34.1713 16.933Z" fill="#27AE60"></path></g><defs><clipPath id="clip0_212_2187"><rect width="44" height="44" fill="white"></rect></clipPath></defs></svg><p>Ваш отзыв успешно отправлен!</p><span>Спасибо за обратную связь.</span></div></div><div class="feedback__popup" id="feedback__popup_why"><button type="button" class="feedback-popup-close">×</button><div class="feedback__popup-header">Уточните, почему:</div><input type="radio" name="category" id="bad_recommendation" value="bad_recommendation"><label for="bad_recommendation">Рекомендации не помогли</label><input type="radio" name="category" id="difficult_text" value="difficult_text"><label for="difficult_text">Текст трудно понять</label><input type="radio" name="category" id="no_answer" value="no_answer"><label for="no_answer">Нет ответа на мой вопрос</label><input type="radio" name="category" id="bad_header" value="bad_header"><label for="bad_header">Содержание статьи не соответствует заголовку</label><input type="radio" name="category" id="other_reason" value="other_reason"><label for="other_reason">Другая причина</label></div><div class="feedback__popup" id="feedback__popup-other"><button type="button" class="feedback-popup-close">×</button> <div class="feedback__popup-header">Расскажите, что вам не понравилось в статье:</div><textarea class="feedback__textarea" name="other" id=""></textarea><input type="submit" class="feedback__other-btn" value="Отправить"></div><div class="feedback-form__btn-group"><input type="radio" name="useful" id="feedback__useful_yes" value="true"><label for="feedback__useful_yes"><img src="like.svg"/><span class="feedback-form__btn-group_yes-btn">Да</span></label><input type="radio" name="useful" id="feedback__useful_no" value="false"><label for="feedback__useful_no"><img src="dislike.svg"/><span class="feedback-form__btn-group_no-btn">Нет</span></label></div><select name="category"><option disabled>Выберите вариант</option><option value="bad_recommendation" selected>Рекомендации не помогли</option><option value="difficult_text">Текст трудно понять</option><option value="no_answer">Нет ответа на мой вопрос</option><option value="bad_header">Содержание статьи не соответствует заголовку</option><option value="other_reason">Другая причина</option></select><input type="submit"></form></div></div>
</section>
</div>
@ -285,7 +289,7 @@ To do this, add the <span style="font-weight: bold;">Button</span> widget on the
<input type="checkbox" />
<div class="article__arrow"></div>
<div class="table-of-contents elma365-right" id="toc2Content">
<h3 class="h3-toc">In this topic</h3>
<h3 class="h3-toc">В этой статье</h3>
<nav id="toc2"></nav>
</div>
</aside>
@ -296,30 +300,63 @@ To do this, add the <span style="font-weight: bold;">Button</span> widget on the
<div class="footer-container">
<div class="footer-mobile">
<ul class="footer-mobile__list"><li><a href="https://brix365.com/en/" target="_blank">BRIX</a></li><li><a href="https://tssdk.brix365.com/en/latest/" target="_blank">SDK</a></li><li><a href="https://api.brix365.com/en/" target="_blank">API</a></li></ul><ul class="footer-mobile__list"><li><a href="https://brix365.com/en/help/platform/get-trial.html">Platform</a></li><li><a href="https://brix365.com/en/help/ecm/ecm-functions.html">ECM</a></li><li><a href="https://brix365.com/en/help/service/service-functions.html">Service</a></li><li><a href="https://brix365.com/en/help/projects/projects-functions.html">Projects</a></li></ul>
<ul class="footer-mobile__list"><li><a href="https://api.elma365.com/ru/" target="_blank">API</a></li><li><a href="https://tssdk.elma365.com/" target="_blank">TS SDK</a></li><li><a href="https://community.elma365.com/" target="_blank">Community</a></li><li><a href="https://elma-academy.com/ru/elma365" target="_blank">Академия</a></li></ul><ul class="footer-mobile__list"><li><a href="https://elma365.com/ru/help/platform/get-trial.html">Платформа</a></li><li><a href="https://elma365.com/ru/help/ecm/ecm-functions.html">ECM</a></li><li><a href="https://elma365.com/ru/help/service/service-functions.html">Service</a></li><li><a href="https://elma365.com/ru/help/projects/projects-functions.html">Проекты</a></li></ul>
</div>
<div class="footer-wrap">
<div><span class="mobile-question-popup">Send feedback</span><form method="POST" action class="question__popup question-xs" id="question__popup"><div class="question-wrap"><span class="close"></span><span class="title">Ask a question</span><label for="help_question" style="display: none;"></label><textarea name="help_question" id="help_question"></textarea><input type="submit" value="Send"></div></form><div class="hidden fade-in question-success-xs">Sent</div></div>
<div class="footer-flex-b">
<span class="footer-copy">&copy; 2025 BRIX</span>
<ul class="footer-list">
<li class="footer-item">
<a href="#" class="arrow-top" style="display: block;"></a>
</li>
</ul>
<div class="container">
<div class="footer-wrap">
<div><span class="mobile-question-popup">Отправить фидбэк</span><form method="POST" action class="question__popup question-xs" id="question__popup"><div class="question-wrap"><span class="close"></span><span class="title">Задать вопрос</span><label for="help_question" style="display: none;"></label><textarea name="help_question" id="help_question"></textarea><input type="submit" value="Отправить"></div></form><div class="hidden fade-in question-success-xs">Ваш фидбэк отправлен.</div></div>
<div class="footer-flex-b">
<div class="footer-top">
<span class="footer-copy">&copy; 2025
ELMA365
</span>
<a href="https://navigator.sk.ru/orn/1122971" target="_blank">
<img src="sk-resident.svg" alt="sk icon" class="footer-img" width="117" height="34">
</a>
</div>
<div class="footer-line">
<div class="footer-line-copy">
<span class="footer-copy">&copy; 2025
ELMA365
</span>
</div>
<ul class="footer-list">
<li class="footer-item"><a href="https://elma365.com/ru/" target="_blank" class="footer-link" style="color: #0D4A75;"><img src="browse.svg" alt="browse icon" class="footer-img">elma365.com</a></li><li class="footer-item"><a href="https://www.youtube.com/user/ELMABPM" target="_blank" class="footer-link"><img src="yt.svg" alt="youtube icon" class="footer-img"></a></li><li class="footer-item"><a href="https://vk.com/elma_bpm" target="_blank" class="footer-link"><img src="vk.svg" alt="vk icon" class="footer-img"></a></li><li class="footer-item"><a href="https://t.me/elmaday" target="_blank" class="footer-link"><img src="tg.svg" alt="telegram icon" class="footer-img"></a></li><li class="footer-item"><a href="https://dzen.ru/elma" target="_blank" class="footer-link"><img src="dzen.svg" alt="dzen icon" class="footer-img"></a></li>
<li class="footer-item">
<a href="https://navigator.sk.ru/orn/1122971" target="_blank">
<img src="sk-resident.svg" alt="sk icon" class="footer-img" width="117" height="34">
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<a href="#" class="arrow-top"></a>
</div>
</footer>
<!-- <script type="text/javascript" src="jquery1.min.js"></script>-->
<iframe name="hmnavigation" style="display:none!important"></iframe>
<script src="./jquery-ui.js"></script>
<!--<script src="./jquery-ui.js"></script> -->
<script src="./jquery-ui.min.js"></script>
<!--script src="//cdn.jsdelivr.net/npm/featherlight@1.7.14/release/featherlight.min.js" type="text/javascript" charset="utf-8"></script-->
<script src="./jquery.tocify.min.js"></script>
<script src="./TypoReporter.min.js"></script>