D
D
Danil2020-06-04 17:48:22
1C-Enterprise
Danil, 2020-06-04 17:48:22

How to calculate the sum of two tabular parts?

There are two tabular parts in the directory, inside each there are fields Name, Quantity, Price, Amount.
To calculate the sum of two tabular parts, it was decided to first calculate the total amount of one, and then the second. To calculate each tabular part, I found such fields as TotalSum, if you add them to the form, you can see the sum of each of the tabular parts.

The question arose of how to add them together to get the sum of two tabular parts. I created the Price field (Number data type) for the lookup and tried to assign this field a value from the TotalAmount of one of the tabular parts (for example, from the tabular part of the Materials). However, I was unable to access the data in the TotalSum field.
I wrote like this:
Объект.Цена = Элементы.МатериалыИтогСумма;
But as a result, the Price field displayed only the value 0.

Can anyone tell me how to access the TotalSum field of the tabular section and take a number from there so that they can be added to calculate the sum of two tabular sections?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Nagibovich, 2020-06-04
@OnlyGoRush

The tabular part has a method Total("ColumnName")
So add the two results of these methods from each tabular part.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question