Update form data 1s 8.3 programmatically. Programmatically adding and modifying managed form elements. Specifying an update interval
Firm 1C constantly releases new releases of its configurations: adds new features, updates reporting forms.
Therefore, the configuration of your infobases also needs to be constantly updated. The 1C program even itself reminds of this and offers to make an update. You can update 1C 8.3 yourself in two ways: through the configurator or via the Internet. Consider step by step instructions for updating 1s and what needs to be done after this procedure using an example.
Updating the program 1C 8 via the Internet
To update 1C 8.3 via the Internet, go to the "Administration" menu and find the "Program version update" section:
First, let's go to the section "Setting up software updates via the Internet":
In this window, the most important thing is to enter the user code and password, without them it will not be possible to connect to the site with updates. You should have received them with . If for some reason you do not have them, there is a link next to which you will go to your Personal Area on the support site, and there will be all the data.
Here you can also disable automatic checking for updates, set up a check on a schedule or every time you enter the program.
Leave the switch on Automatic update” and click “Next”. If a newer release of the program than the current one is found, the corresponding information will appear.
For my configuration, I found more a new version, and now I will try to update 1C. Pay attention to the size of the update, as it is downloaded and unpacked to the user's directory, which is located on the "C:" drive. Accordingly, there must be enough free space on it. By the way, here you can read what changes and innovations are in the update. We press "Next".
Oddly enough, the program could not connect to its server the first time because it used my old code and password, although in the settings I specified everything correctly:
I click "OK", enter the correct data and click "Next". I hope you don't see such a window.
The program will start receiving the update file. Depending on your internet speed, this can be quite a lengthy process. It took me a few minutes. In the next window, we have to choose whether to update immediately or upon completion of work. If you decide to upgrade immediately, make sure no one else is in the database. The update takes place in exclusive mode.
Get 267 1C video lessons for free:
Here it will be proposed to backup before the update. I advise NECESSARILY make a backup copy of the 1C base, I was convinced from my own experience. And I recommend choosing the last item "Create a backup copy with saving to a directory." In this case, if something goes wrong during the update, the program itself will return everything to its place.
My update went without problems and took about 45 minutes.
Important note! After installing the configuration update, the program may require you to update the 1C platform. How to do this, you can read in or see in our video:
Self-updating 1C 8.3 through the configurator
To make an update through the configurator, you first need to download the 1C update file from the official website or from the ITS disk. How to do this, I described in the article "". Only a row in the table, of course, you need to select another (1C Accounting):
One point should be noted here. Not all latest releases may fit your current configuration. Therefore, if you have not updated for a long time, you may have to download several versions. The list of releases shows which one suits which.
In my case, the latest release of 1C is suitable, and I downloaded it. Unlike the platform update file, configuration updates are archived. It is also advisable to place it in a clean directory and run it. After it is unpacked, run the setup.exe file:
The update will be installed in the specified directory. This is usually the default directory, but you can specify a different one.
Now we go to the configurator:
Of course, you need to log in as a user with administrative rights.
Make a backup right now!
Now you need to go to the menu "Configuration - Support - Configuration Update". A window will appear:
If one or more 1C 8.3 configuration updates are found, a window will appear with the choice of the one you need:
If several available updates are found, the program will highlight the latest one in bold.
We click "Finish". Two more information windows will appear, there you just need to click "Continue".
The update process will begin. After a while, a configuration comparison window may appear. If you are not an expert, then it is better not to touch anything there. Click "Run":
After a while, the message “Configuration merging completed” will appear. Click "OK".
Now you also need to update the infobase configuration. To do this, go to the menu "Configuration - Update database configuration".
If the system asks for something else, you need to click "Yes" or "Accept".
When finished, the configurator can be closed. When you first start the program in normal mode a message may appear that the platform used is outdated for this configuration and work on the system is not recommended.
This completes the update.
See also our video on updating 1C through the configurator:
If your database is open general access over the network, Microsoft Access updates the information at set intervals. To see the most up-to-date data, refresh records in Datasheet view or Form view: on the tab
Note: Re-query may take a long time depending on the size of the records.
In this article
Data update
Specifying an update interval
Data update
To refresh data in Datasheet or Form view, on the tab
home in a groupEntries clickUpdate All , and then clickRefresh .To refresh data in a PivotTable or PivotChart window, on the
Constructor in a groupData clickUpdate summary areas .Press the key combination SHIFT+F9.
Perform one of the following actions:
Top of page
Specifying an update interval
You can specify the interval at which Access refreshes data. By default, Access refreshes data every 60 seconds.
Press the Office button. Outspace appears.
In the left pane of Outspace, click
On the left side of the dialog box
On the right panel below
Top of page
Re-query data with a macro
To automatically requery data when an event occurs, you can create a macro and associate it with the event. Suppose you want to re-request data by getting
On the tab
Click the arrow in the box next to the green plus sign (+) and choose
Save the macro using a name
open desired shape in
On the tab
Save the form.
Top of page
Use code to re-request data
To automatically requery data when an event occurs, you can create a macro and associate it with an event, such as a form receive. To do this, you can create a macro and bind it to the form event
Open the required form in the Designer. If the property page is not displayed, press F4.
Make sure the form itself is selected. Then click on the tab
On the tab
In the dialog box
A new module opens in the Visual Basic Editor.
Type
Save the form.
Top of page
Requery data in an Access web app
Queries in an Access web app run on the server. To requery data in an Access web app, use the UpdateRecord macro. This macro requires the current recordset.
Open the required form, click the button
AT
Save the form.
Top of page
The 1C:Enterprise platform allows you to programmatically add and modify elements of a managed form. Let's see why this might be needed.
Programmatic modification of the form may be required in several cases:
- When finalizing typical configurations to facilitate the subsequent update procedure. In this case, only the form module will be changed. Modules are much easier to update than a form.
- When implementing some general algorithms. For example, in the subsystem "Prohibition of editing the details of objects" for all objects connected to the subsystem, a button is created programmatically to enable the possibility of editing the details.
- When implementing some specific algorithms. For example, fields for editing additional details are created in the Nomenclature reference book.
In a managed form, you can programmatically add, modify, and remove:
- requisites;
- local commands;
- elements.
All these operations are possible only on the server.
Programmatic reshaping has limitations:
- You can only delete programmatically added attributes/commands/elements. You cannot programmatically delete objects created in the configurator.
- It is impossible to assign the attribute as the main one.
Changing form commands
To manage the composition of commands for an object ManagedForm have a collection Teams
Add (< ИмяКоманды >)
Quantity ()
Find (< ИмяКоманды >)
Delete (< Команда >)
The Commands collection is available on both the client and the server. Modifying the collection (methods Add () and Remove () ) is possible only on the server. You can search and get the number of elements (methods Find () and Quantity () ) both on the client and on the server.
As an example of working with form commands, let's create new team HistoryChanges with the title "History of changes ...", which will call the handler DisplayHistory() . Creation is performed when the form is opened.
&On server
Procedure OnCreateOnServer(Failure, StandardProcessing)
Team = Commands. Add( "History of Changes");
Team . Action = ;
Team . Title = "History of changes...";
EndProcedure
&AtClient
Procedure Connected_DisplayHistory(Command)
// command actions
EndProcedure
The command handler must be located in the form and have the compilation directive &AtClient .
Changing form details
Reading the composition of the form attributes is performed by the function Get Details(< Путь >) that returns an array of the FormAttributes type. The function parameter specifies the path to the parent attribute (as a string). If the parameter is omitted or an empty string is specified, the top-level credentials are returned.
Changing the details is performed by the method EditRequisites(<Added Details>, <Removable Details>) object ManagedForm. The options Added Details and Removable Details arrays with elements of the Form Requisite type are passed.
Attention!
The process of changing the composition of details is quite resource-intensive. In fact, the form is being recreated. In this regard, work with the details of the form is performed in batch mode.
Let's create a new form attribute named Buyer:
AddedAttributes = New Array;
Added Details. Add(New Form Attribute("Buyer", New TypeDescription ("DirectoryReference.Counterparties"), "Client");// Changes in the composition of attributes
);
Changing Form Elements
To manage the composition of the elements of an object ManagedForm have a collection Elements. The collection has several methods:
Insert (< Имя>, < ТипЭлемента>, < Родитель>, < Элемент >)
Add (< Имя>, < ТипЭлемента>, < Родитель >)
Quantity ()
Find (< Имя >)
Move(< Элемент>, < Родитель>, < МестоРасположения >)
Delete (< Элемент >)
The Elements collection is available on both the client and the server. Modify collection (Insert methods () , Add () , Move () and Delete () ) are available only on the server. You can search and get the number of elements (methods Find () and Quantity () ) both on the client and on the server. Collection elements can be:
- GroupForm;
- TableForms;
- FormField;
- ButtonForms.
You can programmatically assign event handlers to form elements. For this purpose, the method SetAction(< ИмяСобытия>, < Действие >) .
Let's look at some of the most common practical examples of working with commands, attributes, and form elements.
Adding a command and its associated button:
// Create a team
Team = Commands. Add( "History of Changes");
Team . Action = "Connected_DisplayHistory"; // The form must contain a procedure with the specified name
Team . header = "History of changes...";
// Create a button and associate it with a command
Element = Items. Add( "History of Changes", Type("FormButton" ));
Element.CommandName = "History of Changes";
Adding an attribute and its associated input field:
// Description of the added details
AddedAttributes = New Array;
Added Details. Add(New Form Attribute ("Buyer", New Type Description ( "Reference Link. Counterparties"), "Client" ));
// Changing the composition of attributes
EditAttributes(AddedAttributes);
// Creating an input field and linking to an attribute
Element = Items. Add("Customer" , Type("FormField" ));
Element . View = ViewFormFields. Entry field;
Element . PathToData= "Buyer" ;
Assigning an event handler to a form element:
ItemBuyer. SetAction("When it changes" , "Plug-in_BuyerOnChange");
&AtClient
Procedure Plugin_BuyerOnChange(Element )
// Event actions
EndProcedure
Attention!
Procedures that are installed as event handlers from code using the method SetAction(), it is recommended to use the Connected_ prefix.
Attention!
You can download processing with examples of programmatic search and change of details, commands and elements of a managed form.