1c update managed form. Programmatically adding and changing elements of managed forms. Make a backup right away
If your database is open general access over the network, Microsoft Access updates information at set intervals. To see the most current data, refresh records in Datasheet view or Form view: tab
Note: Re-querying may take a long time depending on the size of the records.
In this article
Data Update
Specifying the update interval
Data Update
To refresh data in Datasheet or Form view, on the
Home in the groupPosts clickUpdate all and then clickUpdate .To refresh data in a PivotTable or PivotChart window, on the
Constructor in the groupData clickUpdate summary areas .Press SHIFT+F9.
Do one of the following:
Top of page
Specifying the update interval
You can specify the interval at which Access refreshes data. By default, Access refreshes data every 60 seconds.
Click the Office button. Outspace appears.
In the left Outspace panel, click
In the left pane of the dialog box
On the right panel under
Top of page
Requesting data using a macro
To automatically re-query data when an event occurs, you can create a macro and associate it with the event. Let's say you want to re-query the data by receiving
On the tab
Click the arrow in the box next to the green plus sign (+) and select
Save the macro using a name
Open the required form V
On the tab
Save the form.
Top of page
Use the code to re-query the data
To automatically re-query data when an event occurs, you can create a macro and associate it with an event, such as a receipt on a form. To do this, you can create a macro and associate it with the form event
Open the desired form in the Designer. If the properties page does not appear, press F4.
Make sure the shape itself is selected. Then click on the tab
On the tab
In the dialog box
A new module will open 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 are executed on the server. To requery data in an Access web app, use the RefreshRecord macro. This macro requires the current recordset.
Open the required form, click the button
IN
Save the form.
Top of page
1C company constantly releases new releases of its configurations: adding new features, updating reporting forms.
Therefore, the configurations of your infobases also need to be constantly updated. The 1C program itself even reminds you of this and offers to update. You can update 1C 8.3 yourself in two ways: through the configurator or via the Internet. Let's consider step by step instructions on updating 1c and what needs to be done after this procedure using an example.
Updating the 1C 8 program via the Internet
To update 1C 8.3 over the Internet, go to the “Administration” menu and find the “Updating the program version” section:
First, let’s go to the “Setting up program updates via the Internet” section:
In this window, the most important thing is to enter the user code and password; without them, you will not be able to connect to the site with updates. You should have received them along with . If for some reason you do not have them, there is a link nearby that will take you to your personal account on the support site, and all the data will be there.
Here you can disable automatic checking for updates, set up a scheduled check or every time you log into the program.
Leave the switch on " Automatic update" and click "Next". If a newer program release than the current one is found, the corresponding information will appear.
For my configuration there were more new version, and now I’ll try to update 1C. Pay attention to the size of the update, as it is downloaded and unpacked into the user's directory, which is located on the "C:" drive. Accordingly, there should be enough free space on it. By the way, here you can read what changes and innovations are in the update. Click “Next”.
Oddly enough, the program was unable to connect to its server the first time due to the fact that it was using my old code and password, although I specified everything correctly in the settings:
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 a fairly lengthy process. Took me a few minutes. In the next window we have to choose whether to update immediately or after finishing work. If you decide to update immediately, make sure that no one else is in the database. The update occurs in exclusive mode.
Get 267 video lessons on 1C for free:
Here you will be prompted to make a backup copy before updating. I advise NECESSARILY make a backup copy of the 1C database, I was convinced from my own experience. Moreover, I recommend selecting the last item “Create a backup copy and save to a directory.” In this case, if something goes wrong during the update, the program itself will return everything to its place.
The update went smoothly for me and took about 45 minutes.
Important note! After installing the configuration update, the program may require you to update the 1C platform. You can read how to do this in or see in our video:
Self-updating 1C 8.3 via the configurator
To update via the configurator, you first need to download the 1C update file from the official website or from the ITS disk. I described how to do this in the article ““. Only the row in the table, of course, you need to select another (1C Accounting):
One point should be noted here. Not all latest releases may be suitable for your current configuration. Therefore, if you have not updated for a long time, you may have to download several versions. In the list of releases you can see which one fits which.
In my case, the latest release of 1C is suitable, and I downloaded it. Unlike the platform update file, configuration updates are located in archives. 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. Typically this is the default directory, but you can specify a different one.
Now let's go to the configurator:
Naturally, you need to log in as a user with administrative rights.
Let's make a backup copy right away!
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 asking you to select the one you need:
If several available updates are found, the program will highlight the latest one in bold.
Click “Finish”. Two more information windows will appear, there you just need to click “Continue”.
The 1C 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 some time, the message “Configuration merging complete” will appear. Click "OK".
Now you also need to update the configuration of the infobase. To do this, go to the menu “Configuration – Update database configuration”.
If the system asks you for something else, you need to click “Yes” or “Accept”.
When finished, you can close the configurator. When you first start the program in normal mode You may receive a message that the platform you are using is outdated for this configuration and working on the system is not recommended.
This update is complete.
Watch also our video on updating 1C through the configurator:
The 1C:Enterprise platform allows you to programmatically add and change elements of a managed form. Let's figure out why this might be needed.
Software modification of the form may be required in several cases:
- When finalizing standard configurations to facilitate the subsequent update procedure. In this case, only the form module will be changed. Modules are much easier to update than forms.
- When implementing some common algorithms. For example, in the “Prohibition of editing object details” subsystem, a button can be created programmatically for all objects connected to the subsystem to enable the ability to edit details.
- When implementing some specific algorithms. For example, in the Nomenclature directory, fields are created for editing additional details.
In a managed form, you can programmatically add, change, and delete:
- details;
- local teams;
- elements.
All of these operations are possible only on the server.
Programmatic reshaping has limitations:
- You can only delete programmatically added details/commands/elements. You cannot programmatically delete objects created in the configurator.
- You cannot assign an attribute as the main one.
Changing form commands
To manage the composition of commands for an object ManagedForm there is a collection Teams
Add (< ИмяКоманды >)
Quantity ()
Find (< ИмяКоманды >)
Delete (< Команда >)
The Teams collection is available on both the client and server. You can change the collection (Add() and Delete() methods) only on the server. You can search for and get the number of elements (the Find () and Count () methods) both on the client and on the server.
As an example of working with form commands, let's create new team Change History with the title “Change History...”, which will call the handler DisplayHistory(). Creation occurs when the form is opened.
&OnServer
Procedure WhenCreatingOnServer(Failure, StandardProcessing)
Team = Teams. Add( "History of Changes");
Team . Action = ;
Team . Title = "History of changes...";
End of Procedure
&OnClient
Procedure Connectable_DisplayHistory(Command)
// command actions
End of Procedure
The command handler must be located on a form and have a &OnClient compilation directive.
Changing form details
Reading the composition of the form details is performed by the function Get Details(< Путь >) returning an array of type FormAttributes. 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 details are returned.
Changing the details is done using the method Change Details(<Added Details>, <Removable Details>) object ManagedForm. To parameters Added Details And Removable Details Arrays with elements of the Form Attributes type are transmitted.
Attention!
The process of changing the composition of details is quite resource-intensive. The form is actually being recreated. In this regard, work with form details is performed in batch mode.
Let's create a new form attribute with the name Buyer:
AddedDetails = New Array;
Added Details. Add(New Form Attributes(“Buyer”, New Type Description (“Directory Link. Counterparties”), “Client”));// Changes in the composition of details
);
Changing form elements
To control the composition of elements of an object ManagedForm there is a collection Elements. The collection has several methods:
Insert (< Имя>, < ТипЭлемента>, < Родитель>, < Элемент >)
Add (< Имя>, < ТипЭлемента>, < Родитель >)
Quantity ()
Find (< Имя >)
Move(< Элемент>, < Родитель>, < МестоРасположения >)
Delete (< Элемент >)
The Items collection is available on both the client and server. Modify a collection (Insert methods () , Add () , Move () and Delete () ) are only available on the server. You can search for and get the number of elements (the Find () and Count () methods) both on the client and on the server. Collection elements can be:
- FormGroup;
- FormTable;
- FormField;
- Form Button.
You can programmatically assign event handlers to form elements. The method is intended for these purposes SetAction(< ИмяСобытия>, < Действие >) .
Let's look at some of the most common examples of working with commands, details, and form elements.
Adding a command and its associated button:
// Create a command
Team = Teams. Add( "History of Changes");
Team . Action = "Plug-in_DisplayHistory"; // The form must contain a procedure with the specified name
Team . Heading = "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 the associated input field:
// Description of the added details
AddedDetails = New Array;
Added Details. Add(New Form Props (“Buyer”, New Type Description ( "DirectoryLink. Counterparties"), "Client" ));
// Changing the composition of details
ChangeDetails(Added Details);
// Creating an input field and connecting to the attribute
Element = Items. Add("Buyer" , Type("FormField" ));
Element . View = FormFieldView. InputField;
Element . PathToData= "Buyer" ;
Assigning an event handler to a form element:
ItemCustomer. SetAction(“OnChange”, "Connected_BuyerOnChange");
&OnClient
Procedure Connected_BuyerOnChange(Element)
// Event actions
End of Procedure
Attention!
Procedures that are set as event handlers from code using the method SetAction(), it is recommended to set the prefix Connectable_.
Attention!
You can download the processing with examples of programmatic searching and changing details, commands and elements of a managed form.