- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
08-29-2012 10:19 AM - edited 08-29-2012 10:22 AM
Are only the 'Name' object fields available when querying a relationship with a polymorphic key?
For example I can query the fields associate with the Name object from the Task object.
SELECT Id, AccountId, What.Id, What.Name FROM Task
However I retrieve an error: "No such column on entity 'Name'." when performing the following query which attempts to retrieve fields related to the specific object.
SELECT Id, AccountId, What.Id, What.Name, What.Amount FROM Task
I also attempted to query the Opportunity object directly which resulted in a different error: "Didn't understand relationship 'Opportunity' in field path."
SELECT Id, AccountId, What.Id, What.Name, Opportunity.Amount FROM Task
Are the 'Name' object fields the only fields available for this type of relationship?
Is it possible to query Opportunity, Campaign or Case specific fields from the Task object?
Note: This is using the query call through the SOAP API not the BULK API.