203 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Replay Webinar IBM JUMP Session: IBM Cloud Email Statistics
Fri, Nov 17th 2017 101
IBM Traveler 9.0.1.20 Available for Download on IBM Fix Central including Technote Support Feature Pack 10
Wed, Nov 15th 2017 149
Quick Tip: Read Text File - Compare View Values - Send Email Using LotusScript
Wed, Nov 15th 2017 68
Update Readers and Authors Fields Using LotusScript - Adding New Values
Tue, Nov 14th 2017 23
A Brief Reprieve - IBM Champion Nomination Period Extended
Mon, Nov 13th 2017 25
Replay Webinar IBM JUMP Session: IBM Domino Applications on Cloud
Sun, Nov 12th 2017 20
My IBM Champion Nominations for IBM Collaboration Solutions - Only a Few Days Left!
Thu, Nov 9th 2017 9
Top 10
IBM Traveler 9.0.1.20 Available for Download on IBM Fix Central including Technote Support Feature Pack 10
Wed, Nov 15th 2017 149
Replay Webinar IBM JUMP Session: IBM Cloud Email Statistics
Fri, Nov 17th 2017 101
Quick Tip: Read Text File - Compare View Values - Send Email Using LotusScript
Wed, Nov 15th 2017 68
IBM Domino and IBM Notes 9.0.1 FP7 available for download on IBM Fix Central
Tue, Sep 13th 2016 25
A Brief Reprieve - IBM Champion Nomination Period Extended
Mon, Nov 13th 2017 25
Update Readers and Authors Fields Using LotusScript - Adding New Values
Tue, Nov 14th 2017 23
Using Bootstrap Dual Listbox a Responsive Dual Listbox Widget in XPages
Wed, Oct 12th 2016 21
Replay Webinar IBM JUMP Session: IBM Domino Applications on Cloud
Sun, Nov 12th 2017 20
Using iziToast an Elegant, Responsive, Flexible and Lightweight Notification Plugin in XPages
Fri, Jul 21st 2017 16
Using the Bootstrap 3 DateTime Picker Plugin including Moment.js and Locales in XPages
Wed, Jun 3rd 2015 15


Update Readers and Authors Fields Using LotusScript - Adding New Values
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
   


During the past months I have worked a lot with LotusScript. One of the questions I came accross was how to add a value to a Readers or Authors field in the UI document using LotusScript. First a little background information. In daily practice, I make extensive use of Userroles in the Access Control List which are assigned to specific User Groups in the Access Control List. Based on these Userroles document access is granted based on these Userroles in the Authors and Readers Fields in the specific document.
Basic idea is to grant Edit or Read Access to specific User Groups depending on where the document is located within a certain workflow. More on that in one of the next blog posts.
In this specific case there was a value missing whereby certain groups of users were unable to read the documents.
In the example below my solution, in which the Readers Field including the new Value is stored back to the UI document using LotusScript.
Note: In the example below I get the values (uidoc.Document.GetItemValue) of two fields, Username and OrganizationalUnit, from the selected UI document in a View and add these values to a Readers Field.
The LotusScript Agent with the following code I use on selected documents in a Notes view to update the Readers (or Authors) fields.


Sub Initialize
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim fieldValue As Variant
Dim fieldValue2 As Variant

' check if document is selected
If Not ws.CurrentDocument Is Nothing Then

' document is selected
Set uidoc = ws.CurrentDocument' init
End If

fieldValue = uidoc.Document.GetItemValue("FIELDNAME1")
fieldValue2 = uidoc.Document.GetItemValue("FIELDNAME2")
Dim item As NotesItem
Dim readersList(4) As String
readersList(0) = "[USERROLE]"
readersList(1) = fieldValue(0) '@UserName
readersList(2) = "[USERROLE]"
readersList(3) = "[" & fieldValue2(0) & "Reader]" 'OrganizationalUnit Reader(s)
'readersList(4) = "[USERROLE]"
readersList(4) = "[NEWUSERROLE]" ' New Value

'readers
If uidoc.Document.HasItem("Readers") Then
Set item = uidoc.Document.GetFirstItem("Readers")
Call item.Remove
End If
Set item = New NotesItem(uidoc.Document, "Readers", readersList, READERS)

' save document
Call uidoc.Document.Save(True, True)

End Sub

A quick and easy solution using LotusScript.

---------------------
http://xpagesandmore.blogspot.com/2017/11/quick-tip-update-readers-and-authors.html
Nov 14, 2017
24 hits



Recent Blog Posts
101
Replay Webinar IBM JUMP Session: IBM Cloud Email Statistics
Fri, Nov 17th 2017 7:23a   Johnny Oldenburger
On November 15 there was a very interesting IBM Jump Session, IBM Cloud Email Statistics. JUMP stands for Join, Understand, Master and Participate. The presentation, audio and video are now available on the IBM Support website. Content IBM Cloud Email Statistics is a SaaS offering, providing customers with a variety of data insights on the long term use of their IBM Cloud eMail services (IBM Verse, SCN) through an intuitive graphical dashboard. In this session you will be introduced to the offe
149
IBM Traveler 9.0.1.20 Available for Download on IBM Fix Central including Technote Support Feature Pack 10
Wed, Nov 15th 2017 6:05p   Johnny Oldenburger
Today IBM released IBM Traveler 9.0.1.20. IBM Traveler 9.0.1.20 is a maintenance release that provides new features and APAR fixes for the IBM Traveler server. The information below outlines the changes included. IBM Traveler 9.0.1.20 does not include a database schema update. However, if upgrading from a version prior to 9.0.1.15 and running MS SQL Server, or if upgrading from a version prior to 9.0.1.16 and running DB2 Server, action may be required if you manually manage your database schema
68
Quick Tip: Read Text File - Compare View Values - Send Email Using LotusScript
Wed, Nov 15th 2017 4:19p   Johnny Oldenburger
Today I was asked if it was possible using LotusScript to read a Text File, which was stored in a specific Folder on the system, subsequently perform a check, based on the Values in the Text File, or a Value in the Text File is present in a specific View in the NSF and finally place the found Values in a Folder in the NSF and send an email with the found Values in the Folder to a specific email address. The above can be solved easily by using LotusScript. Agent Read Text File To solve the above
24
Update Readers and Authors Fields Using LotusScript - Adding New Values
Tue, Nov 14th 2017 6:31a   Johnny Oldenburger
During the past months I have worked a lot with LotusScript. One of the questions I came accross was how to add a value to a Readers or Authors field in the UI document using LotusScript. First a little background information. In daily practice, I make extensive use of Userroles in the Access Control List which are assigned to specific User Groups in the Access Control List. Based on these Userroles document access is granted based on these Userroles in the Authors and Readers Fields in the spec
25
A Brief Reprieve - IBM Champion Nomination Period Extended
Mon, Nov 13th 2017 12:49p   Johnny Oldenburger
The period for the nominations for IBM Champion has been extended until 30 November! This is great news. The extension offers everyone the opportunity to submit their nominations for which the original deadline was too short. For me, this means that I can submit two more nominations for which I had no time left. Just great! Thanks for this opportunity. Read the blog post by Libby Ingrassia for more information. See also my previous blog post, Become an IBM Champion - My Thoughts And Consideratio
20
Replay Webinar IBM JUMP Session: IBM Domino Applications on Cloud
Sun, Nov 12th 2017 12:37p   Johnny Oldenburger
On November 8 there was a very interesting IBM Jump Session, IBM Domino Applications on Cloud. JUMP stands for Join, Understand, Master and Participate. The presentation, audio and video are now available on the IBM Support website. Content IBM Domino Applications on Cloud is a subscription service that offers IBM hosted solution for Domino Apps over IBM Bluemix Cloud. The service offers a structured and planned migration process, avoiding business disruptions. In this session you will be intro
9
My IBM Champion Nominations for IBM Collaboration Solutions - Only a Few Days Left!
Thu, Nov 9th 2017 2:57p   Johnny Oldenburger
This week is the final week to nominate, among others, an IBM Champion for IBM Collaboration Solutions (ICS). In this blog post I will not give a complete summary of my IBM Champion nominations but only of those who have made, in my opinion, a 'significant contribution' to the community during the past year. As I mentioned in my previous blog post, Become an IBM Champion - My Thoughts And Considerations, it was not as easy as the last few years. This year I looked and interpreted the terms to
11
Comparing, Replacing and Restoring Design Elements with Local History using the Text Compare Editor in Domino Designer
Thu, Nov 9th 2017 10:37a   Johnny Oldenburger
Last week something went completely wrong with some resources (design elements) in a modified design of an XPages application. Luckily Domino Designer has a very powerful feature, Local History. A standard Eclipse functionality of extremely great value. By using the Compare, Replace and Restore Resources functions with Local History using the Text Compare Editor the problems were quickly resolved. Below is a brief description of this very powerful feature in the Domino Designer. A local edit hi
9
Webinar - IBM JUMP Session: IBM Domino Applications on Cloud
Tue, Nov 7th 2017 12:57p   Johnny Oldenburger
There will be a very interesting IBM Jump Session on 8 November, IBM Domino Applications on Cloud. JUMP stands for Join, Understand, Master and Participate. Content Topic: IBM Domino Applications on Cloud Date: Wednesday, November 8, 2017 Time: 10:00 AM EST (15:00 UTC/GMT, UTC-5 hours) for 60 minutes IBM Domino Applications on Cloud is a subscription service that offers IBM hosted solution for Domino Apps over IBM Bluemix Cloud. The service offers a structured and planned migration process, av
12
Responsive and Highly Customizable Messageboxes in XPages Using the jQuery Lobibox Plugin
Tue, Nov 7th 2017 12:56p   Johnny Oldenburger
Last week I blogged about the jQuery LobiPanel Plugin, Extended Bootstrap Panels in XPages Using the jQuery LobiPanel Plugin and the jQuery Lobibox Plugin, Create Responsive and Highly Customizable Notifications in XPages Using the jQuery Lobibox Plugin. As I mentioned in these blog posts, Lobibox is devided into two parts, Messageboxes and Notifications. In this blog post I will describe the Messageboxes part. Lobibox is very easy to implement in any XPages application. Features Messageboxes L




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition