X
X
Xris2022-01-28 06:27:31
1C
Xris, 2022-01-28 06:27:31

How to transfer the selected lines to another document when creating on the basis?

How to transfer only the selected lines to the document when creating on the basis?61f36259eaeb7167171911.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin, 2022-01-28
@Xris

A separate command is written. Through the typical "input on the basis" will not work.
In the command, catch the form data and send it to create a document.

ПараметрыФормы = Новый Структура("Основание", Объект.Ссылка);
ОткрытьФорму("Документ.ПриходТовара.ФормаОбъекта", ПараметрыФормы);

At the same time, the Fill Processing procedure in the object module will run and, accordingly, the filling algorithms that are described in it.
Either you describe the creation of the Document in code, without entering on the basis.
If "Select" goes as an attribute of the object i.e. saved in the document. Then, at the level ProcessingFilling, describe the processing.

D
Dmitry Kinash, 2022-01-30
@Dementor

Let's start with the fact that the problem is solvable, but the formulation is strange. Input on the basis is a standard platform mechanism that can be called either from the document form, or from the document list form, or even programmatically from the code. And each time the same object module handler is used - FillProcessing. Only in the second and third cases there will be no selected lines.
Why did such a strange task appear? Why does the user want to transfer random lines to a new document and not record this fact in the system? Could it be that out of 10 lines, the user selected 7, but on one line he made a mistake and clicked twice, as a result of which only 6 lines went into work, and he did not notice until it was too late ..?
1) A smart decision would be to immediately save the marks of the selected rows in the document when writing it in the tabular part, and then, when entering on the basis, we are already working with these marks.
2) If there is a scenario that a certain boss works with a document and creates tasks in parts for his subordinates, then using standard input based on is not correct - you just need to create a command on the form that will use the selected lines and when creating a new document, it can even use it to programmatically fill from stdin based on.
3) If I don’t understand something and you need to do it exactly as it is written, and you also have the courage to break the BSP, then everything is also very simple. In the PluginCommandsClient module, in the ContinueExecutingCommands procedure, in the Context parameter, there is an open form in which line selection is available for the form element. Here you need to insert your code, so that if the desired type of document is caught and the form of an object with selected lines is passed, then we form a structure where we pass a link to the document and an array of line numbers. Next, in the Fill Processing handler of the filled document, we check the type of the incoming parameter of the base, and if our structure is there, then we fill it in standardly by reference from the structure attribute, and transfer only the lines specified in the array to the tabular part.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question