An unrecoverable error has occurred on the server 1c enterprise. Windows error: function execution error, we solve it in a minute. What does the execution error look like?

So what is the point of my article?

1. There is a server (x64), with Office 2016 (x64) installed, there is 1C 8.3.8 also x64 (meaning 1C server). Users connect through both the thin client and the web client.

2. There are a lot of standard contracts and invoices issued (prepared) by the sales department. There is a font, a paragraph, etc., of course, everything is designed in Word, Excel 2016 (x64), of course, there is no desire to draw all this in 1C, but there is a desire to shove it into ActiveDocument format layouts

The decision is banal, it seems :) , I will not describe the whole mechanism of how this is done, how data is filled from 1C into the ActiveDocument layout - I think you know this perfectly well without me. But in the course of the work it turned out that not everything is so smooth in the realm of COM objects, namely:

2. Which option is better to choose: ActiveDocument or BinaryData? Although for me it sounds like what to choose Vodka With Beer or Beer With Vodka :) . One fig, you need to fill the documents with data from 1C and transfer them to the Client.

Well, okay, let's skip the lyrics, I choose ActiveDocument, I will not describe the entire algorithm, I will simply list the "pitfalls" and their solution. All of the following is my personal fabrication and in no way claims to be the ultimate truth. Perhaps you have solved these problems or solve it differently.

1. Stone " the first". The SaveAs method does not work (for both MSWord and MSExcel). When trying to write BinaryData, 1C simply crashes. We look at the listing fragment:

MSWord = Layout.Get(); Attempt Document = MSWord.Application.Documents(1); Document.Activate(); //Next, somehow get the data and fill in the Word document //Get the path in the temporary directory to save the file there TimeName = GetTemporaryFileName(".docx"); Document.SaveAs(NameTime); //stone starts here MyDocumentInBinaryData = New BinaryData(NameTime); //well, here this stone knocks out 1C :) MSWord.Application.Quit();

Thanks a lot.

Create folders
C:\Windows\SysWOW64\config\systemprofile\Desktop
C:\Windows\System32\config\systemprofile\Desktop
solved the problem. Topic closed.

What is the reason? The reason is that the code

MSWord = Layout.Get();

Always invokes an instance of a COM object (x32) regardless of what bitness Office is installed. Have you ever wondered why files with the docx, xlsx extension cannot be inserted into the ActoveDocument layout

this can also be checked through the Task Manager, but the fact is that the ActiveDocument layout implicitly calls an instance of COM (x32) and therefore all further manipulations must be done taking this feature into account.

1. Either the server and all software must be x32. Then you don't need to do anything (in the sense of rewriting the code)

2. Either rewrite the code in such a way

// get the temporary file name TempFile = GetTemporaryFileName("doc"); // this code will exactly call a COM instance of the required bitness, in our case x64 Word = New COMObject("Word.Application"); word.displayalerts = 0; DocumentN = Word.Application.Documents.Add(); DocumentH.SaveAs(TimeFile,0); Word.Quit(); // then everything is as before Layout = PrintControl.PrintFormLayout("Document.Equipment Transfer Certificate."+LayoutName); MSWord = Layout.Get(); Attempt Document = MSWord.Application.Documents(1); Document.Activate(); // do something here, fill in the data // here we resave our file from COM x62 to COM x64 MSWord.Application.Selection.WholeStory(); MSWord.Application.Selection.Copy(); DocumentH = MSWord.Application.Documents.Open(TimeFile); DocumentH.Activate(); MSWord.Application.Selection.Paste(); DocumentH.SaveAs(TimeFile,0); DocumentN.Close(); msword = undefined; Exception // If an error occurs, error data is displayed and the object is closed. Info = ErrorInfo(); General PurposeClientServer.NotifyUser("Error - "+Information.Description+" error code - "+Abbr(Information.SourceString)); MSWord.Application.Quit(); End of Attempt;

I think everything is clear here, first we created a COM instance of the required bit depth, created an empty file and saved it to a temporary folder, then it works with COM x32, fills it with data and finally copies the contents of the entire document and saves it to a previously prepared file.

All the same, but only for Excel

TempFile = GetTempFileName("xls"); Excel = New COMObject("Excel.Application"); Excel.DisplayAlerts = 0; BookH = Excel.WorkBooks.Add(); SheetN = BookN.WorkSheets(1); BookH.SaveAs(TimeFile, -4143); Excel.Quit(); Layout = PrintControl.PrintFormLayout("Document.Equipment Invoice."+LayoutName); MSExcel = Layout.Get(); WorkbookH = MSExcel.Application.Workbooks.Open(TimeFile); SheetN = BookN.WorkSheets(1); Trying WBook = MSExcel.Application.Workbooks(1); Sheet = WBook.WorkSheets(1); Leaf.Activate(); // do something, fill with data from 1C MSExcel.Application.WorkBooks(1).WorkSheets(1).Cells.Copy(SheetN.Cells); BookH.Save(); BookN.Close(); Exception // If an error occurs, error data is displayed and the object is closed. Info = ErrorInfo(); General PurposeClientServer.NotifyUser("Error - "+Information.Description+" error code - "+Abbr(Information.SourceString)); MSExcel.Application.Quit(); End of Attempt;

Here you go " the first"Stone I solved, on an x64 server with Office x64, everything works like clockwork, no errors and no need to create any folders and everything.

A rock " second". code snippet

TempFile = GetTempFileName("xls");

there is not very good, because it is writing to the folder: "c:\Users\ what's there ....", in general, this folder is always blacklisted by all firewalls, antiviruses, etc., etc., at least open the Word Security Control Center or Excel. Let's look there too

you have to fiddle with it, otherwise there is a possibility of "strange" errors. Therefore, I suggest the following:

1. Open the Configurator and add a new Register of Information

here we will store our finished Word, excel files already filled, of course:

LayoutName - Layout ID

Office Document - Value Store, this is where we keep our finished file

2. We add the code written above as follows:

MZ =RegistersInformation.TemporaryStorageOffice.CreateRecordManager(); MZ.Object = Selection.Reference; MZ.LayoutName = LayoutName; MZ.Read(); MZ.Object = Selection.Reference; MZ.LayoutName = LayoutName; MZ.DocumentOffice = NewValueStorage(NewBinaryData(TempFile)); MZ.Write(); DeleteFiles(TempFile);

What we do, we write the finished file to the information register and then delete the temporary file itself, solve the "Word, Excel Security Center" problem. There is only one thing left to show this finished file to the Client (thin and web client)

3. Stone " the third" - transferring the file to the client, here I'll just post the whole code, I took something from the BSP, something from the "Managed Application" demo configuration, something from the Internet, but in general, here's the code (entirely)

/////////////////////////////////////////////////// ////////////////////////////// // SERVICE PROCEDURES AND FUNCTIONS OF BSP &AtServer Function GetLayout() ObjectReference = DataStructure.Object; LayoutName = DataStructure.LayoutName; RecordKey = DataRegisters.Office TemporaryStorage.CreateRecordKey(New Structure("Object,LayoutName",ObjectReference,LayoutName)); // Address = GetNavigationLink(RecordKey,"OfficeDocument"); Return Address; EndFunction // &OnClient Procedure AfterApplicationStart(ReturnCode, ApplicationName) Export; // EndProcedure &AtClient Procedure AfterFilesReceived(SubmittedFiles, AdditionalParameters) Export If NOT SubmittedFiles=Undefined Then For Each Description From SubmittedFiles Loop OpAfterApplicationStart = NewAlertDescription("AfterApplicationStart", ThisObject, Description.Name); StartApplicationStart(OpAfterApplicationStart, Description.Name); EndCycle; EndIf; EndProcedure &OnClient Procedure AfterDirSelect(SelectedFiles,CommandName) Export If FilesSelected = Undefined Then Return; EndIf; Directory = SelectedFiles; General PurposeCallServer.SaveWorkingDirectory(Directory); If CommandName = "Invoice" Then LayoutName = "Invoice" EndIf; DataStructure.Insert("Catalog", Directory); ConnectWaitingHandler("Connected_TransferFileToClient",5,True); EndProcedure &OnClient Procedure OpenFilesViaExtension(CommandName) OpAfterCatalog Selection = New AlertDescription("AfterCatalog Selection", ThisObject, CommandName); Directory = General PurposeCallServer.GetWorkingDirectory(); If Directory = Undefined OR Directory = "" Then Dialog = NewFileChoiceDialog(FileChoiceDialogMode.CatalogChoice); Dialog.Title = НStr("ru = "Select a directory for temporary storage of files"", "ru"); Dialog.Show(OpAfterCatalog Selection); Else SelectedFiles = New Array; SelectedFiles.Add(Directory); ExecuteAlertProcessing(OpAfterSelectingCatalog, SelectedFiles); EndIf; EndProcedure &OnClient Procedure HandleFileWorkingExtensionConnection(ExtensionConnected,AdditionalParameters) Export If ExtensionConnected Then OpenFilesViaExtension(AdditionalParameters.CommandName); EndIf; EndProcedure &AtClient Procedure Connected_PassFileClient() Address = GetLayout(); If Address<>Undefined Then DisableWaitingHandler("Connected_PassFileClient"); DocumentNumber = DataStructure.DocumentNumber; Directory = DataStructure.Catalog; LayoutName = DataStructure.LayoutName; PathToFile = Directory+"\"+LayoutName+"_#"+DocumentNumber+".xls"; Description = New Description of the File being Transferred(Path to File, Address); TransferredFiles = New Array; TransferredFiles.Add(Description); StartReceiveFiles(NewNotificationDescription("AfterReceivedFiles", ThisObject), TransferredFiles, "", False); EndIf; EndProcedure &AtServer Procedure ExecutePrintServer() ObjectReference = DataStructure.Object; LayoutName = DataStructure.LayoutName; DataStructure.Insert("DocumentNumber", ObjectReference.Number); ArrayObjects = New Array; ArrayObjects.Add(ObjectReference); Documents.InvoiceEquipment.PrintInvoice(ArrayObjects,LayoutName,True); EndProcedure &OnClient Procedure Connected_ExecutePrint() ExecutePrintServer(); EndProcedure // StandardSubsystems.Print &OnClient Procedure Connected_ExecutePrintCommand(Command) Reference = Items.List.CurrentData.Reference; DataStructure = New Struct; DataStructure.Insert("Object", Link); DataStructure.Insert("LayoutName", "Invoice"); ConnectWaitingHandler("Connected_PerformPrint", 1, True); CommandDescription = PrintControlClient.PrintCommandDescription(Command.Name,FormName); StartInstallingFileWorkingExtensions(); StartFileExtensionConnection(New AlertDescription("ProcessFileExtensionConnection",ThisObject,New Structure("CommandName",CommandDescription.Identifier)))); EndProcedure // End StandardSubsystems.Print

A few explanations:

1. Firstly, the client works for us both through Thin and Web modes, so we set the following values ​​in the Configurator properties in advance:

To avoid problems when working with the browser

2. We use wait handlers to avoid problems with call synchronism (this only applies to Web mode)

3. And finally, we connect the Extension for working with Files (remember that in the mode Thin Client, this extension is always enabled). And through code:

we transfer the file to the Client using the NavigationLink mechanism, we get the following messages in the browser (Slim works by itself):

Well, that seems to be all. Hope this helps someone...

Concerning Word, Excel files to insert in the form of BinaryData? what is the problem?

1. We either need to pull out these BinaryData from the layout and fill them with data from 1C and ATTENTION again write them in the form of BinaryData (Vodka With Beer or Beer With Vodka)

2. Either we must get the BinaryData layout on the Client side and fill it in there, BUT the COM object is supported only by the IE browser and then with dances with ActiveX settings, other browsers have long abandoned the use of ActiveX

I think that each of the programmers of the "sevens" at least once encountered such an error. It can occur either during "configuration merging" or during "IS testing and fixing".

But not everyone tried to "fix" the configuration. In such cases, they usually either frantically search for backups, or (in a more complicated way) resort to the help of the GComp utility, which "according to legend" can cure MD if it is simply "disassembled" and then "assembled" using the program functions. Indeed, it is. But not in all cases ... It is just such a case that I would like to analyze in this article.

So, initial data:

- "broken configuration";

Utility MDDiags

- Farmanager and plugin docfileBrowser to him. With this plugin, you can go inside the MD and work with its objects.

Since the Configurator even refuses to display this "fatal error", we run MDDiags to discover it or them.

After starting the utility, select the desired configuration, then all the default settings ... run, analyze, get the result.

You may have other errors, but I think that you will be able to deal with them when it is common understanding how to find the error and how to fix it.

1. Mistake>(\\Journal)

The utility made it clear that the error is observed for 2 objects "\\ Journal \ Journal _ Number 212" and "\\ Journal \ Journal _ Number 860". Now go toFar and look at the objects there.


We see here a lot of objects and one file "Container.Contents". It stores the descriptors of these same objects. After carefully examining the contents of the file, we understand that there are no descriptors for our 2 objects.

Add descriptors as shown in the figure.

Problem solved.

2. Error DOCUMENT.Invoice (\\TypedText\UserHelp_Number434\container.contents)

Let's go back to MD specified path. Opening the file container. content and take a closer look at its contents.

The strange words Cgntainer, Contentq, Prmgram immediately catch your eye. That's right, these are misspelled identifiers. It is not difficult to guess how it should be correct (if it is difficult, go to the next branch, open the same "Container.Contents" file and see how it should be written).

3. MistakeDIRECTORY.TypicalOperations(\\Subconto\Subconto_Number5870\WorkBook\Dialog Stream)

Open the file at the specified path and look carefully... All parameters must be enclosed in quotation marks. One of the parameters has a "space" instead of a "quotation mark" - fix it (this error can occur when the description of one of the object elements (fields, buttons, list of values, etc.) contains a single or double quote, or some from "special characters").

We start again MDDiags and see that everything previous mistakes disappeared, but another error appeared.

Now it's time to turn to the GComp utility and check the "legend"...

We launch the utility, select our broken (so far) MD, and the folder where we should put the configuration parsed by objects, then all the default checkboxes, the only thing is to check the "delete empty table templates" checkbox on the " Common parameters", click "Decompile".

Then, without further ado, go to the "compilation" tab, set as the source directory the one into which the configuration has just been parsed and specify the path to the new MD.

The utility will collect everything safely.

Now we are only left with Far Manager replace the corresponding file inside the "broken" DM with the same one from the "just built" one (\\Subconto\Subconto_Number5870\WorkBook\Dialog Stream).

Check the configuration again with MDDiags.

Everything seems to be OK. Now we go to the configurator and do "testing and fixing information security" to make sure that there are no more errors.

That's all. Allow me to bow out. And may the Force be with you!

P.S. Special thanks to the developers of the utilities used in the example - they help us all to live so much...

Good afternoon!. Last time, we figured out how to solve "Error applying transformations. Check the correctness of the paths of the specified transformations", today I will tell you about one more consequence because of it. The topic of the publication will be the situation when you cannot install the 1C platform and you will receive a message: Windows error: function execution error, we decide in a minute, I'm sure the topic will be useful for many.

What does the execution error look like?

As I wrote above, it occurs on my Windows Server 2012 R2 terminal server when I try to install the 1C 8.2 platform. After running the setup.exe file, the installation wizard window appears, and immediately an additional window with the message:

Windows error: function execution error

After which you will receive the following notification:

As in most cases with the 1C platform, everything is solved with a small fix in the configuration files. First, turn on the display of hidden folders, since the file we need is not visible by default. Next, on the C:\ drive, find the folder ProgramData.

C:\ProgramData\1C\1CEStat\1CEStat.cfg

The 1CEStat.cfg file can be opened with any text editor, right-click on it and select "Open with", and then an editor convenient for you.

Find the parameter in the 1CEStat.cfg file, you need to delete it and save the file.

If you look at the logs in the event viewer, then you will see the following events.

Event ID 1013: Product: 1C:Enterprise 8.2 (8.2.19.130) -- Windows Error: Function execution error.

Event ID 11708: Product: 1C:Enterprise 8.2 (8.2.19.130) -- Installation operation failed.

After we removed the ADMINISTRATIONFUNC=0 parameter, we got:

Event ID 1033: Windows Installer installed the product. Product: 1C:Enterprise 8.2 (8.2.19.130). Version: 8.2.19.130. Language: 1049. Manufacturer: 1C. Installation completed with status: 1603.

2023 wisemotors.ru. How it works. Iron. Mining. Cryptocurrency.