Search DominoPower's 11,429 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
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:

"":@DbLookup("";"";"cal_profile";"1";1)

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")


« Previous  ·  1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Lotus Technologies > Domino (77 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   Sloppy analysis at the core of another Domino vs. SharePoint report
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
IBM Lotus to Google Apps Migration Remorse
Webcast Series: Mobile Collaboration with Lotus Software
Domino Login Control for Mobile Apps
Sys Admin Tips March 2010
Quickr place Superusers
Writing Client-Side Javascript for Re-Use
Lotus Notes R8.5.1: Bug in Contacts "Print Selected View"
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Teamstudio Edition 25 has shipped
It's finally here! Now that Teamstudio Edition 25 has shipped, listen to our latest Tool Time audio program to find out what's changed. Updates to all your favorite Teamstudio tools will be discussed.

Plus, you'll get an introduction to Teamstudio Undo (formerly known as Teamstudio Snapper).

Tap here to get started!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login