Join a document in a dynamic list query and use its table section as a value table



The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Jul 31, 2014
Company:

Hello everybody,

I have two types of documents: Invoice and Payment

Payment contains a table section LineItems with an attribute of the type Invoice.

Payment
-LineItems
-Invoice
-...

Is it possible to join Payment to Invoice in a query of a dynamic list,
so that I can see all payment items regarding to the active row of invoices in a form table.
(directly in the list form)

e.g. the DataPath of the table would be: Items.ListOfInvoices.CurrentData.PaymentItems
where PaymentItems must be type of a ValueTable

I already know that i can create an event ListOnActivateRow of the Invoice form table,
do a query on the CurrentRow and fill a value table, but I want to know if there is an easier or more
efficient way to tackle this.

 
#2
People who like this:0Yes/0No
Administrator
Rating: 18
Joined: Dec 4, 2017
Company:

Dear Oliver,

The way you depicted is one of the two popular methods to achieve the goal you want. In this way, you fill a value table via a query to which you pass an invoice as a parameter. As a result, the query returns all the items for the value table at once.

Another way to achieve the same goal is to populate a dynamic list to which you pass an invoice as a filter parameter. The benefit of using dynamic lists is that every time you apply the filter, you can get the desired number of items rather than all the items at once.

Best regards,
Vladimir Gurov

1C Company support team
 
Subscribe