|
|
|
|
|
|
|
|
|
|
User Web profile documents (continued)
@If(@IsError(@DbLookup("";"";"user_profiles";usr;"docid"));"1";@If(@DbLookup("";"";"user_profiles";usr;"docid") = docid; "1"; "0"))
|
This formula consists of a pair of nested @If statements. The first one of these checks to see if we can lookup the unique id document of a document with the same username as is stored in this document. If it can't find one then this must be the first profile document for this user, so we set SaveOptions to "1" to allow saving.
If the lookup succeeded, then we need to check whether the open document is the original profile doc for this user or whether they are attempting to create a second one. If the document id of the currently opened doc matches the id from the lookup then we are editing the right doc and SaveOptions becomes "1", if not, we are trying to create a new doc and SaveOptions stays "0".
Next I created some descriptive text: "Preferred language for" and then a computed text element with the value: @Name([CN];usr) which will return just the common name part of the username in the usr field (Daniel Koffler instead of CN=Daniel Koffler/O=Koffler). The last field on this form should be a drop down list named "lang" with choices of available languages Use a formula for the choice values of:
This looks up the first column value of the "cal_profile" view (which we created in the last article) and returns a list of available languages in the global calendar profile form in the format "English | Lang1" where English is the language name, and Lang1 indicates which set of fields to retrieve the names of days and months from.
Now we need to create the "user_profiles" view we referenced in the SaveOptions field. Create a new view and set the selection formula to: SELECT form="UserPro". Create two columns. The first should be sorted and should have the value of the field "usr" and the second column should contain the value of the field "lang".
Putting it all together To get the popup calendar to successfully store and use individual user language preferences, it must first lookup the name of a user's preferred language from their personal profile document and then it must query the global calendar profile document to get the names of the days and months for the specified language.
To do this, open the "Calpop" form and changes the formula for the "LangInfo" field to be:
1 tLang:=@If( @IsError( @DbLookup("";"";"user_profiles";@UserName;"lang")); "Lang1"; @DbLookup("";"";"user_profiles";@UserName;"lang"));
2 @DbLookup("";"";"cal_profile";"1";tLang+"_digest")
|
[ Prev | Next ]
|
|
|
|
|
|
-- Advertisement --
AUTOMATE LOTUS NOTES USER ID MANAGEMENT
ID Manager 4.5 from HELP Software provides a new level of automaton for managing Lotus Notes IDs. ID Manager lets Lotus Notes administrators get out of the business of creating and managing user IDs. Use our ROI calculator to see how quickly ID Manager will pay for itself.
Learn more about HELP Software products |
-- Advertisement --
Six Great Tools for IBM Lotus Sametime
- Encrypted and secure, browser-based, persistent chat rooms
- Complete chat logging and auditing
- Easy-to-define IM help desk queues
- Manage buddy lists across any organization
- Integrate awareness into Microsoft Outlook
- High powered, rapid bot development tools
Visit Instant Tech for free trials and more information. |
|
|
|
|
|
|
|
|