No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
TaskRelation
Represents the relationship
between a task and a lead, contacts, and other objects related to
the task.
TaskRelation allows a variable number of relationships, as follows:
- A task can be related to one lead or up to 50 contacts.
- A task can also be related to one account, asset, campaign, case, contract, opportunity, product, solution, or custom object.
Available in API versions 24.0 and later. Available only if you’ve enabled Shared Activities for your organization.
Supported Calls
create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), queryAll(), retrieve()
Fields
| Field Name | Details |
|---|---|
| AccountId |
|
| IsDeleted |
|
| IsWhat |
|
| RelationId |
|
| TaskId |
|
Usage
- See contacts associated with a task
1public void queryWhosOfTaskSample() { 2 String soqlQuery = "SELECT Id, Subject, (SELECT RelationId, Relation.Name, IsWhat from TaskRelations WHERE isWhat = false) FROM Task WHERE Id = '00T x0000005OKEN'"; 3 QueryResult qResult = null; 4 try { 5 qResult = connection.query(soqlQuery); 6 TaskRelation relation1 = (TaskRelation)qResult.getRecords()[0].getTaskRelations().getRecords()[0]; 7 }catch (ConnectionException ce) { 8 ce.printStackTrace(); 9 } 10 }