rbf_getCount syntax

Posted by Rollbase User on 15-Jun-2012 12:06

I am trying to use rbf_getCount on a View Object portal page. I want it to return then number of records in a view from this page. I keep getting a result of "NaN". Can you please take a look and let me know your thoughts? Thanks!

All Replies

Posted by Admin on 15-Jun-2012 17:05

Please verify that 266089 is valid Original ID of View.



I just tried this API using onload script (from page's properties) and it seems to work fine.

Posted by Admin on 15-Jun-2012 20:25

Pavel,



This script is on a portal View object page. Can you use this API on that type of page? Also I used the Original ID of the view shown on the page. See below.



Posted by Admin on 15-Jun-2012 21:43

Hi,



Have you though of using a formula field instead to compute for the count of records in a list? This will ensure that the formula returns a value as opposed to client side calls.



This might be easier as you have to use a token instead of having to query.



e.g Number("{!count_of_related}") > 0



Where count_of_related is a formula field counting the related records.



Piscoso,Martin

Rollbase

Posted by Admin on 15-Jun-2012 23:50

Hi Parker, It looks like you used the "Cell ID" -- that is not the original ID of the View but rather the original ID of that page component. To get the original ID of the View:

1. Go to the Object definition

2. Scroll down to the Views section.

3. Click on the name of the View you are looking for the original ID of

4. You will see an "Original ID" field for that View. Use that #



Hope this helps,

Matt

Posted by Admin on 15-Jun-2012 23:50

Hi Parker, It looks like you used the "Cell ID" -- that is not the original ID of the View but rather the original ID of that page component. To get the original ID of the View:

1. Go to the Object definition

2. Scroll down to the Views section.

3. Click on the name of the View you are looking for the original ID of

4. You will see an "Original ID" field for that View. Use that #



Hope this helps,

Matt

Posted by Admin on 16-Jun-2012 09:01

Martin,



My original intent was to use a formula but I need the formula to count the related records just for the current visitor. For some reason no matter what I do with the formula, it can't seem to get return the # of related records just for that person. I am guessing that it has something to do with the formula being computed on the rollbase side then returning the value to the portal page instead if it computing on the portal page (where it could use the current user value).



The relationships are like this:

Evaluation=>Evaluators (one-to-many)

Evaluation=>Evaluation Records (one-to-many)

Evaluator=>Evaluation Records (one-to-many)



Matt - I also tried the ID from the object....with the same result. I am going to test it on a different page type to see what happens.

Posted by Admin on 16-Jun-2012 09:24

Matt- I take back what I said above! When I went and got the original id from the object, I used the id shown in the object properties page (wrongly assuming it was the original id). I just went back in and checked and see there is another one and it works!!!



Thanks!



Martin- would still love to understand the intricacies of getting my formulas working

Posted by Admin on 18-Jun-2012 22:55

Great! Very glad this is working for you now

This thread is closed