You can use a LotusScript PlaceBot file or files to access and process data in your place. For example, you can use LotusScript to change a value in one document based on values in other documents or to modify a place's access control list.
LotusScript is an embedded, BASIC scripting language with a powerful set of language extensions that enable object-oriented application development within and across Lotus® products. LotusScript and its development tool set provide a common programming environment across Lotus applications on all platforms supported by Lotus.
LotusScript offers a wide variety of features. Its interface to Lotus products is through predefined object classes. The products oversee the compilation and loading of user scripts and automatically include class definitions to allow more efficient coding.
For more information on LotusScript and Domino®, refer to the LotusScript information in the latest Domino Designer Help, available from http://www.ibm.com/developerworks/lotus/documentation/dominodesigner/.
While IBM® Lotus Quickr™ supports LotusScript in PlaceBots, LotusScript and @formulas are not supported in hooks.
Add the following LotusScript to a PlaceBot. The PlaceBot selects the current document and changes the subject line. This example would work best as a form agent.
' This agent gets the document context and changes its subject.
Dim session As New NotesSession
Dim doc As NotesDocument
Dim subj As Variant
Dim item As NotesItem
' Get the page being published
Set doc = session.DocumentContext
' Get the subject
subj = doc.GetItemValue( "h_Name" )
' Append a prefix string before the subject
' Note: GetItemValue always returns an array
' even if there is only a single value
Set item = doc.ReplaceItemValue( "h_Name","Form Agent Modified: " + subj(0))
' Save the page
Call doc.Save(True, False)
Parent topic: Creating a PlaceBot