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


Sep 11, 2018, 7:29 PM
20 Posts

Notes API to LotusScript link with computed formula in message body

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role: Administrator,Developer
  • Tags: Notes API,LotusScript,Computed Formula,Links
  • Replies: 3

Hello everyone,

Hopefully this is something simple.  I need to convert some message documents stored in a user database.  Just to keep it simple I will not go into all details as to exactly what I am trying to do.  I know there are examples out there on how to use Notes API in LotusScript but not exactly for what I am trying to do and I have not done anything quite like this in a while.

I need a LotusScript that will remove the message body and create a new message body with only this in the message:

Click here to go to the webserver.  Click

When they click on the link Click it should go to the following computed formula:

"http://"+@Environment("WebServer")+"/testpage/test.html"

Does anyone have anything close to this that would not mind sharing?

Thank you in advance

 

Sep 12, 2018, 2:24 PM
7 Posts
You don't need the Notes C API for this

I designed a feature like this when I worked on HP's email archiving product for Notes & Domino somewhere around 8 years ago.  It did not require the Notes C API.  It was an ordinary agent that did the work. Our agent was written in Java, not Lotusscript, but this part easily could have been LotusScript. 

We did it by creating a configuration document containing a rich text field, where the rich text field contained a hotspot that already contained the formula that computed the URL.  The formula referenced items that our agent would add to the (mail) document in order to build the specific URL that pointed to the archived version of the document in our (non-Notes/Domino) storage system. The agent simply used the NotesRichTextItem.AppendRTItem() method to copy that prototype rich text into the mail message's rich text.  We used Append because we (optionally) left the first few lines of the original email message in there. It would work just fine if we stripped the original message text entirely, and we did support that option, too.

If I recall correctly, we used hide-whens to activate different links for Notes client and browser users. I think it was a computed hotspot link for the Notes client and computed text marked as pass-thru HTML for the browser users, but I won't swear to that. I also recall that we had to deal with some sort of workaround for a security feature in DWA that blocked "active content", making our links for browser users fail.  There was, if I recall, a notes.ini setting to disable that.

Hope this helps.   

Sep 12, 2018, 9:34 PM
20 Posts
Thank you Rob, that is interesting but not sure it will work for me...

Hello Rob,

That sounds like a good work around for the same issue but for my problem the environment variable is stored in each user's mailbox database for the server they need to connect to and this can change.  So I need the email message bodies in their mailbox databases to have the URL link with the computed formula.  This way every time they click the link it recomputes the correct link before making the connection to the correct address.  This will allow it to continue working if the address changes.

I appreciate the idea and might be something to consider using in the future if a slightly different scenario.

Thank you,

Larry

 

 

Sep 13, 2018, 5:12 PM
202 Posts
Why won't Rich's solution work?
The formula would be a computed for display, which means it's calculated when displayed, Rich's solution doesn't hard code the results of the formula.  It copies a Rich Text Field with the computed for Display formula in it.

The way I have approached this in the past, is to actually use NotesDXL from within Lotusscript, that way the RichText content body was modifiable by search and replace within Lotusscript. This is the code that got me started doing it that way http://www.nsftools.com/tips/NotesTips.htm#richtextbutton

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