Count and sum fields from related items table
Is it possible to count the number of records in a related items table, and then use the total value to populate a form field e.g. 'Total Related Items'?
Also, is it possible to sum a number field from all related items and also use that totalised value to populate a form field, such as 'Total Hours'?
Also, is it possible to sum a number field from all related items and also use that totalised value to populate a form field, such as 'Total Hours'?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Here is how you can get data from the related items control:
where the first index is 0-based index of the Related Items control in a page, the second – index of the row in the Related Items control, and Title is the internal name of a field.
Just sum values from the required column and put it into a field.
Code: Select all
fd.relatedItems(0).data('ctx').ListData.Row[0].Title
Just sum values from the required column and put it into a field.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests