I figured out this code where I send id and message via params, but i need ONE single note related to multiple records, not a note for each record
public static void crearNotas(String casoid, String mensajenota){
//creamos notas para los casos relacionados
System.debug('Nota creada para el caso: ' + casoid + 'con el mensaje: '+ mensajenota);
ContentNote objCntNote = new ContentNote();
objCntNote.Title = 'Casos Relacionados';
objCntNote.Content = Blob.valueOf(mensajenota);
insert objCntNote;
//Creamos ContentDocumentLink hacia el id del caso
ContentDocumentLink objCntDocLink = new ContentDocumentLink();
objCntDocLink.LinkedEntityId = casoid;
objCntDocLink.ContentDocumentId = objCntNote.Id;
objCntDocLink.shareType = 'V';
insert objCntDocLink;
}
Thank you :D