Ideas.  Interesting.  Public catering.  Production.  Management.  Agriculture

Opening an individual entrepreneur: step-by-step instructions. How much does it cost to open an LLC using each of the above methods?

To prepare documents for LLC registration, you can use the free online service directly on our website. With its help, you can create a package of documents that meets all requirements for completion and legislation of the Russian Federation.

This step-by-step instruction describes in detail each stage of creating an LLC. With its help you will get the most complete understanding of the procedure state registration LLC in 2019, save your time searching for the necessary information, and also learn about free online services that will help you significantly simplify the process of preparing documents.

Registration of LLC is carried out in the tax service (IFTS) or, since 2014, in the multifunctional center (MFC). In this case, it will be possible to open an LLC only at the location (legal address) of the main office of the organization or at the home address of the founder.

1. Choose a method for registering an LLC

There are three ways to register a company with limited liability:

  • Self-registration of LLC. A relatively simple and fairly common way to create an organization on your own, especially in connection with the advent of convenient free online services.
  • Paid registration of LLC with the help of a specialized company (registrar). It is the most common way to create an organization due to the advantages described below.
  • Purchase of a ready-made LLC. Most often it is done through a specialized company that provides paid LLC registration services.

How much does it cost to open an LLC using each of the above methods?

Self-registration of LLC

Action name Action cost the total cost
Payment for securing a legal address (if the organization does not plan to rent premises or register at the place of residence) 1,000 – 20,000 rub. from 15,000 rub.
Payment for notary services for certification of signatures in the application for LLC registration (not necessary if the founders will be present at the Federal Tax Service when submitting documents) 1,000 – 2,000 rub.
Payment of the state fee for LLC registration 4,000 rub.
Application authorized capital(paid no later than 4 months from the date of registration) from 10,000 rub.
Making a seal 500 – 1,000 rub.
Opening a current account 0 – 2,000 rub.

Paid LLC registration with the help of a specialized company

Depending on the region and the services included in the price (for example, filing and receiving documents from the tax service), in addition to the costs listed above, you will have to spend from 3,000 to 12,000 rubles. Thus, the costs of paid registration LLC will be about 20,000 rubles(including payment within 4 months after registration of the minimum amount of authorized capital - 10,000 rubles).

Purchase of a ready-made LLC

Advantages and disadvantages of LLC registration methods

Registration method Advantages Flaws
Self-registration of LLC Obtaining the necessary knowledge and experience in the future.
Saving money on the services of specialized registrar companies.
The likelihood of refusal to register an LLC due to errors in the prepared package of documents. As a result, there is a loss of time and money (about 5,000 rubles) spent on paying the state fee and the notary.
Paid LLC registration with the help of a specialized company The specialized company assumes the risk of refusal to register.
Preparation, submission and receipt of documents from the tax service are possible without your participation.
Providing assistance in selecting a legal address (if necessary).
Availability of additional costs.
You will have poor understanding of LLC documents.
Purchase of a ready-made LLC Purchasing an LLC with a history that may be required to conclude a transaction or participate in a tender. The risk of buying an LLC with debts and/or a bad history.

2. Come up with an LLC name

A limited liability company can have up to six variations of its name:

  • Full/abbreviated company name in Russian.
  • Full/abbreviated company name in a foreign language.
  • Full/abbreviated company name in the languages ​​of the peoples of the Russian Federation.

The full corporate name in Russian is the only required name of the LLC. Most often, two naming options are used (for this they must be indicated in the constituent documents):

note that there are some restrictions on choosing a business name for an LLC. For example, without special permission it is prohibited to use the words “Russia”, “ Russian Federation", "Moscow", as well as other full and abbreviated names of states, constituent entities of the Russian Federation, cities, etc.

3. Find the legal address

To register an LLC, you must obtain a legal address (indicated in the constituent documents). In most cases, to obtain a legal address for an LLC, they use:

  • Rented premises. Quite expensive, but one of the most preferable methods from a legal point of view. Some landlords, for their own reasons, refuse to provide legal addresses or require the conclusion of an agreement before registering an LLC, which leads to additional costs. In addition, if you change your rental address, you will have to make changes to the constituent documents.
  • Founder's home address or general director (you don’t have to be the owner, registration is enough). This method completely eliminates the cost of a legal address. note that, although registering an LLC at a home address is not prohibited by law, some tax inspectorates may refuse registration even though judicial precedents on this issue are on the side of businessmen (check in advance so as not to waste time appealing the refusal in the future) .
  • Address purchased or rented from a specialized organization(bulk address). A relatively cheap option for obtaining a legal address, however, you need to be more careful when choosing such a company, since later you may have problems (for example, they will be refused to register an LLC if this legal address is on the tax service’s blacklist). Instead of using the services of a commercial company, a more reliable way may be to purchase an address at a territorial business support center (for example, a business incubator).

Essentially, the process of obtaining a legal address consists of preparing papers for you (by the owner of the premises, the lessor, etc.) guaranteeing its provision upon the creation of an LLC, which you will attach to the main package of documents for registering the LLC.

When renting premises or purchasing a legal address, for tax office you will have to prepare a letter of guarantee for the provision of premises. When registering an LLC at a home address, the consent of the owner in any form is required (if you are not the owner), and, depending on the tax authorities, a certificate of ownership and written consent of the residents may be additionally required.

If you are going to rent premises or purchase an address, be sure to check it for “mass availability” in a special service on the official website of the Federal Tax Service.

4. Selecting activity codes

Activity codes ( OKVED codes) are indicated in the application for registration of the LLC. OKVED – all-Russian classifier of species economic activity. Using the OKVED directory, you need to select OKVED codes that correspond to the activities of your organization. It is also advisable to indicate the codes of those types of activities that the organization may begin to engage in in the future (you will not have to engage in all of the specified types of activities or additionally pay taxes and submit reports).

In the application for registration of an LLC, only OKVED codes consisting of at least 4 digits are indicated. The first OKVED code indicated in this application will be the main activity of your organization. In fact, this code depends on:

  • Having the right to use reduced (preferential) rates when paying insurance premiums for employees (makes sense only if this type activities will generate at least 70% of income).
  • The rate of insurance contributions to the Social Insurance Fund against accidents for employees (makes sense only during the first year after registration).

note that from July 11, 2016, the new OKVED OK 029-2014 (NACE rev. 2) has been applied.

5. Choosing a tax system

Organizations have the right to apply 4 types of taxation systems:

  • OSN (general taxation system). The most complex and unfavorable taxation regime for small and medium-sized businesses (in terms of reporting and taxes). OSN is used by fairly large organizations that do not have the opportunity to apply other regimes (for example, the largest taxpayers), as well as companies that do business with counterparties interested in offsetting “input” VAT. The general taxation system involves the payment of three main taxes: VAT (0%, 10%, 20%), income tax (20%) and property tax (up to 2.2%).
  • STS (simplified taxation system). One of the most common tax regimes used by organizations. The simplified tax system is designed to reduce the tax burden on small and medium business and simplifying reporting. On the simplified tax system, only one tax is subject to payment - a single one; it replaces the three main OSNO taxes - VAT, income tax and property tax, giving the organization a choice: pay 6% on income or 15% on income reduced by the amount of expenses. In addition, LLCs using the simplified tax system have the right to reduce tax at the expense of paid insurance premiums for employees.
  • UTII ( single tax on imputed income). Can be used by organizations only in relation to certain types of activities established by law (mainly the provision of services to the public, retail and public catering). But the main difference between UTII and other taxation systems is that the tax does not depend on the income received, but is imposed (established) by the state, depending on the physical indicator of activity (number of employees, area trading floor etc.). In some cases, UTII may be more profitable than the simplified tax system, but to understand this, you need to know quite accurately the future income of your organization. LLCs on UTII can also reduce tax due to insurance premiums for employees. It is worth noting that the imputed tax will have to be paid even if you have no income or do not carry out activities at all.
  • Unified Agricultural Tax (Unified Agricultural Tax). It is the most favorable tax regime for agricultural producers. Used by agricultural producers who have a share of their income from farming economic activity is at least 70%. Organizations on the Unified Agricultural Tax are required to pay 6% on income reduced by the amount of expenses. LLCs on the Unified Agricultural Tax can be taken into account as expenses insurance premiums for the workers.

note that your organization will automatically be transferred to the OSN if you do not have time to submit an application for the application of the tax system you need within the established time frame:

  • for the simplified tax system - with other documents upon registration or within 30 days after it;
  • for UTII - within 5 days from the date of commencement of activity (namely, the beginning of activity, not registration);
  • for Unified Agricultural Tax – with other documents upon registration or within 30 days after it.

Even if you want to apply UTII, it is still advisable for you to first switch to the simplified tax system. This is due to the period of transition to UTII (see above), since during the “downtime” (i.e. until you start carrying out activities), instead of the STS, you will be able to report using the simplified tax system (which is much simpler).

You can change the taxation system once a year by submitting an application for the transition to the tax service before December 31 of the current year, and only from the beginning of the new year (with the exception of if you want to apply UTII).

Free consultation on LLC registration

6. We prepare documents for registration

Basic documents required for successful registration of an LLC (the list depends on the number of founders):

Basic documents Quantity
Application for registration of LLC (form P11001) 1 copy
The decision of the sole founder ( if 1 founder) 1 copy
Minutes of the meeting of founders ( if there are 2 or more founders) 1 copy
Agreement on the establishment of LLC ( if there are 2 or more founders) 1 copy
LLC Charter 2 copies
1 copy
Letter of guarantee for provision of legal address – when renting premises or purchasing a legal entity. addresses
Consent of the owner, certificate of ownership and consent of residents (some documents may not be required, for more details, see the article about legal address) – when registering to your home address
all in 1 copy.

Additionally, you may need the following documents:

Additional documents Quantity
Application for transition to the simplified tax system ( highly recommended, so as not to end up on the OCH by default, but after registration you will have another 30 days to submit this application) 2 copies
(in Moscow they may require 3 copies)
Notarized power of attorney for submission and/or acceptance of documents (needed if the applicant cannot independently submit or collect documents from the tax office) 2 copies

When preparing these documents yourself, it is recommended to use automated services, allowing you to prepare all basic documents for free (except letter of guarantee on the provision of legal addresses, consent of the owner, etc.), as well as an application for transition to the simplified tax system. This way you will save your time and avoid mistakes in filling out.

Notarization of documents

Notarization of basic documents is not required, with the exception of an application for registration of an LLC, although it no need to assure if everyone is present in person when submitting documents to the registration authority. Certification of documents by the tax authority is carried out for free.

7. Sign and stitch the documents

After preparation necessary documents, you need to sign them like this:

Document to be signed Who should sign and how?
Application for registration of LLC The sole founder or each founder on his own sheet (directly at the tax office or upon certification by a notary)
Sole founder's decision Sole founder
Minutes of the founders' meeting Each founder
LLC establishment agreement
LLC Charter Doesn't subscribe
Receipt of state duty for LLC registration
Letter of guarantee for provision of a legal address The owner of the apartment (when registering an LLC for a home address) or the lessor (when registering an LLC for a rented premises)
Application for transition to the simplified tax system or unified agricultural tax The only founder or founder who is instructed to carry out registration actions in the minutes of the meeting of founders

Previously, all documents of more than one sheet were stapled. Since 2013, it has become no longer necessary to flash documents for registering an LLC (letter of the Federal Tax Service dated September 25, 2013 N SA-3-14/3512). However, it is highly desirable that the prepared papers are fastened with at least a stapler, paper clips, etc. (this is especially true for the charter, since the Federal Tax Service may violate the order of the pages).

In practice some tax services they may still require the firmware of the application for registration of an LLC (when certifying the application for registration of an LLC, the notary files it independently).

8. We pay the state duty

The amount of state duty for opening an LLC in 2019 is 4,000 rubles.

The payment date in the state duty receipt must necessarily be later than the date of signing the decision of the sole founder (if there is 1 founder) or the minutes of the meeting of founders (if there are 2 or more founders). The point is that first a decision or protocol on creating an organization is always made and signed, and only then the state fee is paid.

If there is only one founder, then the state fee is paid sole founder. If there are 2 or more founders, then payment can be made by:

  • Founder designated in the protocol general meeting and an agreement on the establishment of the person responsible for registration actions (the simplest and most common option).
  • Each founder (the correct option from the point of view of the law). Each founder has his own receipt prepared, and the total amount of the state duty is divided in equal shares among all founders. Please note that if, as a result of division, the amount turned out to be in kopecks, then it must be rounded up to the whole ruble.

To generate a state duty receipt, you can use one of the following methods:

  • Fill out the receipt using a specialized service on the official website of the Federal Tax Service.
  • Fill out the receipt yourself (details can be found on the Federal Tax Service website or at the tax office that registers you).

9. We issue a power of attorney to submit and receive documents

A power of attorney to represent interests at the registration authority is required only if the applicant (founder) cannot independently submit or accept documents. The power of attorney is executed in notarial form (the form is provided by the notary).

To submit documents by a proxy, nothing other than a notarized power of attorney is required.

To receive documents by an authorized person, in addition to the power of attorney, you also need to make a small change to the application for LLC registration. Namely, on page 3 of sheet H of the required applicant, in the corresponding box there should be the number “2” (“issued to the applicant or a person acting on the basis of a power of attorney”).

10. Submit documents for registration

Every extraordinary person, endowed with the ability to make money in a different way than the majority of officially employed people, is mercilessly pressed by society. This is all because “this is not the way we do things,” “everyone works, so should you,” “you will be left without a pension, you are guaranteed a hungry old age,” etc. A way out of the situation is possible: opening an individual entrepreneur, that is, registering with the tax authority as individual entrepreneur. In this case, the work experience will begin from the date of registration, and social guarantees are provided for a comfortable old age. Ideal option for freelancers.

Opening an individual entrepreneur is also relevant for those people who already have an official place of work: status legal entity provides new business opportunities and allows you to additionally attract third-party capital from investors. There are many advantages, and for each type of activity, for each individual entrepreneur they are different.

We present you with step-by-step instructions for opening an individual entrepreneur from scratch.

Package of documents for opening an individual entrepreneur

By the way, about types of activities. The OKVED classifier contains a complete list of them, and before writing an application you will need to familiarize yourself with it and select several types “for yourself.” It’s better to choose several, with perspective for the future. This foresight will help you save money: in the future, when adding (changing) OKVED codes, you will be required to pay a state fee. The very first OKVED code you choose must correspond to the main type of activity, the rest must be additional or related. If in doubt, you can consult a specialist.

The correct choice of OKVED is not a simple formality: there are a number of types of activities for which an entrepreneur can be provided with some preferential conditions for his business activities. Therefore, it is in your interests to approach this matter with all responsibility.

The application is filled out using form P21001 (can be obtained from the tax office or downloaded on the Internet). Your personal data and pre-selected OKVED codes are entered there. If you submit your application yourself (not by mail or via confidant), then the signature does not need to be certified by a notary, although in order to avoid errors when filling out (and there can be many of them, despite the apparent simplicity of the document), it is still recommended to contact to this specialist. It will cost several hundred rubles: quite acceptable price in exchange for ensuring that the application is accepted the first time. Copies of all pages of the passport should also be certified there.

The state fee for opening an individual entrepreneur is now 800 rubles. This payment can be made at any bank branch, the main thing is not to lose the receipt. So, what does the package of documents submitted to the tax office include:

  • Application for registration of individual entrepreneurs;
  • Copies of all passport pages (including blank ones);
  • Copy of TIN (if any);
  • A receipt for payment of a contribution to the treasury, that is, state duty.

If you do not have a TIN, then at the same time you can submit an application for registration, although usually this document is done when the registration of an individual entrepreneur is already underway (within 5 days after submitting the corresponding application), or even after the completion of registration. This point can be clarified with a tax inspector.

Application for registration of individual entrepreneur

Please note: you need to submit documents to the Federal Tax Service according to your registration address, that is, taking into account the territorial affiliation of the tax office. Otherwise, your application will be rejected and you will waste time.


So, the reasons for refusal to register an individual entrepreneur:

  • The wrong body of the Federal Tax Service was chosen;
  • Documents are drawn up incorrectly;
  • Not the entire package of documents is presented;
  • One year has not yet passed from the date you were declared bankrupt (for your previous type of business activity);
  • The prohibition imposed on you from conducting entrepreneurial activity court.

In addition, for a person who has not reached the age of majority, there must be a conclusion from the court or guardianship authorities, indicating that he has reached a state of full legal capacity. Marriage by a person under 18 years of age is also considered a condition for the possibility of opening an individual entrepreneur.

In all other cases, subject to consultation with a notary regarding filling out an application for registration of an individual entrepreneur, you are guaranteed a positive answer. The deadline for registering an individual entrepreneur with the tax office is five working days. You will receive two documents: OGRNIP and Unified State Register of Individual Entrepreneurs plus TIN, if a corresponding application has been submitted. They can be delivered to you either personally or by post to your place of residence. It's better, of course, to take it securities on one's own.

Registration of individual entrepreneurs with the tax office

Next, you will need to decide on the tax system. Many individual entrepreneurs choose the simplified tax system (“simplified system”), but please note that since 2013 it has been called the patent tax system. If you plan to work closely with companies that take VAT into account in their prices, then you are better off choosing the OSN (main system). Then the income tax will not be 6%, as in the case of the simplified tax system, but 13%. Plus property tax, personal income tax, VAT and other deductions. However, if you plan to hire more than 15 employees, OSN cannot be avoided. UTII (“imputation”) is now rarely used; this issue is resolved by the municipal authorities.

If you choose the simplified tax system, and at the same time your expenses (according to estimates) will be 60% of income or more, then it makes sense to choose a tax of 5-15% rather than 6%. Then the rate will be calculated individually and multiplied not by the amount of profit, but by the difference between income and expenses. On this issue, it makes sense to consult with an economist.

When choosing a tax system other than the OSN, which is applied by default, you will need to write a corresponding application, and within a few days the procedure will be completed. You will then acquire tax reporting obligations as part of your business activity.

Registration of individual entrepreneurs in the Pension Fund of Russia and the Social Insurance Fund

After receiving the relevant documents, you will need to contact Pension Fund. The tax office will inform you about the “birth” of a new entrepreneur immediately, but you will need to come to clarify the amount of mandatory monthly insurance contributions, which will ensure your retirement future. For getting necessary details you will need copies of the following documents:

  • OGRN;
  • EGRIP;
  • SNILS;
  • Passport.

If you hire employees (become an official employer), then the Pension Fund additionally provides employment contract, employment history and SNILS (payer certificate), and in addition, you will also have to register with the Social Insurance Fund. You can register with the Social Insurance Fund (social insurance) even if you personally need vacation, maternity leave, or sick leave. In a word, registration with the Social Insurance Fund provides additional social guarantees. Contributions to both the Pension Fund and the Social Insurance Fund can be paid either every month, or you can immediately pay the amount for the entire year. Our staff will help you calculate it. The total payment is usually just over 1000 rubles.

Do I need a current account for an individual entrepreneur?

Additionally, you will have to register with Rosstat. This will also take a maximum of a few days, and at the end of the procedure you will receive a statement that you will need to present to the bank when opening a current account (s/c) for an individual entrepreneur. Settlement account is not a mandatory condition for registering an individual entrepreneur, however, if you plan to receive significant amounts from counterparties under one agreement, the law obliges you to complete this formality. Yes, and it will be more convenient for you. After opening the account, you will be connected to the client-bank service for convenient making payments (and accepting them) by bank transfer.

How much does it cost to open a sole proprietorship?

If you do everything yourself, then the cost of registering an individual entrepreneur will not exceed more than 2,000 rubles, including state fees and overhead costs (notary, photocopies, etc.). If you open a bank account, add another 800 rubles. A simple seal without a coat of arms will cost 300 rubles.

If you contact an office that will do everything for you, then opening an individual entrepreneur will cost you 5000-7000 rubles.

It is done

After all the formalities have been settled, you can safely begin to exercise your rights as an individual entrepreneur, without forgetting, however, about your responsibilities. If you choose the simplified tax system, it is quite possible to conduct tax reporting yourself, the same applies to UTII, but to work on the main system, entrepreneurs usually hire an accountant. Depending on the chosen system, the duration of the reporting period can be different: once a month, once a quarter or once a year.

Video about step-by-step registration as an individual entrepreneur:


Did the article help? Subscribe to our communities.

I believe there is no need to tell you what an access control system is, a settings compositor and, in general, the entire set of objects designed to work with an access control system. The main areas of use, not counting tricky actions in the code, are dynamic lists and reports, and in both cases, very significant functionality remains behind the scenes. We often don’t even think about the logic of the behavior and relationships of all participants in the process, because usually solve enough simple tasks or rely on platform defaults. But where there are silences, there is also an internal logic, a kind of “disservice” of 1C, the fruits of which are sometimes difficult and unobvious to overcome in order to achieve the desired effect, and at the same time it is enough just to use the tools correctly.

Those interested can skip parts 1-4 and go straight to the examples.

I’ll try to dwell in a little more detail on the operation of ACS selections for the case of their use in reports. I believe that the behavior in dynamic lists, with a number of caveats, will be similar. So, selections in reports, a little theory and then specific examples.

SP 8.3.6 and higher, sections of ITS (clause 10.3.7.5, etc.), the book “Professional development in the 1C-Enterprise 8 system” (Kazan, 2012, second volume) are used. In E. Khrustaleva’s book there was nothing intelligible on this topic at all.

Part 1

The settings builder, as you know, has collections “Settings”, “Fixed settings” (hereinafter “FN”) and “Custom settings” (hereinafter “CU”). A report can have several options, and the connections between the option, N, PN and FN are very unique. Also, let’s not forget about the source of the available settings, and its “progenitor,” which is usually the circuit itself, which also has its own default settings.

* Settings – settings created in the Configurator mode and changed in the report version editing mode;

* UserSettings – settings that the user changes in the “1C:Enterprise” mode purely through the interface;

* FixedSettings – those settings that are set from the built-in language, incl. are implicitly set by the system. This property contains selection values ​​that are transferred to the form using its parameters (the “Selection” structure).

Settings and FNs are similar in design and have a “Selection” collection of the “Data composition selection” type, available for changing the composition at any time during the report’s existence. At the same time, Settings are available for interface changes through editing a variant, but FNs are not accessible at all. PN, in turn, is a “porridge”, where equal elements can be both the “Selection” itself and individual objects of the type “Data composition selection element” (the so-called nested object). Despite the availability of appropriate methods, it is impossible to programmatically change the composition of a collection of PN elements if these are PNs of the report itself, and not made “from scratch” by the designer - 1C will report that “The collection of user settings cannot change its composition, since it is associated with the layout settings data." The ITS says: “The property is not writable using the built-in language.”, but, as we will see later, it is possible to influence the PN. The “porridge” of objects has internal connections - it is checked for consistency of conditions when generating a report, and when the composition changes. On ITS we read: “Elements that are themselves marked as custom will not be added. For example, a custom selection will not include a selection element that is marked as custom. Elements containing custom elements will not be added. For example, a condition group will not be added if the group contains elements marked as custom. For nested elements, the DisplayMode property is not analyzed. They are added or not added along with the parent elements." Thus, the “seniority” of objects operates behind the scenes. In this case, you can get an effect when the interface allows you to specify contradictory selections for a variant and its PN, as well as within the PN.

It would seem that "senior" is an option. But clicking on “More” / “Change option” and confirming changes in the opened form calls the form event handler , in this case, the selection appears in the "Basic" panel on the form called from "Settings...", and appears on the report form, but is NOT shown on the "Selection" tab; Moreover, either it appears immediately both on the main report form and on the “Settings...” form (if there is a flag “Include in user settings”), or neither there nor there. But in any case, it will NOT be on the “Selection” tab of the “Settings...” form. The difference between the "Basic" tab, the "Settings..." form and the main report form is determined by the "Edit mode" field (normal - only in "Settings", fast - also on the report form itself), but I think everyone knows this. By the way, the values ​​of “Selection” and “Fast” are not synchronized in any way and may contradict each other, but “Fast” on the report form and on the settings form are strictly synchronous. So, when you edit a variant, it itself becomes changed (but its ID and name do not change), but the PNs remain NOT modified (i.e., even if we are talking about them, i.e., about the flag for including this or that element in the PN ).

Clicking on “Select option...” and confirming changes in the form that opens triggers events in the following order:

When Uploading OptionOn Server

When Updating the Composition of User Settings on the Server

In this case, neither the option nor the PN changes in any way. From here it is clear that the option and settings, if connected, are by no means directly connected.

Clicking on "Settings..." and confirming changes in the opened form only triggers an event When Updating the Composition of User Settings on the Server(in this case, the PNs become changed, but the views and the key (if they were not there) are not received; if “Fast” is enabled for the elements of the “Selection” object of the PN, then in addition to “Selection”, its actual elements appear as fields, i.e. . behaves similarly to nested elements. These settings are saved when closing and restored the next time you enter the form. It does not touch or change the option.

Clicking on "More"/"Set standard settings" in the settings form (as well as the "Standard settings" item in the option edit) only triggers the event When Updating the Composition of User Settings on the Server. In this case, the option becomes changed, but the PN changes. If the option was changed before, it remains changed (neither the changed flag is reset, nor the actual settings are reset).

Clicking on “Properties of a custom settings element” in the structure tree on the variant editing form adds a “Selection” object, and it turns out empty and is not synchronized in any way with the existing variant selection and existing nested selection elements. The variant does not change in any way.

Hence the recommendation: if you need to set certain selections in the “Configurator” mode, so as not to tinker with the code and so that they are not in the option, but would be in the report interface, you should not manipulate the selection elements of the option, changing their properties, but the selection itself , using the “Element Properties…” and “Custom Settings” buttons.

Adding something that appears in Settings to the PN requires actions in the code or interface, but deleting and clearing Settings affects the PN immediately and without any updates, for example:

Report.SettingsLitter.Settings.Selection.Items.Clear();

Before closing the report form, the system asks only if there have been changes to the variant. If there have been changes to the PN, they will be saved automatically without any questions, and will also automatically try to be applied in the next session of working with the report.

Notes:

In case of a number of errors in the application of settings, a message about the problem is first displayed, and then the composition still occurs, the event is called and report generation. In this case, FNs, even if they existed, are still ignored, and only Settings play a role.

When adding a selection on the “Change option” form, it is done immediately with the “Include in PN” flag set, but, I repeat, from the point of view of the built-in language, PN remain unchanged.

Setting the variation of a variant and setting the variation of the PN are not directly related; these are two different directions of changes.

PN, among other things, has “Additional settings”. I have never been able to understand what and at what moment they are filled. Although the report contains settings “marked in the selection and conditional design” as custom ones (according to the joint venture), additional settings in all cases turned out to be empty. There is nothing about this on ITS.

Despite the statement in the joint venture, PNs are perfectly serialized in xml.

If both independent selection elements and the selection itself are included for use, then the report is compiled correctly, but when displayed, it duplicates the information about the established selection in the final layout.

The default form for editing a report version contains many interesting things, but nowhere does it work with FN and PN, and even with the basic settings it works more for reading (except that it clears the selection, order, conventions).

Part 2

Working with Settings and FN through their collection is almost always acceptable, but it is important to remember that the essence of the “third level” is changing. The first level always contains the default settings of the access control system itself; they also appear implicitly in the source of available settings; at the second level – settings of the option used. But here logic allows you to either “overwrite” the underlying instructions or ignore them. But working with PN no longer allows for liberties, and subtle manipulations must be done using special methods, and sometimes temporary auxiliary intermediary objects, for example:

Comp=NewDataCompositionSettingsComposer; // you can also start // comp.Initialize(SomeSettingsComposer.GetSourceofAvailableSettings()); comp.LoadSettings(SomeSettingsComposer.Settings); SomeSettingsComposer.LoadCustomSettings(comp.CustomSettings);

The settings builder has a method (), which loads the user settings values ​​passed as a parameter to the method. Method GetSettings() allows you to get a copy of the current settings (taking into account user settings). Method DownloadSettings() loads the passed settings into the settings builder (user settings are also repopulated based on the passed data, taking into account the presence of keys, see example below).

Applying custom settings to the main settings is done in the method GetSettings() settings builder. The following actions are performed:

* For DataCompositionSelectionElement types, the contents of the elements are copied to the corresponding custom settings elements.

* For Data Layout Selection types, elements located in the main settings and marked as Inaccessible remain unchanged. Elements from the PN are transferred to the main ones. They are added to the end of the collection for Selection.

* For the DataCompositionSelectionElementGroup types, the Usage property is set in the corresponding element of the main settings (based on the sign of the use of the PN element).

Part 3

When forming the final settings, to quote ITS, various settings are combined as follows:

* If any type of settings is entirely marked as custom, then the resulting settings include PN. In this case, if any settings elements are marked as unavailable, then these settings will be placed in the resulting settings from the Settings Composer.Settings property.

* If any type of settings is marked as custom not entirely, but element by element, then the elements marked as custom will be taken into the resulting settings from the Settings Composer.CustomSettings property, and the elements marked as unavailable will be taken into the resulting settings from the Settings Composer.Settings property .

* Fixed settings are added to the resulting settings "as is". In this case, the situation is unacceptable when the FN and PN have settings of the same name, for example, selection with the same left value in the condition. I note that even the complete coincidence of all the properties of these conditions is prohibited. To be honest, it's a little illogical.

I would like to note that if any fragment of the settings is subject to a functional option and should be limited, the system works “quietly” - it removes this fragment from everywhere, does not report anything, and during program manipulations regarding such a fragment, it processes “idle” errors. does not produce, but the code has no effect either. However, it is possible that different releases behave differently.

Part 4.

The report form extension provides us with the parameters “FN” and “PN”, but nowhere is it recommended to fill them out directly by passing them to the form. As experiments have shown, without additional dances with a tambourine, the content of these parameters is ignored - it is overwritten when the linker is initialized during the opening process and when previously saved PNs are received. It is recommended to work with PN keys, by which you can retrieve them from the settings store and then open and use them, and this is done automatically on the side of the report form, and not on the calling form.

The “Source of AvailableSettings” parameter is automatically translated into the builder information when the form is created on the server and cannot be overridden. Or rather, it can, but this will only have an effect after a complete redefinition of the entire chain of related objects. Wherein GetSourceAvailableSettings() will return Undefined until the end of all form opening events.

Let me note that the form parameters, which are essentially not key parameters, “stretch” their effect over several events if the formation flag is set when opening. Yes, in the event ProcessingCheckFillOnServer, called during opening and formation, the “Selection” parameter will be available, but with it, but called simply by the user clicking on the “Generate” button, it will no longer be available. This is due to the fact that all these events are processed in one “visit” to the server, if the formation when opening is enabled, and only at the very end of them control is transferred to the client and called WhenOpening. In this case, non-key parameters are naturally lost.

The general order of executing events when opening a form with a flag to generate a report upon opening (slightly more than described in “Professional Development”):

When CreatedOnServer

Before Uploading Option On Server

When Uploading OptionOn Server

Before Uploading User Settings to the Server

When Loading User Settings on the Server

When Updating the Composition of User Settings on the Server

ProcessingCheckFillOnServer

WhenOpening

In this case, neither the option nor the PN are changed unless special efforts have been made.

Part 5.

Now let's look in more detail at the task of opening a report form with its construction and pre-specified selection. Brief information about this is available on ITS and in methodological recommendations, but only the principle itself is covered there and the subtleties are not revealed. So, to contextually call a report, you need to pass the “GenerateOnOpen” parameter to its form, equal to True; and the Selection parameter containing the structure. The structure keys are the names of ACS fields or ACS parameters, and the values ​​are their values. Quoting SP, if there is an ACS parameter with a name corresponding to the name of the structure key, then the value will be set to it. If there is no parameter, but there is a field, then a selection will be added to this field. At the same time, if there is a parameter and field of the same name, then the system will simply quietly ignore it and not install anything.

“Professional development” provides an example of changing (i.e. intercepting and reconfiguring) PN “on the fly” in an event Before Uploading User Settings to the Server, where the argument containing the current PN is passed. In fact, this is not always the case - for example, there may be cases where an error in saving the PN in a previous session, or inconsistencies between Settings, FN and PN will lead to the “Settings” argument being empty. And what’s most interesting is that it will not be possible to fully reconfigure it in this event; this can only be done “at the end” of the sequence of events, namely, in the event ProcessingCheckFillOnServer.

Let's see what we have before loading the PN on the server.

For a simple case, when nothing is preset in the ACS and no elements are included in the PN, the situation is as follows: Settings – empty; FN – contain correct selection; Mon contain an empty Selection. The shaping works correctly, but from the user's point of view the interface contradicts the internals and is discouraging - the selection works, but is not visible. Similarly, if you enable Selection in PN in the option structure settings, the report is also built taking into account the selection, but the user also does not see any selections.

Let's set pre-selections (equal to empty values) in the ACS settings in the Configurator and include them in the PN. In theory, the FNs should fill out the Settings, and those should fill in the PN, but in reality we have: in the Settings - Selection with the required element, but an empty right value, the FNs contain the correct selection, and the PNs still do not contain anything. In addition, in this case the report will not be built, because the right selection value is empty, despite the value passed in the Select parameter.

An attempt to work with PN elements also does not produce results. For the PN element, you can only change the “Use” flag and participation in “Quick”. The selection value on the interface will be empty, the system will not generate any errors. Similarly, an attempt to work with PN Selection will also work; in the debugger, the right value will be visible as correctly filled in, but you will not see anything on the interface. Let me remind you that it is impossible to change the composition of the PN. Thus, additional tricks are required. For example:

&On the Server Procedure SetPresetSelections(UserSettings) If not Parameters.Property("Selection") Then Return EndIf; If Parameters.Selection.Quantity()=0 Then Return EndIf; rTypeEO=Type("DataComposition Selection Element"); For each key From Parameters.Selection Loop pField=NewDataCompositionField(key.Key); // If (ValueType(kiz.Value)=Type("Array") orValueType(kiz.Value)=Type("ValueList")) and kiz.Value.Quantity()>1 Then pViewComparison=DataCompositionComparisonType.InList; Otherwise pComparisonType=DataCompositionComparisonType.Equals; endIf; // pNecessarySelection = Undefined; // see if there is Selection in the user settings pNecessaryEO=Undefined; // see if there is a separate DataComposition Selection Element in the user settings For each elnastr From UserSettings.Elements Cycle If TypeValue(elnastr) = Type("DataComposition Selection") and pNecessarySelection=Undefined Then // there can be only one pNecessarySelection=elnastr; // this could be done outside the loop, but it is necessary to sort through the user settings for the sake of elements... Otherwise, If TypeZnch(elnastr) = pTypeEO Then // this is a selection element, there can be many of them, but we are interested in those that are not initialized or with the required field If elstr.LeftValue=pField or elstr.LeftValue=Undefined and rNeedEO=Undefined Then pNeedEO=elstr; endIf; endIf; EndCycle; // If pRequiredSelection<>Undefined Then // it goes as a priority pNecessaryEOFromSelection = Undefined; For each elotb From pNecessarySelection.Elements Cycle If elotb.LeftValue=pField Then pNecessaryEOfromSelection=eloteb; Abort EndIf; EndCycle; If pNecessary EO from Selection = Undefined Then pNecessary EO from Selection = pNecessary Selection.Elements.Add(pType of EO); pNeedEOFromSelection.LeftValue=pField; endIf; pNecessaryEOfromSelection.ComparisonType=pComparisonType; pNecessaryEOFromSelection.RightValue=kiz.Value; pNecessaryEOFromSelection.Use=True; // rNeededEO.Use=False; OtherwiseIf pNecessarySelection=Undefined and pNecessaryEO<>Undefined Then // put on the element pNecessaryEO.LeftValue=pField; pNecessaryEO.ComparisonType=pComparisonType; pNeedEO.RightValue=kiz.Value; pNeedEO.Use=True; endIf; pNeed=Undefined; For each elotb From Report.ComposerSettings.Settings.Selection.Elements Loop // in an amicable way, there should be a recursive search! If TypeValue(elotb)=pTypeEO and elotb.LeftValue=pField Then pNeed=elotb; Abort EndIf; EndCycle; If pNeed = Undefined Then pNeed = Report.Settings Composer.Settings.Selection.Elements.Add(pEOType); pNeed.LeftValue=pMargin; endIf; pNecessary.ComparisonType=pComparisonType; pNeed.RightValue=kiz.Value; pNeed.Use=True; //EndCycle; Report.Settings Composer.FixedSettings.Selection.Items.Clear(); // otherwise it will say that the elements intersect/contradict End of Procedure

The most correct way to call this is:

&On the Server Procedure Processing Filling Checks On the Server (Failure, Checked Details) Set Predefined Selections (Report. Settings Linker. User Settings); End of Procedure

Then, a context call, for example, from a directory form, will look like this:

&OnClient Procedure OpenReport(Command) If ValueFilled(Object.Link) Then ot=New Structure("LinkToDirectory",Object.Link); // this is how the field is named in the SDS report Form Parameters = New Structure ("Selection, GenerateWhen Opening", select, True); OpenForm("Report.Report1.Form.ReportForm",FormParameters,ThisForm); endIf; End of Procedure

Part 6.

If necessary, change the report settings while working with it, incl. both at startup and after opening, the most correct way is to change “from the beginning”, i.e. from the ACS settings. Changing the ACS scheme is performed only with the Report object (or External Report), and not with the form data, and in itself does not change anything - in Settings and in the PN the same remains as it was, and the FN may remain empty. Therefore, depending on our tasks:

After execution

Report.Settings Composer.LoadSettings(SKD.DefaultSettings)

Only the option changes, and nothing more;

After performing the technique given in paragraph 2 (using the “intermediary” and the method LoadCustomSettings()

works only if you reset the current PN using the interface. By themselves, if the option is changed, they will not change. In this case, the Selection changes, but a new Selection Element is not added.

After execution

ThisForm.CreateFormElementsUserSettings(,DisplayModeDataCompositionSettings.All)

the platform just falls silently. Tested on several different releases. And calling the mode for displaying settings only for quick ones makes no sense - we didn’t influence their composition, so nothing will change anyway.

And since we still need to fully change not only the internal selections, but also the display on the report form and in related forms, we either have to change only the Selection, or proceed as follows:

&On the Server Procedure ChangeSKD() pObject = Form AttributesValue("Report"); selection=pObject.DataCompositionScheme.SettingsOptions.Get(0).Settings.Selection; eo = selection.Elements.Add(Type("DataCompositionSelectionElement")); eo.LeftValue=NewDataCompositionField("LinkToDirectory.Field1"); eo.ComparisonType=DataCompositionComparisonType.Equals; eo.RightValue=True; eo.Use=True; ValueВFormAttributes(pObject,"Report"); Report.SettingsLitter.LoadSettings(pObject.DataCompositionSchema.DefaultSettings); Report.SettingsComposer.Restore(); // desirable, although this still does not affect the FN. // in fact, this is exactly what can be called a change in the composition of the PN For each email From Report.ComponentSettings.Settings.Selection.Elements Cycle email.DisplayMode=ElementDisplayModeDataCompositionSettings.QuickAccess; If EmptyString(el.UserSettingsIdentifier) ​​Then // you can use the electronicSetIdentifier method for the PN element, see its help in the SP, everything is quite clear there e.UserSettingsIdentifier="ID123"; // important - the identifier can be ANY, not UUID or GUID! el.ViewUserSettings="Test"; endIf; EndCycle; comp=NewDataCompositionSettingsComposer; comp.LoadSettings(pObject.DataCompositionScheme.DefaultSettings); Report.SettingsComposer.LoadCustomSettings(comp.CustomSettings); For each email From Report.Settings Composer.CustomSettings.Elements Cycle email.DisplayMode=ItemDisplayModeDataLayoutSettings.QuickAccess; // pull EndCycle onto the report form; // and now this will have the effect: ThisForm.CreateFormElementsUserSettings(,DisplayModeDataCompositionSettings.QuickAccess); End of Procedure

Actually, you can study this mechanics for a long time. This publication grew out of studying ways to solve one specific problem, and is therefore quite one-sided; but I suspect that a separate book can be written about the internal logic of settings, especially user ones, no more subtle than Khrstalev’s. Unfortunately, I don’t have the energy or time for this. Whoever finds specific developments useful is already good.

Some things have been clarified experimentally and are therefore controversial. Those who know more are invited to criticize and comment.

Loading...