Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

Reset
Редакция КоммитРедакция портала
commit 41c51cb · 19 days ago

🌐 Machine-translated from Russian. Show original

In this part:

When you need an HTTP service

The HTTP service turns 1C into a REST API: the site receives balances and prices, the mobile application creates orders, and the external system sends documents. Unlike file export, data is current at the time of request.

Service creation

  1. In the configuration or extension: General → HTTP services → Add.
  2. The root URL — for example, api. The service address will be https://сервер/база/hs/api/....
  3. Add a URL template — for example, /products/{code} — and a GET method with a handler.

Handler: passing JSON

Функция ProductsGET(Запрос)
    Код = Запрос.ПараметрыURL["code"];
    Товар = Справочники.Номенклатура.НайтиПоКоду(Код);
    Если Товар.Пустая() Тогда
        Возврат ОтветJSON(404, Новый Структура("error", "Товар не найден"));
    КонецЕсли;
    Данные = Новый Структура;
    Данные.Вставить("code", Код);
    Данные.Вставить("name", Строка(Товар));
    Возврат ОтветJSON(200, Данные);
КонецФункции

Функция ОтветJSON(Код, Данные)
    Запись = Новый ЗаписьJSON;
    Запись.УстановитьСтроку();
    ЗаписатьJSON(Запись, Данные);
    Ответ = Новый HTTPСервисОтвет(Код);
    Ответ.Заголовки.Вставить("Content-Type", "application/json; charset=utf-8");
    Ответ.УстановитьТелоИзСтроки(Запись.Закрыть());
    Возврат Ответ;
КонецФункции

We accept data: POST

Read more
Comments 01 участник · 0 гостей🔒 Rate and discuss after signing up
Редакция КоммитРедакция портала
commit 58528c9 · 19 days ago

🌐 Machine-translated from Russian. Show original

In this part:

First, find what is holding you back

Do not optimize blindly. Tools:

  • Performance measurement (Configurator → Debugging → Performance measurement) — which lines of code consume time.
  • Technological log with DBPOSTGRS / DBMSSQL events and duration threshold — which DBMS requests are long.
  • Query plan in DBMS (EXPLAIN in PostgreSQL, execution plan in MS SQL) — why the query is slow.

10 rules for quick queries

Read more
Comments 01 участник · 0 гостей🔒 Rate and discuss after signing up
Редакция КоммитРедакция портала
commit 2878553 · 19 days ago

🌐 Machine-translated from Russian. Show original

In this part:

Why updates hurt

The standard configuration is updated regularly: new reporting forms, legislative changes, bug fixes. If changes were made directly, each update turns into a manual comparison and merging of hundreds of objects. The goal is to minimize changes to the standard configuration and make the update predictable.

Extensions instead of changing the default

Configuration extensions are the main tool: improvements live separately, and the standard version remains fully supported.

  • New details, forms, reports, processing, commands — in the extension.
  • Changing the behavior of the standard code — via annotations &Перед, &После, &Вместо , and &ИзменениеИКонтроль.
  • &ИзменениеИКонтроль especially useful: when updating, the platform itself will show that the default method has changed, and you will see where to check for improvements.

💡 Rule: before removing an object from support, check if you can do the same with an extension. In the vast majority of cases, you can.

If the default has already been changed

See the scale: Configuration → Support → Support Setting will show which objects have been removed from support or are being edited while retaining it.

Exit plan:

Read more
Comments 01 участник · 0 гостей🔒 Rate and discuss after signing up