You need to sign in to do that
Don't have an account?
Malik Butler 5
Add multiple objects to class
I'm trying to add the opportunity and work order object to this apex class and I've tried everything but haven't had any luck. Any ideas?
public with sharing class CaseActivityController {
public List<Task> lstTask {get;set;}
public CaseActivityController(ApexPages.StandardController std)
{
Id AccountId = std.getId(); //Get AccountId
//Query on Task
Map<Id, Case> mapIdToCase = new Map<Id,Case>([Select Id from Case WHERE AccountId =: AccountId]);
//Query on Case Activity
lstTask = new List<Task>([SELECT CallType,Status,Subject,WhatId,ActivityDate,Description FROM Task WHERE WhatId IN: mapIdToCase.keySet() ORDER BY ActivityDate]);
}
}
public with sharing class CaseActivityController {
public List<Task> lstTask {get;set;}
public CaseActivityController(ApexPages.StandardController std)
{
Id AccountId = std.getId(); //Get AccountId
//Query on Task
Map<Id, Case> mapIdToCase = new Map<Id,Case>([Select Id from Case WHERE AccountId =: AccountId]);
//Query on Case Activity
lstTask = new List<Task>([SELECT CallType,Status,Subject,WhatId,ActivityDate,Description FROM Task WHERE WhatId IN: mapIdToCase.keySet() ORDER BY ActivityDate]);
}
}
Can you elaborate on the scenario that you are implementing to check further?
Looking forward for your response.
Regards,
Anutej
I need to be able to query tasks from accounts' related cases, opportunities, and work orders. This will display on the page layout so that users don't have to go to multiple pages.