Add code to Lotus Notes view column

bobrossi56 used Ask the Experts™
New to programming in Notes. I have version 8.5 of Domino Designer. I created a simple 3 field form called cvt. One of the fields (author)is meant to capture the person creating the document so I used @Author and it worked but I got a lot of info after the name I did not want, so I changed the code to @LeftBack(@Author; "/") and now the form field simply just shows the persons name. Perfect.

My problem is when I created a VIEW called CVT to show these 3 form fields for each created document. For each column I tied the column to the form field so the view column Author is tied to the form field called author. When my users create new documents now and I use the CVT view, the author column has a long string of crap in it right after the name. if you open the document the form shows just the name, but in the view it shows more than just the name. How do I truncate all the crap after the name in the view? I am not sure how to add code to a view column, I usually just name the column, size its width and tie it to the form field name.
thx experts...
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
OK, what is the "crap" bit look like, /OU/OU/Organisation or o=OrgName and the like?

If you highlight a document in the view, pres Alt-Enter and you can see hte properties box for it.  Make sure it says "document" in the drop down and then in the second tab you can see a list of the fields in the document.  Highlight the one in question, what does it say?

Without going into (too) long boring details, a field created using the field type "Authors" is used to give whichever names are in there access to the document when their access through the ACL to the database as a whole is "Author".  If the users don't need to go back and amend, or they have "Editor" access to the ACL then storing the name in a "text" field or "names" field will suffice.

A function you may not know about is:


The first just gives the person's actual name, i.e. CName
The second gives shortened form, e.g. Steve Knight/org/Dragon as opposed to CN=Steve Knight, OU=Org, O=dragon etc.

So to answer your question check the field type and data in the field for starters.  If you don't need the editing functionality mentioned above and your organisation structure isn't important to record, then just create a field, make it "text" and "computed when composed" and @name([CN];@Author);  

If you add a formula to Translation formula as @name([CN];@ThisValue); then any existing documents when opened and re-saved will change to be the same.  Your view can then just show "FieldName" as the formula.  If there are lots of documents we can write an agent to update all existing documents if needed.

If it isn't clear or not sure once you see the properties for that field in Alt-Enter box post here - you can copy and paste the right hand side of the field details from that box as text to clipboard by highlighting and Control-C etc.

Good luck with domino programming, learned @formula over 20 years ago now with R3 of notes when it was all we had to use and it is very powerful what it can do with a few commands.



I used your "just create a field, make it "text" and "computed when composed" and @name([CN];@Author);" suggestion and it worked perfectly. I did not know about that. I will file it away for sure.
thanks again...BobR

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial