leonaressi / force-app-engine

Automatically exported from code.google.com/p/force-app-engine
0 stars 0 forks source link

Is 'count()' supported? #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I'm trying to retrieve the number of accounts in SFDC using the following code:

...
soql = 'SELECT count() FROM Account'
query_result = self.sforce.query(soql)
...

But the second line throws the following exception:

Traceback (most recent call last):
  File 
"/Users/manuelmartin/Google/GoogleAppEngineLauncher.app/Contents/Resources/Googl
eAppE
ngine-
default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/_
_init__.
py", line 499, in __call__
    handler.get(*groups)
  File "/xxxxxxxxxxxxxxx.py", line 29, in get
    query_result = self.sforce.query(soql)
  File "/Users/rhess/Documents/workspace332/force-app-
engine/python/beatbox/python_client.py", line 266, in query
    for r in res[_tPartnerNS.records:]],
  File "/Users/rhess/Documents/workspace332/force-app-
engine/python/beatbox/python_client.py", line 224, in extractRecord
    sObjectType =  sobjectType(r)
  File "/Users/rhess/Documents/workspace332/force-app-
engine/python/beatbox/python_client.py", line 204, in sobjectType
    raise AttributeError, 'No Sobject element type found'
AttributeError: No Sobject element type found

Original issue reported on code.google.com by manuel.martin.aguilar on 12 Dec 2008 at 12:40

GoogleCodeExporter commented 9 years ago
good catch, i don't think this was tested.  it looks like the return object has 
not detected that an integer was 
returned instead of a list of objects.  You may have to just return the list 
and then use a list count method in 
python until this can be fixed.

Original comment by vneh...@gmail.com on 14 Apr 2009 at 1:33