I hit this platform problem a while ago Why is this ContentNote trigger receiving 1 record at a time even though multiple records are being inserted?. But today I've hit it again and now I need a workaround.
It appears that
ContentNote is a facade over the ContentObjects. I am directly inserting
ContentNote objects. Does working with the underlying Content Objects instead (e.g.
ContentVersion) avoid the trigger problem? Or is there some other way to get triggers called in bulk for
(I'd like to stay with the trigger approach as customers are used to the synchronous behavior with (older) Notes and it would be good to get the Enhanced Notes behaving in the same way.)
Some context: a trigger is used to enforce editing rights (and generate some custom event records) and we have some deep clone logic that can result in many notes being copied at once. Querying and DML is needed in the trigger, so when that logic is invoked one record at a time for many records, governor limits are hit.