You need to sign in to do that
Don't have an account?
Jonathan Wolff 7
Error in Apex trigger code: IN operator must be used with an iterable expression
Hello, a developer helped me creating a apex trigger, but i still have the error: IN operator must be used with an iterable expression
Could you tell me how to fix this error? :)
Could you tell me how to fix this error? :)
trigger ContentDocumentIdTrigger on ContentDocumentLink(after insert){ map<id,id> parentids = new map<id,id>(); for(ContentDocumentLink cdl:trigger.new){ parentids.put(cdl.LinkedEntityId,cdl.ContentDocumentId); } List<Mediathek__c> ContentDocumentIdupdate = new List<Mediathek__c>(); for(Mediathek__c mt:[select id, from Mediathek__c where id IN:parentids]){ if(parentids.containskey(mt.id)){ mt.ContentDocumentID__c = parentids.get(mt.id); ContentDocumentIdupdate.add(mt); } } update ContentDocumentIdupdate; }
try with below code.
If this helps, Please mark it as best answer.
Thanks!!