It is possible to reinstall the component or auxiliary. How to find out the right method

Any programmer 1c met with such a message as "Error when calling a context method (execute). Usually this error does not cause difficulties from the experienced programmer. Why does she arise? Consider below.

As in any programming language, there are predefined methods in the 1C platform that facilitate the life of developers. But the execution of these commands requires proper compliance Programming language syntax.

The most common errors when calling typical methods:

  • Record
  • Create
  • Connect
  • Connect.
  • Checking
  • PREVIEWFILE1C.
  • Read
  • Perform
  • Performance
  • Torture

Consider an example. We programmatically created a request (), passing into the "Text" parameters here such a fragment:

Get 267 video tutorials for 1C for free:

In the construct "where" we were deliberately mistaken, putting "and", but not speaking another condition. It is quite logical that 1C will not be able to cope with such a query and give an error:

(MODULTSANSA (21)): Error calling the context method (execute)

because of:

AND<>

Consider another example:

We transfer the erroneous code to the "Upgrade" handler of the "version of the programs" and try to record the directory programmatically. We see a mistake:

(Modulseance (8)): error when calling the context method (write)
Sampling. PREPARY OBJECT (). Write ();
because of:
Error when performing a handler - 'overwrite'
because of:
(Directory. Modeles. Modulekject (20)): Error calling the context method (execute)
RESULT SUPPLY \u003d Query. Fill ();
because of:
((13, 4)): syntactic error
AND<>

Despite the fact that the error is to perform the "Run" method, the system swears on the line of code where the object is called.

Solution to the problem

To solve the problem, it suffices to understand what the error is. In 99% of cases, the problem is solved by banal reading certificates and analysis of the problem.

In order to learn how to enjoy this or that method, it is enough to establish the cursor on the functions you are interested in and press "Ctrl + F1". 1c platform will give you a contextual prompt according to the desired method:

Check the parameters transmitted to the function and the correctness of its use.

Faced with such an error, when displaying information on the printed form, the platform displays the following message:
Error when calling a context method (checking) ...

Check () - This is a method tabular documentwhich checks whether the tabular documents can be switched to the page when printing. In this method, this method, the 1c platform developers immediately wrote that if there were problems with obtaining information about the current printer (for example, a single printer was installed in the system), an exception will be caused.

I checked the installed printers, everything is fine and works. Empirically found out that this error There is only a concrete printed form And only under one user.

The error decided by the following actions (to perform a user who has an error):
1) created an empty document that the method of checking () was not involved in the formation of the printed form. If this method is in any case is called, you will have to find it in the configuration and comment on, or put in the design Attempt-exclusion-ending.
3) For the current printed form, the page parameters opened and set the correct parameters.

3. Parameters page
The error occurred due to the wrong page parameters, which the platform saved earlier when the printed print form is displayed, for example: the platform has saved in the printer's page parameters, which later deleted and installed new. Printing page Parameters are stored in the Table Document property. Keyproof printing. This property contains the key of the value in which the printing parameters are saved. Print parameters, configured and saved with this key, are subsequently restored at the next table show.

What this error does not occur due to incorrect page parameters, property Keyproof printing It should not be installed at the beginning of the print output procedure, and at the end, since when installing this property, the print parameters are immediately restored.

UPD 04/10/2015: If installing property Keyproof printing at the end of the formation of a tabular document, then the method Checking will use print parameters default, not custom. To avoid this situation, you must install the property. KeyAdrametreSystem At the beginning of the formation of a tabular document, and the method Checking Place an attempt attempter in the design of an exception.

Errors when using one or another program are found different kinds. Of these, there is a whole series - which arise in our fault. Consider how to correct the error in the conclusion of the context method in 1C, which arises as a result of non-compliance with the rules and methods of context.

Understanding the principles of functioning of the context method will help avoid errors when working in 1C.

Any software Architectural consists of modules (module, eng.), parts. And their location is shown in the picture:

Software modules, in turn, consist of sections:

Context (CONTEXT, English) is one of the most important concepts in programming. In 1C under it it is understood as the environment of the module and its partitions - which variables, properties, objects, method (method) and events can be available at each specific point. IN different points Context is usually another.

The developer (modification) must understand - which contextual properties have a point and which method is available for use in it.

In the eight, contextual types are highlighted:


Basic are the basic four rules for access procedures, variables, and F-Qiys in modules:

  • In general modular parts will not be available for exporting variables, procedures and f-systems of modular applications;
  • In modular applications there are access to export procedures and F-Qii shared modules;
  • For general mod. Parts open access to the export of procedures and F-Qii of other general modules;
  • For modular application objects and for modular forms, variables, functions and procedures of application modules for export and general modules are available.

If the main props are assigned to any form, then the context of this form will contain property and Method that meet this main props. For example, in the module forms for an element of the reference book, Method is available and object properties Directory reference. Namerenclature.

Illustration of the rules given in the diagram:

The arrows are indicated that one of the modular parts is given the ability to otherwise refer to their variables, functions and procedures for export. We remind you - in the general module there are no declarations of variables.

Failure to comply with the rules and methods of the program context

All programmers met with an error notification of 1C when calling a context method. Consider such an example:

Command errors

When creating a query in the directory in its "Text" parameter, a fragment was made:

In the construct "where" was introduced "and", but the condition itself remained indifferent.

The program's response was like this:

(MODSANSA (21)): Error when calling the context method (execute)
RESULT SUPPLY \u003d Query. Fill ();

How to find out the right method?

In order to get the 1c platform hint on how to use any Method, put the cursor to the desired function and press "Ctrl + F1". If errors occur, you need to check the parameters that are transmitted to the function, as well as the correct use of the function.

What is useful to know about errors

Finally, we will conduct a general analysis of errors in 1C. Any of them can be the cause of those who are devoted to the topic of the article:

  • Violation of both logical, so physical integrity of the information base;
  • User errors when contacting the platform;
  • Erroneously entered by the developer (improvement) code;
  • Human factor - for example, forgetfulness;
  • Emergency situations (lack of light, blizzard, rain, hail, hurricane, flood).

Hold an error analysis:

  • Compare Platform and Configuration Releases;
  • Read full text Posts to the end, some time to think and understand what the car wrote. Very often, people do not read such messages entirely. But it happens that it is at the end that it contains recommendations for its elimination;
  • Analyze how long it is and the circumstances of its appearance;
  • Is it possible to reproduce it;
  • Non-reproducible not yet occurring errors are usually not corrected;
  • Is the error from another computer or other user repeats. In this case, consider cleaning the cache, setting the right, cleaning user settings.

Additional about the causes of errors:

  • Part of the errors - this is the result of using non-license software (and Windows too);
  • The damaged platform is the most common example. Only one patch is able to hack the version of the platform. After which you can not detect the database (or license);
  • With a primary collision, it is worth looking for a solution in the search engine - it is possible to solve it already found by someone;
  • Watch out for the relevance of the configuration release (especially if the regulated reporting is rendered from them);
  • The relevance of the platform release - for each configuration recommended its release;
    All events occurring in 1C are recorded in the technological journal!
  • Before starting some action with the base, you must make an archive copy!

Now you know what context is why there are errors associated with it, how to analyze errors in 1C and how to solve them.

Leave your feedback in the comments.

Share