We now have getRelationCountForDeletion API for this.
Attach a file by drag & drop or click to upload