{}const=>[]async()letfn</>var
Development1C

How to write extensions for 1C correctly: a complete guide for beginners

Updated 1C - everything broke? Stop suffering! Extensions will save your development. A complete guide for those who want to modify 1C in a human way, without crutches and dancing with a tambourine.

К

Kodik

Author

7 min read

🎯 What you will learn from this article:

  • Why you need extensions and how they work

  • Correct extension structure

  • Working with modules and event subscriptions

  • Typical mistakes of beginners and how to avoid them

  • Practical tips for optimization and testing

Extensions in 1C are a powerful tool that allows you to modify the configuration without changing its source code. If you are a novice 1C developer, understanding the right approach to creating extensions will save you months of headaches and rework. Let's figure out how to do it right.

🔥 100,000+ students already with us

Tired of reading theory?
Time to code!

Kodik — an app where you learn to code through practice. AI mentor, interactive lessons, real projects.

🤖 AI 24/7
🎓 Certificates
💰 Free
🚀 Start learning
Joined today

Why do you need extensions?

Imagine: you are working with a typical 1C configuration, for example, "Trade Management". The customer asks you to add a new field to the document or change the posting logic. Previously, developers simply edited the basic configuration, but when updating, all changes were lost or had to be painfully transferred manually.

Extensions solve this problem. They work as an add-on over the main configuration without touching its code. Updated the standard? The extension continues to work. Beauty!

Basic principles of working with extensions

First rule: the extension should not break the basic functionality. It sounds obvious, but many developers forget about it. Always think that your code will work on top of the existing logic.

The second important point is that extensions have limitations. You cannot delete objects from the configuration, only add new ones or modify existing ones in a certain way. This is not a bug, it's a feature — this is how the platform protects the integrity of the system.

Expansion structure

The extension is created in the configurator through the "Configuration → Configuration Extensions" menu. After creating, you will see a familiar object tree, but with an important difference - here you can only add and expand, but not delete.

A typical extension structure includes common modules for your business logic, forms for the interface, and processing for specific tasks. You can add new directories, documents, registers — everything you need to solve the problem.

Correct addition of details

Let's say you need to add the "Supplier contract number" field to the "Receipt of goods" document. In the extension, find this document and add the attribute. Important: give meaningful names with a prefix that indicates that they belong to the extension, for example, "Add_SupplierContractNumber".

Example of naming requisites:
❌ Bad: ContractNumber
✅ Good: SupplierContractNumberAdd

After adding the attribute, it must be placed on the form. Expand the document form, add a new element, and link it with the attribute. The platform will automatically merge your extended form with the base one.

Working with modules

This is where the magic begins. You can expand the object modules by adding your logic to the events. A classic example is the processing of the "OnRecord" event of a document.

The basic configuration already has a handler for this event. In the extension, you create your own handler, and the platform will execute both — first the basic one, then yours. This allows you to add checks, additional calculations, sending notifications — anything without touching the source code.

Important note: The extension sees everything from the base configuration, but the base configuration does not know about the extension. Therefore, if you need the base code to use your logic, you will have to use event subscription mechanisms.

Event subscriptions

Subscriptions are an elegant way to embed your logic into someone else's code without changing it. Create a subscription handler for an event, for example, "BeforeRecord" of the desired document, and write your code there. The system will automatically call your handler at the right time.

Subscriptions work at the platform level, so they always work — no matter where the record came from: from the form, from external processing, through the web service. This ensures that your logic will not be bypassed.

Common modules in extensions

Take reusable code to common extension modules. If you need some function in several places, do not duplicate the code, create a common module with the extension prefix.

For example, create the "Add_WorkWithContracts" module with the "GetContractData()" function. This module can be called from anywhere in your extension, and the code will remain clean and supported.

Working with forms

Form extension is a subtle art. You can add elements, change their properties, and add command handlers. But remember: the extension form is superimposed on the base, and if you create an element with the same name as in the base, you will get a conflict.

Practical advice: Use meaningful, unique element names. Instead of "Button1", call it "Add_ButtonSendToSupplier". Yes, it's longer, but in six months you'll thank yourself.

Testing extensions

Before implementation, be sure to test the extension on a copy of the production database. Check not only the new functionality, but also that nothing has broken in the base. Try disabling the extension — everything should work as before.

Pay special attention to performance. Extensions are executed after the base code, and if you add heavy queries to the record handler of a popular document, users will feel it.

Versioning and documentation

Keep a log of extension changes. When you are asked to "fix something" a year later, you will be grateful to yourself for the notes about what was done and why.

Comment on non-standard solutions directly in the code. "This is done this way because otherwise there will be a conflict with the accounting subsystem" — such a line will save hours of proceedings in the future.

Typical mistakes of beginners

Error #1: Attempt to rewrite half of the configuration in the extension. The extension should solve a specific problem, not be an alternative configuration.

The second common mistake is ignoring the platform's limitations. If the extension does not allow you to do something, then you need to look for a different approach, and not try to cheat the system with crutches.

The third mistake is the lack of error handling. Your code works on top of someone else's, and if something goes wrong, you need to handle it correctly, and not drop the whole system.

Practical advice

  • Use prefixes for all extension objects. This will prevent name conflicts and immediately show what applies to your code.

  • Do not overload the extension. It is better to create several small targeted extensions than one huge "for all occasions" one.

  • Study other people's extensions. If you are working with a typical configuration, look at what extensions other developers have made — it is a piggy bank of experience and solutions.

Performance

Remember that the extension code is added to the execution of the basic configuration. Optimize queries, avoid unnecessary loops, and cache data where possible. Every millisecond counts, especially in documents that are processed in bulk.

If your logic is not always needed, add condition checks at the very beginning of the handler. Why execute heavy code if you can immediately understand that it is not required?

Configuration update

This is the moment of truth for any extension. After updating the standard configuration, check that everything is working. The basic configuration may have changed, and your extension needs to be adapted.

Important! Before updating, always make a backup and test on a separate database. This is the alphabet, but many neglect and then restore work in emergency mode.

Safety

Don't forget about access rights. If you have added a new report or processing, configure the roles correctly. Do not give everyone access to everything — this is not only unsafe, but also creates chaos in user interfaces.


Working with 1C extensions is a skill that comes with practice. Start with simple tasks, gradually complicate them, and study the platform documentation. The main thing is to understand the philosophy of extensions: to complement, not to break.

You can explore 1C extensions and much more in Codice — our educational platform for developers. We offer structured courses, practical assignments, and support at every stage of training.

And we also have a cool Telegram channel with a friendly community where experienced developers share their experience and help beginners understand complex issues.

🎯Stop procrastinating

Liked the article?
Time to practice!

In Kodik, you don't just read — you write code immediately. Theory + practice = real skills.

Instant practice
🧠AI explains code
🏆Certificate

No registration • No card