How to perform external processing in 1C 8.3. Adding external processing to the database

2016-12-08T15:04:29+00:00

I’ll tell you using the example of my processing, which I post on my website.

1. Download the archive with processing to your desktop.

2. Double-click on the downloaded archive and you will be taken inside.

Attention! If you couldn’t get inside the archive (it says the error “Application not found”), then right-click on the archive and select one of the options:

      • Extract all
      • Open with 7-Zip
      • Open with WinRar
      • Or something similar...

3. There is a file with processing (and already with a Russian name). Right-click on it and select "Copy".

4. Return to the desktop, right-click again on an empty space on the table and select "Paste" ( or you can simply drag the processing file from the archive to your desktop).

5. The file from the archive should appear on the desktop.

For normal interface

From the menu, select "File->Open...":

For a managed interface (taxi, etc.)

Open directly from a file

From the menu, select "File" -> "Open...":

In the window that appears, go to the desktop, select the file with processing and click the "Open" button.

Ready! The processing should open in the program and you can use it. For convenience, you can create a special “Processing” folder on your desktop and store such files there.

Registering processing in the database

If, at the stage of opening the file, you get the error “Access rights violation!”:

Then you will have to allow the opening of external processors (more about this) or register the processing in the database - this is not difficult to do, for this:

Go to the "Administration" section, "Print forms, reports and processing":

In the window that opens, check the "Additional reports and processing" checkbox and open the "Additional reports and processing" link:

In the window that opens, click the "Create" button:

Read the warning and click the "Continue" button:

In the window that appears, go to the desktop, select the file with processing and click the "Open" button:

If at this stage the error “It is impossible to connect additional processing from the file...” appears, then there is nothing left to open the processing except to allow opening files from the “File” -> “Open” menu - that’s about it.

Find and click "Placement":

In the next window, check the "Operations" section and click "OK".

Go to the top menu Service->->.

The external processing directory list form appears. In the top menu press the button Add.

The Add New Object form will appear. Click the open button and select the file with the desired processing. After you have selected the desired file, if necessary, specify a processing name (Name field). After this, you need to click OK to save the changes made.

After this, the window for creating a directory item closes, and you are taken back to the list form, which already contains the new processing.

That's all! The process of adding processing to the configuration is complete. To open this processing later, go along the old path: Service->Additional reports and processing->Additional external treatments.

For BP 3.0, ZUP 3.0, UT 11, ERP 2.0.

External processing for 1C:Enterprise 8 comes in several types. In this instruction, I will show you how to attach processing for group modification and processing for filling specific objects.

For the first case, we will add processing for filling out the nomenclature directory from Excel.

Let's go to the appropriate section of the program:


It is necessary that the flag for using additional reports and processing is set; follow the hyperlink to the list of external objects:

In the list click Create:


In the dialog box that opens, select the desired file for processing:


The card for a new external object in the program has been filled out, all that remains is to configure it accommodation(sections of the program from which processing will be available):


Select an arbitrary section (or several) for placement:


Write and close the external object card:


Now let's open processing from the interface:


The list is empty, click Customize the list:


Choose our processing:


It is now available for selection. To open processing, you need to click Execute:


Now let's see how processing for filling (modifying) specific objects is added. For example, let's take external processing, which attaches scans to selected elements of directories or system documents. The beginning of adding such processing is no different from the previous option. The difference is that in this case the placement is filled in automatically (and not by the program section, but by the types of database objects):


If desired, the placement list can be adjusted ( do not add additional placement, but remove unnecessary):


To accept the change, the external object card must also be written down.

In order to use processing, you need to go to a specific database object (from the placement list), click Fill in the command panel and select the command:

Previously, external processing was written that allows you to view the number of documents in the database entered for the current day by document date. Why it was created is not important. The processing form is quite simple, as is the implementation:

You can view the processing code by downloading it from the link at the end of the article. We will solve another problem. We need to start this processing from the "Tools" menu:

By clicking the button, processing starts with the current date already entered in the "Check Date" field.

Launch

First, let's add the "Number of documents per day" button to the "Full" interface and create a handler procedure for it in the general module.

The program code of the handler procedure is presented in the following listing:

Procedure FullAction() Export // Get a link to the directory element "External Processors", //which contains the required processing file LinkToProcessing = Directories. ExternalProcessing. FindByName(" Number of entered documents", True); // Write the binary data of the processing file to a temporary file FileName = GetTemporaryFileName() ; BinaryData = ProcessingRef. External Processing Storage. Get() ; BinaryData. Write(FileName) ;// Get the external processing form Form = ExternalProcesses. GetForm(FileName) ;// Open the form for the user

Form. Open() ;

  1. EndProcedure
  2. In general terms, the sequence of actions is as follows:
  3. We get a link to the directory element "External Processings".
  4. We extract the binary data of the processing file stored in the found directory element.

We write the received binary data to a temporary file.

Using the created file, we obtain the external processing form and open it.

This way we can run external processing/reports from any configuration module where the client context is available.

Advantages

In such cases, moving the functionality to external processing/reports will help, which after modification we can simply replace in the “External Processing” directory, and users will only have to restart them. No update required.

The processing used in the article is "Counting the number of documents".

External processing is a very convenient tool for companies using standard configurations on 1C:Enterprise 8.3. They allow you not to waste effort and money on 1C updates, making it possible to update databases with one button in simple user mode. Using the standard subsystem library mechanism, you can add various buttons to documents and reference books without changing the standard 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, we use the configurator. Through the “File” menu, select the creation command “New...” and determine that we will create external processing. In the window that opens, set the name, and when you press “Enter,” it is filled in automatically. The system will also offer you this name as the file name when saving.

Let's add a processing form by clicking on the button with a magnifying glass in the corresponding window. For example, let's create a processing showing which customer orders use a certain item. To do this, we need to place on the form:

  • Attributes – field for setting the nomenclature;
  • A button that will call the code.

Add the “Nomenclature” attribute with the data type “DirectoryLink.Nomenclature” in the corresponding section and the “Show” button in the “Commands” -> “Form Commands” menu.

In order for the added data to be reflected on the form, you must drag it into the form elements located in the upper left part. It is possible to swap elements using the blue arrows. In order for the button we created to do what it intended, it needs to be assigned a procedure. Through the context menu, select “Command Action”, and when asked where the handler is needed, we will answer: “Create on the client and a procedure on the server.”


Fragment 1

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

We chose to create a procedure on the server because we want to receive a sample from the database as a result. We do not have this option on the client, so we will need to connect to the server, which exchanges data with the database. Now we need to write code that implements what we have planned. The request and output of all documents through the “Report()” function will be used.


Fragment 2

&OnClient Procedure Show(Command) ShowOnServer(Nomenclature); EndProcedure &OnServer Procedure ShowOnServer(Nomenclature) Request = New Request;

Query.Text = "SELECT VARIOUS | Customer OrderComposition.Link AS Link | FROM | Document.Customer Order.Composition AS Customer OrderComposition | WHERE | Customer OrderComposition.Nomenclature = &Nomenclature";

Request.SetParameter("Nomenclature", Nomenclature);

Function InformationOnExternalProcessing() 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 = NewValueTable;
  • TabZnCommands.Columns.Add("Identifier");
  • TabZnCommands.Columns.Add("Usage");
  • TabZnCommands.Columns.Add("View");

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” directory 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 discontinued 1C database, then take advantage of the opportunity to download processing through the configurator. In the object tree, in the “Processings” section, 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 desired section, including the added processing in the desired subsystem.


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

Often, when working with 1C, it is necessary to carry out some similar operations that are repeated systematically over time and simply distract from the main work. This could be various downloads and unloads, generation of some data for external analysis, etc. There is a fairly simple way to automate these operations and actually forget about them, periodically receiving log files by email for control.

It’s great if you already have these operations written by external processors, no problem; if this is not the case, create and move everything there. Next, to check its functionality, I recommend testing all this in manual mode and then, if everything works as it should, rewrite the main processing code so that when external processing is loaded, it starts automatically, without clicking on the execute button and the like. The simplest thing is to move the code into a procedure OnOpen().

The next step is to automatically close the program after executing the external processing that we created and it is already working for us. To do this, in the procedure OnOpen() At the very end we insert the following command: ShutdownSystem(False); in this case the parameter Inquire Opportunity we pass the value “False” in order to cut off various options for additional questions of the system when closing, thereby initiating the unconditional shutdown of 1C after performing this external processing. To be sure, we run the program again and perform the processing and make sure that it has worked and the program has closed itself.

“C:\Program Files (x86)\1cv8\8.3.5.xxxx\bin\1cv8.exe” ENTERPRISE /DisableStartupMessages /FC:\path to database /N”UserName” /P”User Password” /Execute from:\path to processing\self-processing.epf

Let's decipher:

1. “C:\Program Files (x86)\1cv8\8.3.5.xxxx\bin\1cv8.exe” ENTERPRISE - the 1C engine itself in this case is 8.3, check the path yourself, it differs depending on the version and engine including don’t forget to edit it after updating the last one.

2. /DisableStartupMessages - disable all messages when the system starts.

4. /N"UserName" /P"UserPassword" - respectively /N username, also immediately without a space and /P password.

5. /Execute from:\path to processing\self-processing.epf - /Execute starts our processing, the path and name should follow this key.

Now that’s it, all that remains is to add our cmd file to the task scheduler: avtozapusk1c.cmd, indicating the schedule for its launch.

To monitor the work of external processing, I recommend creating a separate user for it; it is also optimal that the processing itself creates a log file, which is also periodically sent to your email.

These simple tools help automate everyday routine operations, good luck to you!

mob_info