Object Reference for the Salesforce Platform
Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
TaskWhoRelation
TaskWhoRelation allows a variable number of relationships: one lead or up to 50 contacts. Available only if you’ve enabled Shared Activities for your organization.
Supported Calls
describeSObjects(), query(), retrieve()
Fields
| Field Name | Details |
|---|---|
| AccountId |
|
| RelationId |
|
| TaskId |
|
| Type |
|
Usage
Here's a Java example that queries contacts associated with a task.
1public void queryWhosOfTaskSample() {
2 String soqlQuery = "SELECT Id, Subject, (SELECT RelationId, Relation.Name, IsWhat from TaskWhoRelations) FROM Task WHERE Id = '00Tx0000005OKEN'";
3 QueryResult qResult = null;
4 try {
5 qResult = connection.query(soqlQuery);
6 TaskWhoRelation relation1 = (TaskWhoRelation)qResult.getRecords()[0].getTaskWhoRelations().getRecords()[0];
7 } catch (ConnectionException ce) {
8 ce.printStackTrace();
9 }
10}