This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 15, 2011, 5:29 PM
22 Posts
topic has been resolvedResolved

Replace "See attached file: ..." with link to attachment

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: regexp,attachment,replace
  • Replies: 1
I wrote a piece of code to replace the "See attached file: " string with a link to the underlying attachment.
 
function replaceSeeAttached() {
    var the_id = "entryBody";
    h=getComponent(the_id).getValue().toString();
    h=h.replace(/\<i\sclass=\"domino-attachment-ref\"\>\(.*\:\s(.+?)\)\<\/i\>/g,
    "\<a href=\"" + @Word(context.getUrl(),'.nsf',1) +
    ".nsf/xsp/.ibmmodres/domino/OpenAttachment/" +
    database.getFilePath().replace(/\\/,"/") + "/" +
    currentDocument.getDocument().getUniversalID() +
    "/body/$1\"\>$1\<a\/\> ");
    getComponent(the_id).setValue(h);
}
 
The code can be stored in a SSJS Lib and triggered by a call in the AfterPageLoad event
Jul 27, 2011, 1:28 PM
1 Posts
Re: Replace "See attached file: ..." with link to attachment
I tried with 8.5.1, but i don't know how to call the function. Can you please explain? Thanks a lot.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal