Torrent external processing 1c 8.3. Accounting info

Consider in this article step by step instructions to create external processing in 1C 8.3 in the managed application mode, respectively, we will use managed forms. And most importantly, we will learn how to connect it to the mechanism of "external processing" of 1C configurations, built on the library of standard subsystems of version 2.0 and newer.

The task will be as follows: create the simplest external processing that will perform a group action on the "Nomenclature" catalog, namely, to set the selected percentage of the VAT rate for the specified item group.

To do this, we immediately produce required setting in the program (the configuration 1C 8.3 is considered: "Enterprise Accounting 3.0" on managed forms).

Checking this box enables us to use external processing.

Creating a new external processing in 1C 8.3 by example

Now let's go to the configurator. In the "File" menu, select "New ...". A view selection window will open generated file... We select "External processing":

A new external processing window will open. Let's give it a name right away. It will be offered when saving processing to disk:

Let's add a new managed processing form. We indicate that this is a processing form and it is the main one:

We will have two details on the form:

  • Nomenclature Group - link to the "Nomenclature" reference book;
  • VatStavkaVAT - a link to transfer the VAT rate.

Create requisites in the "Attributes" column in the upper right window. We drag them with the mouse to the upper left window. The new details should immediately appear on the form below.

The order of the details can be changed by arrows "Up" - "Down":

Get 267 1C video tutorials for free:

It remains to add the "Install" button. In managed forms, you can't just add a button to a form. Even if you add it to the structure of form elements, it will not be visible on the form itself. The button must be associated with the command that it will execute. Go to the "Commands" tab and add the "SetVATBet" command. Create an action in the command properties. Select the command handler "On the client". The command can also be added to the form by simply "dragging and dropping" into the section with form elements.

A procedure of the same name will be created in the form module. In it, we will call the procedure on the server:

& OnClient

Procedure SetBetVAT (Command)

SetBidVATOnServer ();

End of Procedure

In the procedure on the server, we will write a small request and actions related to setting the VAT rate:

&On server

Procedure SetBidVATOnServer ()

Request = New Request;
Request.Text =
"SELECT
| Nomenclature.Ref.
| FROM
| Reference.Nomenclature AS Nomenclature
| WHERE
| Nomenclature.Ref IN HIERARCHY (& Nomenclature Group)
| AND NOT Nomenclature.
| AND NOT Nomenclature. ThisGroup ";

Request.SetParameter ("Nomenclature Group", Nomenclature Group);
QueryRes = Query.Run ();
SelectDettRecords = QueryRes. Select ();

While EndingRecord.Next () Cycle

Attempt
SprNomObject.Write ();
An exception
Report ("Error writing object" "+ SprNomObject +" ""!
| " + DescriptionErrors ());
End of Attempts;

End of Cycle;

End of Procedure

We return to the "Form" tab, add a button to the form and associate it with the command:

As such, our processing is ready to use. To call it, in the 1C Enterprise mode you need to go to the File - Open menu and select the created file.

However, working in this mode is convenient for debugging processing, but not quite suitable for the user. Users are accustomed to having everything “at hand”, that is, in the database itself.

For this, the section "Additional reports and processing" is used.

But to add our processing there, you first need to give it a description and tell the program its properties.

Description of the "Information About External Processing" function

I will give an example of the contents of this function. It must be exportable and, accordingly, located in the processing module:

External Processing Information () Function Export

DataForReg = New Structure ();
DataForReg.Insert ("Name", "Set VAT rate");
DataForReg.Insert ("SafeMode", True);
DataForReg.Insert ("Version", "ver .: 1.001");
DataForReg.Insert ("Information", "Processing for setting the VAT rate in the Nomenclature directory");
DataForReg.Insert ("View", "AdditionalProcessing");

CommandTable = New ValuesTable;
TabZnCommands.Columns.Add ("Identifier");
TabZnCommands.Columns.Add ("Usage");
TabZnCommands.Columns.Add ("View");

NewString = TabZnCommands.Add ();
NewStroka.Identifier = "OpenProcessing";
NewStroka.Usage = "Form Opening";
NewStroka.View = "Open processing";
DataForReg.Insert ("Commands", TabZnCommands);

Return Data for Reg;

EndFunction

To better understand which fields of the registration data structure you need to use, let's look at the details of the "Additional reports and processing" reference book:

As you can see, everything is pretty simple. Only one variable does not match: "Launch Option" - "Use". If we look at the code of one of the common modules, we will see how a bunch of these fields appears:

To determine which fields of a structure are required, you can first skip describing it, just create an empty one, and then use the debugger. If you trace the modules when registering processing, it becomes immediately clear which fields are required and which are not.

Connecting external processing in 1C 8.3

In 1C there are many configuration objects that are somehow related to accounting - that is, they allow it to be kept - reference books, documents, registers, and so on. However, what to do when you need to create a program in the 1C language, which is not in any way related to accounting, but is required for the office needs of the programmer or to facilitate the user's work?

A great example is batch processing of documents. This is a tool that allows you to post / change / print not one document, but many at once, according to the selected list. Agree - it's very convenient.

To implement tools in 1C to facilitate the work of a user or administrator of the 1C database, there is a special configuration object - 1C processing. 1C processing can be part of the configuration or distributed as separate files(then the processing is called external processing 1C).

1C processing allows you to develop your own tools both for programming 1C and for setting up or managing 1C. Thanks to this, there are hundreds of standard treatments on the Internet (developed by 1C) and thousands of amateur treatments on the Internet.

It's time to try to do 1C processing yourself. Details below.

What is 1C processing and how are they used

Small introduction. Those who are already familiar with 1C treatments can skip this point.

So, processing is a tool written by a programmer. She does not know how to do anything on her own and does not save data to the 1C database, unlike, for example, a document - which is saved to the database and can independently record and conduct, without additional programming. 1C processing functions are entirely dependent on the programmer who wrote it.

According to the processing functionality, 1C can be divided into three types:

  • Auxiliary processing 1C configuration
    There are many treatments in each typical configuration. They are used as additional interface forms (user desktop, configuration overview), as part of the configuration functionality (entering initial balances, initial filling of the database, closing the month).
  • Objects (Classes)
    Anyone who knows other programming languages ​​is already familiar with the concept of an object. This is a class that has a set of "variables" and "functions" at its disposal. Its charm lies in self-sufficiency - that is, everything that is needed to perform its functions is collected in one class.

    In 1C, classes can be created using 1C processing: "variables" are the details of 1C processing, "functions" are functions in the 1C processing object module (the Export mark for public functions). Convenience lies both in creating an instance of such a class and in moving it between configurations.

    A good example is the processing of 1C printing (additional printing forms), which you can find in typical configurations in the Additional printing forms directory. They always have a public Print () function and standardized usage.

    Note that, of course, such "classes" are not directly data bound - they need to be passed or read in the "constructor".

  • Additional user and administrator tools
    There are many generic tools for use, typically by the database administrator, that are not tied to a specific configuration. Such tools are often not included in the standard configuration delivery and are distributed separately (usually on ITS disks). In addition to the standard ones, programmers post a lot of their own tools on the Internet.

    An example is: 1C processing of work with retail equipment, 1C task console (displays a list of scheduled tasks), 1C query console (allows you to execute any requests without programming), etc.

Where are the 1C processing

So, there are 1C processing built into the configuration and external 1C processing.

Built-in 1C processing is used by the programmer who develops the configuration, situationally - that is, they can either be displayed in the user menu (part in the Service menu), or opened programmatically from other 1C objects (for example, from the directory form).

One way or another, under administrator rights, you can open the list of processings built into the configurations and any of them, if it is possible to open it (that is, if it has a screen form and the programmer has not set a lock for opening). To do this, in the thick client, use the Operations / Processings menu, in thin client use the menu All functions / Processing. If you do not know how to find these menus -.

In the configurator, the 1C processing built into the configuration is located in the Processing branch.

External 1C processing can be opened both in the Configurator and in the Enterprise using the File / Open menu.

Safety. Pay attention to . The 1C processing object module is executed automatically when you open 1C processing in the Enterprise mode. Therefore, if you open processing written by an attacker, it can be performed automatically without any questions asked.

How to do 1C processing yourself

So, let's get down to the most interesting thing - the algorithm for creating 1C processing on our own from scratch.

External treatments - very handy tool for companies using typical configurations on 1C: Enterprise 8.3. They allow you not to waste energy and money on 1C updates, making it possible to update the databases with one button in the simple user mode. Using the library mechanism of standard subsystems, you can add various buttons to documents and reference books without changing the typical configuration. Let's consider an example of creating and connecting external processing in one of the 1C configurations.

We create external processing in 1C 8.3

To create a new external processing, use the configurator. Through the "File" menu, select the "New ..." creation command and decide that we will create external processing. In the window that opens, set the name, and when you press "Enter" it is filled in automatically. Also, the system will offer you this name as the file name when saving.

Add a processing form by clicking on the button with the magnifying glass in the corresponding window. For example, let's create a processing that shows which sales orders use a particular item. To do this, we need to place on the form:

  • Attribute - a field for setting the item;
  • The button that will execute the code call.

Add the "Nomenclature" attribute with the "ReferenceLink.Nomenclature" data type in the appropriate section and the "Show" button in the "Commands" -> "Form Commands" menu.

To reflect the added data on the form, you need to drag it to the form elements located in the upper left part. It is possible to swap items using the blue arrows. In order for the button we created to do what we intended, it needs to be assigned a procedure. Across context menu select "Command action", and to the question where the handler is needed, we will answer: "Create on the client and a procedure on the server".


Fragment 1

& OnClient Procedure Show (Command) ShowAtServer (); EndProcedure & AtServer Procedure ShowAtServer () // Insert the contents of the handler. End of Procedure

We chose to create a procedure on the server, since we want to receive a selection from the database as a result. On the client, we do not have such an opportunity, so we need to connect to the server, which exchanges data with the database. Now we need to write code that implements what we intended. Request and output of all documents through the "Report ()" function will be used.


Fragment 2

& OnClient Procedure Show (Command) ShowAtServer (Nomenclature); EndProcedure & AtServer Procedure ShowAtServer (Nomenclature) Request = New Request; Request.Text = "SELECT DIFFERENT | Customer's OrderComposition.Ref.Link AS | FROM | Document.Client's order.Content AS Customer's OrderComposition | WHERE | Customer's OrderComposition.Nomenclature = & Nomenclature"; Request.SetParameter ("Nomenclature", Nomenclature); QueryResult = Query.Run (); FetchDetailedRecords = QueryResult.Select (); While FetchDetailedRecords.Next () Cycle Report (FetchDetailedRecords.Link); End of Cycle; End of Procedure

At the current stage, we can open the external processing as an ordinary file in the launched 1C database, and it will already be operational. But if we have a lot of users, we will have to send them all this file, providing it with instructions on how to actually open it in 1C, which is extremely inconvenient. To avoid this, our processing should be located inside one of the 1C sections. To do this, we need to modify it a little more through the configurator, specifying certain settings.

To place external processing in section 1C, it is necessary for her to register the procedure "Information About External Processing" in the object module. In the main processing menu, click "Actions" and select "Object module". Here it is necessary to register all the settings necessary for 1C so that the system understands what is required of it and what kind of file is in front of it. The screenshot shows the code for the "ExternalProcessing Information" function.

ExternalProcessing Information Function () Export DataForReg = New Structure (); DataForReg.Insert ("Name", "New external processing"); DataForReg.Insert ("SafeMode", True); DataForReg.Insert ("Version", "ver .: 1.001"); DataForReg.Insert ("View", "AdditionalProcessing"); CommandTable = New ValuesTable; TabZnCommands.Columns.Add ("Identifier"); TabZnCommands.Columns.Add ("Usage"); TabZnCommands.Columns.Add ("View"); NewString = TabZnCommands.Add (); NewString.Identifier = "NewExternalProcessing"; NewStroka.Usage = "Form Opening"; NewStroka.View = "New external processing"; DataForReg.Insert ("Commands", TabZnCommands); Return Data for Reg; EndFunction

Fragment 3

Connecting external processing in 1C

Before connecting external processing to a typical configuration, you must enable the use of this tool. In the "Administration" in the sub-item "Printing forms, reports and processing" set the flag opposite the mechanism we need. The button for switching to the reference book of additional processing and reports becomes available to us.


When we go to the list, create a new line in it, and the system will offer to select a file. We select the processing that we have made and saved, and the 1C configuration independently fills in most of the fields. Through the "Run" button, we can already check the performance of our processing, but this is not very convenient for other users. In order for users to have our team, and they can make a call, we need:

  • Indicate the location of the object. By clicking on "Not defined" we open the sections window and indicate in which sections the operation will be available;
  • Select users for whom this command will appear in the "Additional processing" menu of the selected sections without unnecessary settings. To do this, in the tabular section, select the item " Fast access»And add responsible users to the right half;
  • On the tab “ Additional Information»You can specify the folder where the downloaded processing will be located;
  • After pressing the "Write" button in the selected section in the "Additional processing" menu, users will find our command and will be able to use it.

If we want to make changes to our processing, we must first unload it from the database. To do this, find the required line in the "Additional processing and reports" reference book and use the "Upload to file ..." command. Make changes, save the processing and use the "Load from file ..." button to find the modified epf file without changing the parameters. After recording, all users will see the changes made.

If you are using a non-standard or removed from support 1C base, then use the opportunity to load processing through the configurator. In the tree of objects in the section "Processing" create a new processing and through the context menu select "Replace with external processing, report ...". All that remains is to configure the launch of external processing from the required section by including the added processing in the required subsystem.


Working with external processing is very convenient and avoids many conflicts. Their only significant drawback is that they are not automatically updated along with the configuration. That is, if the developers have changed the name of a document or reference in the main configuration, we will have to manually configure the processing.

Experienced 1C programmers try to keep the number of changes in the main configuration to a minimum so that the update does not take too long. But users want to automate their routine actions and ask to help them by making an "additional button with the required functionality." To do without changes to the typical configuration or to make them as little as possible will help us processing.

Processing Is a special configuration object designed to change information in a database or create new functionality for an administrator or users.

Classification of treatments

At the time of creation, the processing does nothing. What it is intended for and what it will do depends entirely on the programmer who writes it. According to their functions, all 1C processing can be conditionally divided into the following groups:

  • Separate sets of functions and procedures, similar to an object or class. Programmers can use them as a library or use all the pieces of code written for processing if they include it in the configuration. As an example, we can cite the printing functions, united by the developers of typical configurations in one place;
  • Auxiliary processing. Automate a small section of mechanical work or provide users with data as requested. This includes workstations, group processing of 1C documentation, import or export of data, etc.;
  • Additional tools for working with data. These are specialized processing most often allowing to work with any configuration and database.

External processing 1C 8.3 of the second and third types is very often used by programmers in their daily activities. Each experienced 1C developer has his own set of "helpers" - separate files with procedures for all occasions. Thanks to this, he is able to perform some tasks only by correcting a couple of lines of code: loading or unloading data, processing a reference book or documents, forming a printable - it will not be difficult for developers.

After the programmer has decided to create a treatment, he needs to understand where it needs to be added. There is no need to rush to open the configurator - typical configurations support the ability to add external additional processing. Their distinctive feature lies in the absence of the need to change the basic configuration and, accordingly, simplify the update. Also, they can be connected to the configuration even by ordinary users, and not only by administrators, as they are built into the processing system.

To find out the list of processing units connected to your configuration, you need to enter it in the configurator mode. Click on the "Configuration" -> "Open Configuration" menu. A window will open on the left, in which you can find all the configuration objects, which include built-in processing.

To see a list of external processors already connected to the configuration, you need to run 1C in enterprise mode. In the UT program, the list we are interested in is in the "Service" section, in the "External printing forms and processing" menu. In other typical products of the 1C company, it can be found in the sections "NSI and Administration" and similar ones.

Separately, it should be said about how to open external processing, the author of which you are not. On the Internet, additional 1C processing can be downloaded from many sites, most of which are designed to help colleagues. But there are cases when 1C processing, carelessly launched through the "File" -> "Open" menu, broke working base a huge company. Unfamiliar additional universal processing first open in the configurator and carefully check all the code to avoid dire consequences.

Creating processing in separate files and connecting them to the 1C database is one of the main skills of the administrator. You downloaded and checked or wrote an excellent treatment yourself that will help you and your users work in 1C. Now you are faced with the task of adding processing to the configuration so that employees of your company can use the new functionality. It is enough just to go through a simple algorithm, and you will be able to conduct a control check and report the completion of work on the development of the functionality:

  1. Open the list of external processors connected to the database. It has already been said above where to look for this list;
  2. Click "Create" and 1C will open a file selection window, through which you must specify where 1C data processing is located;
  3. After choosing 1C, it independently recognizes the type of external processing (you should have previously registered it in the object module). Some fields are automatically filled in - type, file name, version, command name, name and others;
  4. Also, 1C will read from processing where it should be placed - in documents, a reference book or a special section for additional processing. Moreover, developers can add a processing call only for the forms of some documents or reference books;
  5. For users to see the new functionality, the Publish option must be set to In Use.

For some types of external processing, it is possible to specify users who will appear in the interface new function or schedule. Scheduled or background jobs are a separate type of processing that can be performed without user intervention. This is a convenient functionality in cases when you need to automate routine work or to start group processing of 1C documents. They can also help if the server is weak - all processing can be started in the evening when there are no active users in the database.

Setting up a schedule in 1C is rich in options, but even an unprepared user can figure out the principles in a few minutes. In the lower field, depending on the assigned values, a description of the procedure is formed, when it is necessary to start processing and how it will be performed. To check the correctness of execution, you can use the logbook - it records the date and time of the beginning and end of processing.

Many franchisee companies base their implementation solely on the creation of processing - they develop workstations and connect them. That is, they replace standard interface 1C with complex names, personally developed according to the wishes of users. And according to the entered data on the server side, the 1C 8.3 document is processed imperceptibly for the eyes of the company's employees. Nothing prevents you from using this experience - and soon your company will realize how valuable you are.

Attention!
All processing from ITS disks are intended for informational purposes and exclusively for registered ITS users.

Selection and processing of objects. (Universal)

Searches for objects in documents and directories that meet certain conditions. Processes search results.

Folding the infobase. (Universal)

Rolls up information security typical configurations:

  • SCP 3.1.
  • BP 1.6.
  • UT 10.3.

Registration of changes for exchange. (Universal)

Edits, in managed application mode, the registration of changes to exchange objects. Allows you to change the current registration on various nodes. Changes the numbers of received and sent messages.

Convert user activity log. (Universal)

Converts a user activity log to a built-in program.

Full-text data search. (Universal)

Indexing and searching in data.

Finding and replacing values. (Universal)

Searches for and replaces reference values ​​in IB objects.

Setting up a technological log. (Universal)

Creates or edits a technology log file. Has the ability to configure the creation of a dump of an abnormal termination, configure conditions and events, upon the occurrence of which, information will be written to this log.

Quest Console. (Universal)

Monitors background and scheduled jobs. Deletes, creates new ones.

Conversion of external treatments. (Universal)

Change of confidential information. (Universal)

Selective change or clearing of information security from certain information.

Group change of details. (Universal)

Changes details and tabular sections in documents and reference books.

Unloading and loading users. (Universal)

Unloads and loads IB users into an XML file.

Uploading data to external databases. (Universal)

Uploads data structures to external DBMS using ADO in two modes:

  • Unload All
  • Upload changes (used to synchronize changes in the working IS, with the IS - the receiver). This mode uses exchange plan mechanisms.

Supports the following DBMS:

  • Microsoft SQL
  • IBM DB2
  • Oracle
  • PostgreSQL
  • MySQL

Unloading and loading XML data. (Universal)

Unloads and loads data into IB, both in whole and in part. It is used to transfer data between configurations with similar object composition.

Loading data from a spreadsheet document. (Universal)

It loads data into directories and tabular sections from tabular documents.

Runs in a thick client as a regular application.

Query console. (Universal)

Provides tremendous assistance in reporting and creating queries.