Q

Saving entries to a feeding form from a destination form

I have a keywords form that populates a number of keywords fields on a calendar entry form. I want the capability to add keywords to the keywords field on the calendar entry form and have them append to the keywords form and stay. Is this possible? Any help will be greatly appreciated.
This is a popular problem with several different answers.

The most straightforward way, the way that does just exactly what you asked for, is to use code in the Postsave event of your form. The Postsave code would use LotusScript to locate the document where the keyword fields are stored (NotesView.GetDocumentByKey), compare them with the values in the current document, add any new values to the keyword document (AppendToTextList) and try to save using NotesDocument.Save(False, False). Check...

the return value of Save to make sure that the save succeeded. If another user is doing the same thing at the same time, you may get a save conflict. In that case, you must reload the keyword document (use the Delete statement to remove it from the LotusScript document cache) and repeat the above process.

There are some drawbacks to this approach. It doesn't work well if there are multiple replicas of the database because there are likely to be replication conflicts as different users add keywords in different replicas, updating the same document.

A different technique that works well in a replicated environment is to create a hidden view especially for this keyword lookup. Write the view selection formula so that it includes both your keyword document and also your calendar documents:

SELECT Form = "CalendarEntry" | 
(Form = "Keyword" & Type =
 "CalendarCategory") 
Categorize the first column and enter a formula there that tests the form and gives the list of values on that form:
@If(Form = "Keyword"; 
KeywordValues; Categories) 
This assumes KeywordValues is the name of the multi-value field on the keyword configuration document and Categories is the name of the field containing these values on the CalendarEntry form.

Now, by doing an @DbColumn to this hidden view, you can get all the category values that have been entered in the keyword form, plus all the category values that were added since, all in alphabetical order.

This was first published in April 2004

Dig deeper on LotusScript

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close