When executing the following code in an after insert trigger, I am getting the error
"System.QueryException: Invalid bind expression type of TransactionItem__c does not match domain of foreign key Class"
Integer myAggregate = [SELECT Count()
FROM TransactionItem__c
WHERE Transaction__c = :Trigger.new];
System.debug(myAggregate);
What could be wrong? Thanks.
Transaction__r.Id IN :Trigger.newMap.keySet()
(assuming the trigger is on Transaction__c object)