
I tried with writing a apex trigger on ContentDocumentLink. But I'm getting this below error.
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger ContentDocumentLinkTrigger caused an unexpected exception,
contact your administrator: ContentDocumentLinkTrigger: execution of AfterInsertcaused by: System.DmlException: Insert
failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ContentDocumentLinkTrigger: execution of AfterInsertcaused by: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION.