"Customizing" links in a RichText field

Dear friends,

  I am working on a lotus notes database, that is hosted on a Lotus Domino server and presented on the Internet.
  The documents in this db contains RichText fields - that are the bodies of the Web pages. I am using different (!!) forms for editing these forms in Notes client and for displaying them on the Web.

  Now, what is the problem:

  When creating links in the RichText fields (by selecting a document, Edit->Copy as link to a document), they open the documents in the original forms (treated for use in the client program ONLY.)

  The links generated by domino are the following:
  Due to this the documents are opened in the mentioned form.

  What can I do to ensure that the documents should be openned in a form treated for the Web (they are stored in a text-field, called 'FormToOpen') ??



Note: I tried to realise it attaching a small JavaScript to the OnLoad event on the Web page, which changed the unique id of the original view to another view, where I changed the formula for the form name, that should be the documents open in). However this is not the right way because during the whole page loads (including all the pictures), user can click to a link and get to a page that shouldn't appear on the Web
Who is Participating?

Improve company productivity with a Business Account.Sign Up

CRAKConnect With a Mentor Commented:
In R4.x:
Open the view in design-mode, open the property-box (Alt+Enter or 1st smarticon), select 4th tab (yellow/red propellor hat) and press the button "Formula window".

In R5:
Open the view in design-mode, and select "Form Formula" in the events list in the lower half of your screen.

Enter something like:

  @Contains(@Userroles; $$WebClient");

I used to add 2 fields to each form: if a form was called nfABC (nf for NotesForm) that would be:
NotesForm = nfABC (identical to Form), and
WebForm = wfABC (wf = WebForm).
Naturally, in the webforms, Form would equeal WebForm...

Instead of "my....Form" in that formula, I would refer to these two fields!

Spread/divide the points (how?), assign 200 to either or both.... or increase points first.... I don't mind! It's up to you: you're the judge in this question!
May I suggest grade "A"?  ;-))
well if you use R5 it's easy you create 2 forms with the same name and in the design properties of the form you hide one for web users and one for notes users.
Have you tried the views form formula (R4: in the property box, R5: one of the events)? Add it to that default view that you use to open the document.
Based on @ClientType="Web" or "Notes", or @Userroles="$$WebClient" you can tell it what form to use for opening. You may have to check @IsNewDoc to, and direct it to e.g. @Unavailable...

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

That last option may prove important when creating new documents....
aegressyAuthor Commented:
  Your solution in Your answer is quite easy but very useful! I never tried this :-(

  I'm not using Notes for a long time - maybe that is the reason -; i didn't find the views form formula anywhere, could you please tell me, where can I find these events??

Sorry for the late answer!!


PS: I both of the proposed solutions will work, I think the best will be to spread the points to both of you; do you agree?
aegressyAuthor Commented:
Well, CRAK, I think you've a little missunderstood my problem (maybe it's my fault :-)

Openning documents through their links from a view on the Web I've solved the same way, you mentioned (the Web form was called FormToUse, but it is unimportant). I also used the 'Form formula' in the corresponding View.

The documents from the view are openned correctly, in the form assigned to use on the Web, BUT: the links inside of a richtext (contained by this document) refers to documents through the forms they was created in.
(I mean the links inside of a displayed document, not in a view.)


PS: Sorry for the late answer :-(
It SHOULD work! I used to do just that!

You've created a doclink in a document's richtext field to another document, accessed through a notes view.
If that same document (with doclink) is opened through the web, the browser follows the link through the original (notes) view to reach the linked document.
Although the view is not opened, the document is opened through it and the views form formula still determines how to open it (what form to use). In other words: that (notes) views form formula should tell -depending on the client- what form to use.

100% sure!

Would you like me to e-mail a demo? (might not be able to  over the week-end....)
aegressyAuthor Commented:

your solution really works correctly, I just had to create the old links again to refresh them (I thought that they are generated dynamically when the page is open, but the opposite is truth).

We can now close the question, considering the difficulty of your comment I suggest to spread the points to 150 for Crak and 50 for Martijnmulder, ok??


I don't mind.... it was your question and now you're the judge!
Is it possible to split points? Never tried it....
aegressyAuthor Commented:
Thanks for the advise, CRAK.

Martijnmulder, I've created a question with the promissed 50 pts for You, please propose an answer for the points...

You're welcome!
Thanks for the 4 x 200 pt!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.