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 →

Редакция КоммитРедакция портала
commit 914dec6 · 15 days ago

Grading Interviews, Part 4: 1C Developer — Platform, Requests, Conducting, and Performance

🌐 Machine-translated from Russian. Show original

1C is one of the most in-demand areas in Kazakhstan: accounting for almost any company, from a store to a holding, is maintained in 1C. Designations: J — junior, M — middle, S — senior.

In this part:

Platform and facilities#

J. How does a reference book differ from a document?#

The directory stores conditionally constant information: nomenclature, counterparties, employees. The document records the event in time (it has a date and number) and is usually conducted — forming movements through registers: receipt of goods, sales, payroll accrual.

J. What types of registers are there and how do they differ?#

  • Information register — stores values by measurements, can be periodic (exchange rates, prices, employee positions).
  • Accumulation register — numerical indicators with receipts and expenses. The "Balances" type — for what can be counted on the date (goods in stock, settlements). The "Turnover" type — for items that have no meaning in the balance (sales, expenses).
  • Accounting register — entries according to the chart of accounts (debit, credit, subaccount).
  • Calculation register — complex periodic calculations (salary) with validity periods and recalculations.

J. What is document execution?#

The ОбработкаПроведения handler in the object module generates document movements by registers — records that change balances and rotations. During reposting, old movements are deleted and written anew. Reports are generated by registers, not by documents — faster and more accurate this way.

J. What do directives do on &Client and &Server?#

Managed form code is executed in two places. &OnClient — on the user's computer (or in a browser): working with form elements, dialogs. &OnServer — on a 1C server, database access. There is &OnServerWithContext — server call without form data transmission, easier and faster. Each server call from the client is a network request, so their number is minimized.

&НаКлиенте
Процедура ЗаполнитьЦену(Команда)
    Объект.Цена = ЦенаНоменклатуры(Объект.Номенклатура, Объект.Дата);
КонецПроцедуры

&НаСервереБезКонтекста
Функция ЦенаНоменклатуры(Номенклатура, Дата)
    Запрос = Новый Запрос(
    "ВЫБРАТЬ
    |    Цены.Цена КАК Цена
    |ИЗ
    |    РегистрСведений.ЦеныНоменклатуры.СрезПоследних(&Дата, Номенклатура = &Номенклатура) КАК Цены");
    Запрос.УстановитьПараметр("Дата", Дата);
    Запрос.УстановитьПараметр("Номенклатура", Номенклатура);
    Выборка = Запрос.Выполнить().Выбрать();
    Возврат ?(Выборка.Следующий(), Выборка.Цена, 0);
КонецФункции

J/M. File-based or client-server options — what's the difference?#

File — database in a single 1Cv8.1CD file, suitable for multiple users. Client-server — 1C server and separate DBMS (PostgreSQL or MS SQL Server): multi-user operation, scaling, normal backup via DBMS tools, background and scheduled tasks. Details — the "1C Server on Windows and Linux" series on the portal.

Requests#

J. Why is it better to pass the condition to the parameters of the virtual table rather than to WHERE?#

// Правильно: отбор внутри виртуальной таблицы — платформа считает остатки только по нужному складу
ВЫБРАТЬ
    Остатки.Номенклатура,
    Остатки.КоличествоОстаток
ИЗ
    РегистрНакопления.ТоварыНаСкладах.Остатки(&МоментВремени, Склад = &Склад) КАК Остатки

// Хуже: сначала считаются остатки по ВСЕМ складам, потом фильтр
ВЫБРАТЬ
    Остатки.Номенклатура,
    Остатки.КоличествоОстаток
ИЗ
    РегистрНакопления.ТоварыНаСкладах.Остатки(&МоментВремени) КАК Остатки
ГДЕ
    Остатки.Склад = &Склад

Virtual tables (Остатки, Обороты, ОстаткиИОбороты, СрезПоследних) collect results from physical totals and motion tables, and the parameter condition is applied at the collection stage.

J/M. Why can't you make a query in the loop?#

Each query is a DBMS access. If you run a query in a cycle of 1000 rows of the tabular part, you get 1000 queries instead of one. Correct — one query across all rows: pass the table or array with a parameter, merge, and get everything at once.

Запрос = Новый Запрос(
"ВЫБРАТЬ
|    Товары.Номенклатура КАК Номенклатура,
|    Товары.Количество КАК Количество
|ПОМЕСТИТЬ ВТ_Товары
|ИЗ
|    &Товары КАК Товары
|;
|ВЫБРАТЬ
|    ВТ.Номенклатура,
|    ВТ.Количество,
|    ЕСТЬNULL(Остатки.КоличествоОстаток, 0) КАК Остаток
|ИЗ
|    ВТ_Товары КАК ВТ
|        ЛЕВОЕ СОЕДИНЕНИЕ РегистрНакопления.ТоварыНаСкладах.Остатки(
|                ,
|                Склад = &Склад
|                    И Номенклатура В (ВЫБРАТЬ ВТ_Товары.Номенклатура ИЗ ВТ_Товары)) КАК Остатки
|        ПО ВТ.Номенклатура = Остатки.Номенклатура");
Запрос.УстановитьПараметр("Товары", Объект.Товары.Выгрузить(, "Номенклатура, Количество"));
Запрос.УстановитьПараметр("Склад", Объект.Склад);

Pros of the answer: temporary tables and batch queries, ЕСТЬNULL after the left join, indexing of the temporary table (ИНДЕКСИРОВАТЬ ПО) if it is large and connected to it.

M. What is reference field dereferencing and why can it be expensive?#

Point access (Документ.Контрагент.ИНН) is an implicit connection to the directory table. If the field is of composite type (can refer to several different objects), the platform connects to all possible tables. Treatment: ВЫРАЗИТЬ(Поле КАК Справочник.Контрагенты)select only the required fields, do not dereference multiple points in large queries.

Execution and blocking#

M. How should balances be properly checked during conduction?#

A modern approach (the "new methodology" for controlling balances): first record movements, then check with a request whether the balance has gone into the red, and if the balance is negative, refuse to post. Before recording movements, a managed lock is set on the required data so that two users do not sell the last product simultaneously.

Процедура ОбработкаПроведения(Отказ, РежимПроведения)

    Блокировка = Новый БлокировкаДанных;
    Элемент = Блокировка.Добавить("РегистрНакопления.ТоварыНаСкладах");
    Элемент.Режим = РежимБлокировкиДанных.Исключительный;
    Элемент.ИсточникДанных = Товары;
    Элемент.ИспользоватьИзИсточникаДанных("Номенклатура", "Номенклатура");
    Элемент.УстановитьЗначение("Склад", Склад);
    Блокировка.Заблокировать();

    Движения.ТоварыНаСкладах.Записывать = Истина;
    Для Каждого Строка Из Товары Цикл
        Движение = Движения.ТоварыНаСкладах.ДобавитьРасход();
        Движение.Период = Дата;
        Движение.Склад = Склад;
        Движение.Номенклатура = Строка.Номенклатура;
        Движение.Количество = Строка.Количество;
    КонецЦикла;
    Движения.Записать();

    // проверка: остался ли минус по товарам этого документа
    Запрос = Новый Запрос(
    "ВЫБРАТЬ
    |    Остатки.Номенклатура КАК Номенклатура,
    |    Остатки.КоличествоОстаток КАК Остаток
    |ИЗ
    |    РегистрНакопления.ТоварыНаСкладах.Остатки(
    |            ,
    |            Склад = &Склад
    |                И Номенклатура В (&Номенклатура)) КАК Остатки
    |ГДЕ
    |    Остатки.КоличествоОстаток < 0");
    Запрос.УстановитьПараметр("Склад", Склад);
    Запрос.УстановитьПараметр("Номенклатура", Товары.ВыгрузитьКолонку("Номенклатура"));
    Выборка = Запрос.Выполнить().Выбрать();
    Пока Выборка.Следующий() Цикл
        ОбщегоНазначения.СообщитьПользователю(
            СтрШаблон("Не хватает товара %1: %2", Выборка.Номенклатура, -Выборка.Остаток), , , , Отказ);
    КонецЦикла;

КонецПроцедуры

(ОбщегоНазначения.СообщитьПользователю — BSP function; in configurations without BSP, use Сообщение and Отказ = Истина.)

M. Automatic and Controlled Locking Modes — Is There a Difference?#

In automatic locking mode, the DBMS sets up the DBMS, often on large data ranges — users interfere with each other. In managed mode , the developer blocks the required data with the БлокировкаДанныхobject, while the DBMS works with softer locks. All modern standard configurations operate in managed mode.

M/S. Users complain about "Lock conflict" and timeouts. How will you figure it out?#

Expected response: enable a technology log with managed lock events (TLOCK, TTIMEOUT, TDEADLOCK), find which objects and code hold locks, and how long transactions last. Typical reasons include long transactions (requests and calls to external systems inside the execution), locking the entire register without sampling, different locking orders in different documents (deadlocks). Tools: technology log, performance measurement in the configurator, DBMS monitoring, professional tools like the Performance Management Center, if available in the company.

Development and maintenance#

M. Extensions or changes to the default configuration?#

Extensions allow you to refine the standard configuration without removing it from support: add objects, attributes, capture procedures (&Перед, &После, &ИзменениеИКонтроль, &Вместо). Updating the default configuration becomes much easier. Discontinuing support and editing "live" — when it's impossible without it, but each update turns into a comparison-merge. A good answer: "if possible — document extensions and improvements, run tests after the update."

M. Which BSP subsystems were used?#

BSP is a library of standard subsystems on which standard configurations are built. Frequently requested: additional reports and processing, printing (print forms), access control (RLS), attached files, report distribution, information security version updates, lengthy operations. More details — the series "1C: reports on DCS, BSP, and printed forms" and "1C: developer practice."

M. How are exchanges between bases organized?#

Exchange plans (change registration and nodes), conversion rules (typical — via "Data Conversion" and EnterpriseData format), transport: files, web services, HTTP services, COM. It's worth talking about the real problem: duplicates during exchange, collisions, "hanging" messages — and how you resolved them.

M/S. How to integrate 1C with an external system?#

  • 1C HTTP services — their own REST API in configuration (published on the web server).
  • HTTP Connection — calling an external API from 1C.
  • OData is the standard interface for database data.
  • Exchange via queue or intermediate base for reliability.

Important: calls to external systems are outside the posting transaction, with timeouts and error handling.

Q. How do you organize team development in 1C?#

Configuration store or EDT + Git with branches and code review, test bases, automatic checks (APK, BSL Language Server), script tests (Vanessa Automation), productivity update regulations, rollback. For lead — how to distribute tasks between typical refinement, user support, and projects.

Kazakhstani specifics#

At the interview in Kazakhstan, they will almost certainly ask about experience with local configurations and integrations:

  • Typical solutions for Kazakhstan: "1C:Accounting for Kazakhstan", "1C:Payroll and HR Management for Kazakhstan", "1C:Trade Management for Kazakhstan" and industry solutions based on them. How the Kazakhstani edition differs from the Russian one — legislation, taxes, reporting, document forms.
  • ESF IS — electronic invoices: export from 1C, statuses, error handling.
  • Working with the EDS of NUC RK and NCALayer from 1C and the web client — see the series "EDS and NCALayer for Developers."
  • Regulated reporting and its updating as legislation changes.

If you don't have that experience, honestly say and show that you understand where to look (documentation from 1C and partners, official format descriptions from government agencies).

Practical assignments#

J. Write a report on the DCS: sales by counterparties for the period with selection by warehouse and grouping by month.

M. The document has 3000 lines, posting takes a minute. Find the reason (performance measurement) and speed it up: usually it's a loop query, redundant dereference, or line-by-line recording of movements.

S. Design integration of 1C with the online store: order exchange and balances, frequency, error handling, which will happen if one party is unavailable.

About certification: 1C company exams ("1C:Professional," "1C:Specialist") are often mentioned as a plus in job postings — they are valued at interviews as proof of base, but practical questions are still asked.

Next — questions for analysts and testers: Grading interviews, part 5: analyst and QA — requirements, SQL, metrics, and test design.

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

Comments · 0

No comments yet.Sign in to comment, rate and see all comments.