You need to sign in to do that
Don't have an account?
Sascha Deinert
Invalid bind expression type of TaskRelation for Id field of SObject Task
Hello,
I need to query all related task of the current contact. But If I run my code below I get always an error: Invalid bind expression type of TaskRelation for Id field of SObject Task
What is wrong? :-(
Thanks,
Sascha
I need to query all related task of the current contact. But If I run my code below I get always an error: Invalid bind expression type of TaskRelation for Id field of SObject Task
What is wrong? :-(
List<Taskrelation> RelatedTaskIds = [select taskId from taskrelation where relationid = :currentRecordId]; for(Task a: [select Id, Subject, CreatedDate, Createdby.Name, Owner.Name, RecordType.Name, Status, Who.Name, Who.Id, What.Name from Task where Id In :RelatedTaskIds]) { wrapperList.add(new Wrapper(a, 'Task')); }
Thanks,
Sascha
If you create a map with a list of SObjects, Salesforce will automatically add the ID as the key for each record. Then use the keys of the map to filter your second query.
I use your code, but I get no results.
I run the code with the contact ID 0031x00001AnxgwAAB this is the content from the map relatedtasks1
But the Listtasks query doesn't work Any ideas?
Thanks,
Sascha