Check my reply at
this forum post on how to accomplish this, although for a different property, with the Edit Info Fields batch tool and a script function. The second method, where it is explained how to put the needed info in a custom field and show it in the grid.
In this case you can use a ready available HasAttachments script function, so you just need to customize a custom field to hold the value and run the Edit Info Fields batch tool, writing [HasAttachments] at that respective custom field.
If instead of just the indication of the existence or not of attachments the actual count is preferable you can use a script function like this:
function AttachmentsCount() {
return CountAttachments(BatchFile.AttachmentRoot.Children);
}
function CountAttachments(Attachments) {
var n = 0;
if (Attachments) {
for (var i = 0; i < Attachments.count; i++) {
var attachment = Attachments(i);
if (attachment.AttType == 1 /*attFile*/ ) {
n++;
} else {
n = n + CountAttachments(attachment.Children);
}
}
}
return n;
}