Home > Domino Tips > Developer > Formula > @Formula library
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

FORMULA

@Formula library


Rob Van Den Heuvel
03.07.2005
Rating: -4.71- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Writing a function once and then using it in many places is easy to do when you use LotusScript -- but what about @formula's? In Notes 6 you can do this for @formula's as well.

The following example has a date formatting formula, stored in one location and used in different places. It formats a date value as "2005/03/04 Friday."

  1. Create a shared, computed for display text field named DateFormula. Paste the following code in this field (include the braces!)
    {
    @Text(@Year(tmpDate)) + "/" +
    @Right( "00"+ @Text(@Month(tmpDate)); 2) + "/" + @Right( "00"+ @Text(@Day
    (tmpDate)); 2) + " " + @Select( @Weekday
    (tmpDate); "Sunday"; "Monday"; "Tuesday"; "Wednesday"; "Thursday"; "Friday"; "Sa
    turday") }
    

  2. Insert the shared field on your form and make it hidden for Notes and the Web.

  3. If you have two date fields on your form named DateA and DateB. Add computed text (or a computed for display text field) to your form containing the following formula:
    tmpDate := DateA;
    @Eval(DateFormula)
    

    And for the formatting of field DateB of course:

    tmpDate := DateB;
    @Eval(DateFormula)
    

Notice that tmpDate is actually a temporary variable in your formula which is referenced in the shared field code! So this works like a parameter for your @Formula function. There are lots of other possibilities to use this like input translations/validations, buttons and so on.

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Rob Van Den Heuvel. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Formula
Using Formula language code to sort Lotus Notes messages by subject
How to create dynamic JavaScript in Notes Domino without formulas
Formula language button manages Deny Access list searches
Retrieve Lotus Notes names from a nested group using @DBLookup
Create a computed Lotus Notes field to list Personal Address Book names
Show multiple Lotus Notes document fields in a single view column
How to send a document as a link in a Lotus Notes email
How to generate formatted sequence numbers with Formula language
A simpler pagination view for Lotus Notes documents on the Web
A bevy of Notes/Domino development tips

Lotus Notes Domino Formula Language
Top 10 Formula language tips
Using Formula language code to sort Lotus Notes messages by subject
How to create dynamic JavaScript in Notes Domino without formulas
Stop response documents from showing in a Lotus Notes form
Formula language button manages Deny Access list searches
Add a program doc to compact Lotus Notes databases automatically
Top 10 Lotus Notes Domino programming and development tips of 2007
Retrieve Lotus Notes names from a nested group using @DBLookup
Top 5 @DBLookup tips
Create a computed Lotus Notes field to list Personal Address Book names

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts