Manage Learn to apply best practices and optimize your operations.

Allow a Dynamic Keyword Lookup

This code/agent will essentially allow a dynamic keyword lookup that will either use an existing selection or you can create a new selection that will add itself to a maintenance view so that it is there next time. i.e. If you have a dialog box that allows vallues not on list, then you can type the option in, but you will have to type it in each time, with this code you can allow values not on list, but at the same time they are in a maintenance view...

'<Begin code>'


lookup := @DbColumn("":"nocache";"";"(status)";2);


error_check := @If(@IsError(lookup);"";@Unique(lookup));


prompt := @Prompt([OKCANCELLIST];"Status Code";"Please select a status code for this inventory item...";"<New Status Code>";@Unique(@If(error_check = "";"<New Status Code>";"<New Status Code>":error_check)));


value := @If(prompt = "<New Status Code>";@Prompt([OKCANCELEDIT];"Enter New Code";"Please enter the new status code...";"");prompt);


FIELD status := value; @Environment("category";"Status");
@Environment("key";value); @If(prompt != "<New Status Code>" ; "" ;
@PostedCommand([ToolsRunMacro]; "(keywordmaint)"))


Then this is the code for the "(keywordmaint)" agent...


Sub Initialize Dim ws As New notesuiworkspace
Dim uidoc As notesuidocument
Dim session As New notessession
Dim db As notesdatabase
Dim doc As notesdocument
Dim key As String
Dim doc2 As notesdocument


Set db = session.currentdatabase
Set uidoc = ws.currentdocument
Set doc = uidoc.document
Set doc2 = New notesdocument(db)
'"dbmaint" is the maintenance document... doc2.form = "dbmaint"


key = session.getenvironmentstring("$key",True)
cat = session.getenvironmentstring("$category",True)
doc2.keyword = key doc2.category = cat Call,True)
End Sub


'<end code>'

Dig Deeper on Domino Resources - Part 2

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...