How do I display/output a count of records by country (a shared picklist)?
if you know the code of country you can run (on server or on client) selectNumber API with query:
select count(1) from ... where country='DE'
Currently we do not have API which gives a list of all available picklist items, but we may add this in the future.
I just want a report of how many records I have in each country, not filtered by only one country.
I can easily make a chart that shows this, but I can't figure out how to do it simply to produce a report where I can view a table or excel.
My example does not filter records, it calculates number of records for given condition.
Ok, let me re-phrase my question.
What is the easiest way to produce a table, generated for an object with the "Location" attribute, with 2 columns: Country, NumRecords(that have row's country selected)
It's easy to do with the chart tool, I just select the X-axis as Country, and the Y-axis as "# of ObjectName"
This seems like a very simple output, am I complicating my request?
You may need to hard-code a list of countries (we currently don't have API for that). Than create server-side JavaScript, something like this:
var buff = "";
for (var k=0; k
var cnt = rbv_api.selectNumnber(
"select count(1) from Location where country='"+codes[k]+"'");
buff += "Counter for "+codes[k]+": "+cnt+"\n";
}
return buff;