I am not able to make this query work, I don't know how to use the WHERE NOT IN clause. Can anyone please help me with this? I will appreciate any help. Thank you!
First approach:
existingTasks = [Select Subject From Task Where WhatId IN : existingServTaskLibrary ];
for(Service_Task_Library__c ta: [SELECT Id, Name from
Service_Task_Library__c WHERE Service__c IN : selectedServices And
Subject__c NOT IN: existingTasks Order by Service__c ASC])
{
.. do something
}
Error first approach
Invalid bind expression type of Task for column of type String
Second Approach
for(Service_Task_Library__c ta: [SELECT Id, Name from
Service_Task_Library__c WHERE Service__c IN : selectedServices And
Subject__c NOT IN (Select Subject From Task Where WhatId IN : existingServTaskLibrary)
Order by Service__c ASC])
{
.. do something
}
Error for second approach:
Error: Entity 'Task' is not supported for semi join inner selects