#CALC_SUM not recognized in gauge formula

Posted by wytkat28 on 16-Sep-2014 12:07

I built a gauge on the Opportunity object. I'm clearly missing something as this simple formula is erring...

var total_user = #CALC_SUM ( Contract_Users__c | StageName == "Closed - Won");
return total_user;

Error illegal character (line #2) in formula:
function wrapper() {
var total_user = #CALC_SUM ( Contract_Users__c | StageName == "Closed - Won");
 return total_user;
}
wrapper();

Contract_Users__c is an integer field. 

When I try to add the Object's integration name to change formula to #CALC_SUM.opportunity (... I receive the error...

Cannot find relationship opportunity

According to Chapter 6 of documentation, 

You can also run Group Functions on the entire set of an Object’s records. For that use the Object’s integration name instead of a specific Relationship name, such as:
#CALC_SUM.invoice( amount | true )

So this should work, right? What am I missing?

All Replies

Posted by Gian Torralba on 16-Sep-2014 12:14

Hello,

Please try using "=" instead of "==" for comparing values inside the #CALC_SUM API.

Thank you,
Gian

Posted by wytkat28 on 16-Sep-2014 12:17

Thanks for the quick response. I made the change, but it still throws the same error.

Posted by Gian Torralba on 16-Sep-2014 12:21

Hello,

Please add the object name to the API.

var a = #CALC_SUM.object_name( 1 | name="Value");

Thank you,
Gian

Posted by wytkat28 on 16-Sep-2014 12:28

And that's when I get the... Cannot find relationship opportunity  error. In this case both the object name and integration name are the same.

Posted by Gian Torralba on 16-Sep-2014 12:34

You are correct. You will use the object's integration name for the #CALC_SUM API. If you are using the calc_sum on the same object, please use the object's integration name. If you are using it to sum up the related object's value, please use their relationship name.

#CALC_SUM.RXXXX( 1 | true ) /*for related calc_sum*/
#CALC_SUM.object_integ_name( 1 | true ) /*for same object calc_sum*/

Thank you,
Gian

Posted by wytkat28 on 16-Sep-2014 13:27

That's the kicker. I do have the object integration name, but it's still throwing the 'Cannot find relationship [my integration name]' error.

Posted by Gian Torralba on 16-Sep-2014 13:49

Can you try doing a simple CALC_SUM in the object you're using just to verify what is causing the problem? I just tested both of the syntax and it works on my end. May I also know what Rollbase version are you using? I tried it in 3.x and it works fine.

Posted by wytkat28 on 17-Sep-2014 08:53

Got to love this. Came in this morning, logged back in, changed nothing and it worked. Only difference was a server restart last night after some change was put in place. Can only imagine what that was. At least I know I'm not crazy. Thanks for working through it with me though.

Posted by Gian Torralba on 17-Sep-2014 10:12

No worries. Glad that the server restart helped. Let me know if you need anything else.

Thank you,
Gian

Posted by murali on 08-Jan-2015 14:50

Hi, What version of Rollbase are you using?
 
[collapse]
From: wytkat28 [mailto:bounce-kwhitedmsicom@community.progress.com]
Sent: Wednesday, September 17, 2014 9:54 AM
To: TU.Rollbase@community.progress.com
Subject: RE: [Technical Users - Rollbase] #CALC_SUM not recognized in gauge formula
 
Reply by wytkat28

Got to love this. Came in this morning, logged back in, changed nothing and it worked. Only difference was a server restart last night after some change was put in place. Can only imagine what that was. At least I know I'm not crazy. Thanks for working through it with me though.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

This thread is closed