📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

EDT vs Конфигуратор – или зачем 1С меняет рабочую среду (курс Профессиональная разработка в EDT)

Курсы-по-1С.рф11:37

Transcription

In this video, I wanted to show you why it is convenient when we work in 1C:Enterprise in the project mode and specifically with source files. Let's explore a bit of the help that the configurator itself gives us regarding, for example, all those cases when we need to rename functions or add a certain number of new parameters. You have some function, let's say we have a procedure in a general module, meaning a configuration has a general module, there is an extension that intercepts this general module. So, this is what we have in this configuration module, this is what we intercepted, it's simply in the extension, in the session parameters setup, this function is called, but so that some message is displayed, right? And this is an external data processor, meaning the form of an external data processor. Let's press F5, let's see what we will have. The system gives us message 22, which means that this part is called, meaning the extension intercepts this procedure, and accordingly, we output a two. And when calling the external data processor, we will have the same picture, we will also have message 2. Now, what do I want to do? I want to change something here, for example, and create a new parameter that we will call test 2. We update the system, we check, there are no errors. So, as a regular developer, I took and decided to add a new parameter to this function. As a responsible developer, I even went and opened, for example, large modules of various extensions, data processors, and so on, and everywhere I do a check, I press the syntax check button, there are no errors, great. As a very interested person, I go into the extension, I say applicability check, there are no errors. I say we have fully checked the configuration with the extension. Hooray! An error. But this error is related to the default language in the extension, which differs from the configuration. But this is completely unimportant, in fact. That is, as a developer, I can assume that there are no problems. I press F5, and that's it, and the system immediately catches me on errors. OK, let's press F5, let's look. So, an error in the general module 4, in general, an error is here where I call this procedure. The system is scolding me, saying that there are already two parameters here, not one. I say, okay, I am an obedient person, I write 2, I press F5, I see message 1, and I see that now the system is scolding me that now there is a problem in the extension. Great, and I extend the extension. Where is it? And the extension, here it is. I say it will be test 2. I launch it. Great, everything worked. Now, as a mega-responsible employee, I take the external data processor and all external data processors, I reopen them, and I do tests, and I see that the system is scolding me that I don't have the right parameters here. I put parameters here, OK, I save. And now I think you already guess what will happen. Well, the data processor will not work. Why won't it output a message? Because the event is OnCreateAtServer, yes, that's something I made a mistake. Well, it needs to be changed to OnOpen, for example, and then upon opening, a message will be displayed. But in fact, this plays no role for us. That is, the function was called, there was a message or not, it plays no role for us now. For us, the main thing is that everything has now worked. But look how many times I restarted the configuration, three, four, five times. And this is just one procedure in the configuration that I decided to rename. And I followed the recommendations of my development environment, which did not suggest anything to me and did not help me in any way. On the contrary, it even convinced me somewhere that everything is fine with you. And then we wonder why, when we give our data processors to our clients, nothing works for them. It turns out they forgot to put a comma or some other such terrible childish mistake. And this is all developer time. That is, yes, this is really all developer time. Now let's move on. This is not needed. I have exactly the same situation. I have a general module, in this module there is such a procedure with one parameter. An external data processor calls this procedure, and an extension that extends the procedure from the general module. Now I go into the general module that is in the configuration and add test 2 here. I save it. So, I saved it. Now validation is going on inside the configuration. Inside the configuration, the system has not detected anything. But as soon as I switch to the extension module, the system will immediately scold me and say that I have an error. So the system sees an error. If I switch to the external data processor form, the system will report to me, scold me, and say that there is an error. Unfortunately, now, due to some problems with the environment, it is here at the bottom in the configuration. We try to not always display errors so that we can be absolutely sure that everything is beautiful for us. We can do a project cleanup. At this moment, the system will do what? It will reset all caches and do a rebuild. And at this moment, we will see that our errors will appear there. Well, here, in fact, the first error has arrived now. When it reaches the external data processor, the second error will also be fixed. Well, you switch. In this way, look how many times I saved the launch of this configuration, our database. This is fine if it's a small database. If it's 1C:ERP, then what? I will really spend a lot of time on such elementary things. Well, let's not talk about that. Still, changing the number of parameters in a procedure is, well, it's like that, because people don't often change it randomly. This is one of the reasons why people don't change it often, because to make sure that all your data processors will work, you need to actually reopen them so that the system displays them at runtime and gives the corresponding errors that there are not enough parameters or something like that. In 1C:Enterprise, there are no such problems. Well, let's not limit ourselves to this for now. Let's look at one more moment that I really like, and I think it is very illustrative. It shows very well and qualitatively how friendly the configurator is to developers and helps us with development. Namely, let's take this external data processor. Here I have an external data processor, and I want to define some variable and say that this variable will be equal to the value that the function will return, and this value will be, say, t2. Let's do this simultaneously in 1C:Enterprise and in the configurator. Look at the beauty. In the configurator, I call test module, I put a dot, and the configurator suggests it to me. It even highlights it specially on the left and says that there is a function, that there is a procedure. Super. We open 1C:Enterprise. We open. So, we did this in the external data processor. So, here too, let's open the external data processor. We open the external data processor, we open the module. So, well, so that the system doesn't scold us, let's write something to it. And let's also call test module. And after pressing Ctrl+Space, this hint pops up. So, look, the system suggests that there is a function, it has these parameters, and it returns a structure. Here there is a procedure, it has these parameters. Now let's choose the function here. Immediately, the cursor becomes in the middle of the parentheses. I write something here, I press Tab, I press Tab, and the system jumps to the end of the line, and I put a semicolon. That's it, I've finished calling this function. We move to the configurator. Function name, Enter, OK. Now the system suggests to me that I have a parameter. I write parameter. Now I press the parenthesis, and now, when I press the semicolon, it means that I need to control the parenthesis in this particular case. This is not very critical when you clearly know how many parameters you have, or something like that. Otherwise, it's not very convenient because you have to jump between them and somehow go to the very end, guess where the end is, and so on. The system helps us more in this regard, namely in 1C:Enterprise. But that's not all. Here we have defined some variable temp. Let's declare and define this same variable temp here too. Now, if I write here and put a dot, what will the system give me? Nothing, absolutely nothing. Guess yourself. That is, yes. And to call this function, to dive into F12, to go here, to search for the key, to copy, to go here, to paste this key here, well, and then somehow work with it. What will I have in this case in 1C:Enterprise? I press a dot, and it happily tells me: you have a structure type, and here are all the properties that the structure has, and here are all the keys that are already defined for the structure with their types.