• chris.phoenix1.3911270665504087E12
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
We would like to write code for testing which fetches only a few records at a time, setting batchSize to 5 or 10 so we can test our queryMore code.

The API seems to be ignoring batchSize. Is this a known problem?

In the schema (version 29) I can see that Task has a field OwnerId with relationshipName = Owner and referenceTo = User. And I see that User has a childRelationship to Task with field = OwnerId.

So then I do 

select owner.id from task limit 1

and I get

{:queryResponse=>{:result=>{:done=>true, :queryLocator=>nil, :records=>[{:type=>"Task", :Id=>nil, :Owner=>{:type=>"Name", :Id=>"005d0000000yQjxAAE"}}], :size=>"1"}}}

Note that the :type of the :Owner hash is Name, not User.

And indeed, if I try to get a field that's in User but not in Name, it fails...

Rforce query? > select owner.latitude from task limit 1
{:Fault=>{:faultcode=>"sf:INVALID_FIELD", :faultstring=>"INVALID_FIELD: \nselect owner.latitude from task limit 1\n       ^\nERROR at Row:1:Column:8\nNo such column 'latitude' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.", :detail=>{:InvalidFieldFault=>{:exceptionCode=>"INVALID_FIELD", :exceptionMessage=>"select owner.latitude from task limit 1\n       ^\nERROR at Row:1:Column:8\nNo such column 'latitude' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.", :row=>"1", :column=>"8"}}}}

So...
1) Why does the schema lie?
2) What's the workaround, to actually get the User who owns the Task?

Bonus question: Why is there a relationshipName (as promised in the documentation) in the Account->Opportunity :childRelationships, but there is none in the Account->User :childRelationships? Without a relationshipName, there seems to be no way to do a nested query in SOQL.

(This is all with the rforce gem in Ruby, but I really don't think it's the gem's fault.)

In the schema (version 29) I can see that Task has a field OwnerId with relationshipName = Owner and referenceTo = User. And I see that User has a childRelationship to Task with field = OwnerId.

So then I do 

select owner.id from task limit 1

and I get

{:queryResponse=>{:result=>{:done=>true, :queryLocator=>nil, :records=>[{:type=>"Task", :Id=>nil, :Owner=>{:type=>"Name", :Id=>"005d0000000yQjxAAE"}}], :size=>"1"}}}

Note that the :type of the :Owner hash is Name, not User.

And indeed, if I try to get a field that's in User but not in Name, it fails...

Rforce query? > select owner.latitude from task limit 1
{:Fault=>{:faultcode=>"sf:INVALID_FIELD", :faultstring=>"INVALID_FIELD: \nselect owner.latitude from task limit 1\n       ^\nERROR at Row:1:Column:8\nNo such column 'latitude' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.", :detail=>{:InvalidFieldFault=>{:exceptionCode=>"INVALID_FIELD", :exceptionMessage=>"select owner.latitude from task limit 1\n       ^\nERROR at Row:1:Column:8\nNo such column 'latitude' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.", :row=>"1", :column=>"8"}}}}

So...
1) Why does the schema lie?
2) What's the workaround, to actually get the User who owns the Task?

Bonus question: Why is there a relationshipName (as promised in the documentation) in the Account->Opportunity :childRelationships, but there is none in the Account->User :childRelationships? Without a relationshipName, there seems to be no way to do a nested query in SOQL.

(This is all with the rforce gem in Ruby, but I really don't think it's the gem's fault.)

In the schema (version 29) I can see that Task has a field OwnerId with relationshipName = Owner and referenceTo = User. And I see that User has a childRelationship to Task with field = OwnerId.

So then I do 

select owner.id from task limit 1

and I get

{:queryResponse=>{:result=>{:done=>true, :queryLocator=>nil, :records=>[{:type=>"Task", :Id=>nil, :Owner=>{:type=>"Name", :Id=>"005d0000000yQjxAAE"}}], :size=>"1"}}}

Note that the :type of the :Owner hash is Name, not User.

And indeed, if I try to get a field that's in User but not in Name, it fails...

Rforce query? > select owner.latitude from task limit 1
{:Fault=>{:faultcode=>"sf:INVALID_FIELD", :faultstring=>"INVALID_FIELD: \nselect owner.latitude from task limit 1\n       ^\nERROR at Row:1:Column:8\nNo such column 'latitude' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.", :detail=>{:InvalidFieldFault=>{:exceptionCode=>"INVALID_FIELD", :exceptionMessage=>"select owner.latitude from task limit 1\n       ^\nERROR at Row:1:Column:8\nNo such column 'latitude' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.", :row=>"1", :column=>"8"}}}}

So...
1) Why does the schema lie?
2) What's the workaround, to actually get the User who owns the Task?

Bonus question: Why is there a relationshipName (as promised in the documentation) in the Account->Opportunity :childRelationships, but there is none in the Account->User :childRelationships? Without a relationshipName, there seems to be no way to do a nested query in SOQL.

(This is all with the rforce gem in Ruby, but I really don't think it's the gem's fault.)