How to sum values of a field on records

Posted by lCira9 on 13-May-2014 01:59

How do you sum the values of the currency fields on the list of records? I tried #CALC_SUM.collection( 1 | true ) but I don't know how it works. I have a Collection table, it has an Amount to Collect currency field.

Posted by Sharavan Kumar on 14-May-2014 04:39

Hi

As of now formula fields are read only  and group function will not work on them . As a work around , you can use rbv_api.getfieldValue() api to fetch the values from formula fields and then do the operations that you would like to do .

thanks,

Sharavan

All Replies

Posted by Sharavan Kumar on 13-May-2014 02:24

Hi ,

You can create a formula field , and use the group function [tag:calc]_sum.collection(mycurrency | true) . which will SUM the value present in mycurrency field on the list of records.

How it works ? :  #CALC_SUM.R8011457( expression | condition )  will do SUM of expressions for records where condition is true. Here , Expression is mandatory and must be numeric. Condition is optional ( it defaults to true, so if you don't have a condition, all the records are counted).

eg: #CALC_SUM.invoice( amount | due_date>=YEAR );

Posted by gonzales.pgon@gmail.com on 13-May-2014 22:08

Hi Shkumar,

I was messing arround with the functions for sum of records. I used your approach with the group functions. I found out that sum would work only with numeric fields such as currency feilds. However, when I was trying to sum formula fields, it won't work. Are there any workarounds for this?

Posted by Sharavan Kumar on 14-May-2014 04:39

Hi

As of now formula fields are read only  and group function will not work on them . As a work around , you can use rbv_api.getfieldValue() api to fetch the values from formula fields and then do the operations that you would like to do .

thanks,

Sharavan

This thread is closed