Answer

Best method is to create an input checkbox named %%Detach. See: []Steve Cochrane’s note[].

Here’s my final solution:

@If (@Attachments = 0; @Return(“”); “”);

ThisDb := @WebDbName;

att := @AttachmentNames;

@Implode(“<input type="checkbox" name="%%Detach" value="”+att+“">”);

checkbox := @If(@IsDocBeingEdited; “<input type="checkbox" name="%%Detach" value="”+att+""> "; “”);

res := @Implode(checkbox + “<a href="/” + ThisDb + “/($vAllByUnid)/” +

@Text(@DocumentUniqueID) + “/$file/” + @AttachmentNames + “" target=attachmentwindow>” +

“<span style="font-family:arial;font-size:8pt;color:blue;text-decoration:underline;">” +

@AttachmentNames + “
” + @NewLine;

“”);

“” + res + “”