Hello!
I created an empty configuration and for command "import" I just took the code from another old application, and it does not work:
Code |
---|
Mode = FileDialogMode.Open; OpeningFileDialogue = New FileDialog(Mode); OpeningFileDialogue.FullFileName = ""; Filter = "Excel(*.xlsx)|*.xlsx|Excel 97(*.xls)|*.xls"; OpeningFileDialogue.Filter = Filter; OpeningFileDialogue.Multiselect = False; OpeningFileDialogue.Title = "Select file"; If OpeningFileDialogue.Choose() Then FilesArray = OpeningFileDialogue.SelectedFiles; For Each FileName In FilesArray Do Selection = New File(FileName); //Message(FileName+"; Size = "+Selection.Size()); EndDo; ImportAtServer(Selection.FullName); //UpdatePriceList(); Else DoMessageBox("File(s) not selected!"); EndIf; EndProcedure |
In the line OpeningFileDialogue.Choose() I get an error:
{Catalog.CustomersSite.Form.ListForm.Form(16)}: Error calling context method (Choose)
If OpeningFileDialogue.Choose() Then
because:
Cannot call synchronous methods on the client!
What's wrong?
Thank you for every advice!