Home > Domino Tips > Developer > @Transform formula for use in R6
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

FORMULA

@Transform formula for use in R6


Sunilkumar Vishwakarma
07.18.2005
Rating: -3.00- (out of 5)


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


These are a couple of formulas that I find more effective than their LotusScript counterparts.

@Transform is one of the fantastic list processing formulas available in R6 & above. We can update and use each entry of the list using another formula like this.

Consider a list "1":"2":"3" contained by a field -- data on a form. In the default value for the textfield, data would be data. You have a button/hotspot/action named ChangeValues.

Put the following formula on the Click Event of the hotspot ChangeValues:

newData:=@Transform(data;"x";@TextToNumber(x)+1);
@SetField("data";newData)

Just put 1;2;3;4 as the value in the field when previewed the form in Notes client and click on the ChangeValues HotSpot. It will update the value in the textfield to 2;3;4;5 and so on.

Now I will give you a practical example from NAB, the Notes Address Book.

Most of the business giants prefer to have all the employee access controls on every asset or service using Lotus Notes. So a Global ID, or GID, is assigned to each employee (person document on Notes Address Book) and added to the document as an item.

Since two Names can be identical on Lotus Notes Server, the concept of GID is invented in large organizations. Now, if you had to create a simple web person lookup form using formula only, how would you go about doing it?

Here is the simplest solution. Create the following items or controls on the Administration/Web lookup form as follows:

1) Field: txtPersonName, text, editable, default value: txtPersonName

2) Button HotSpot: Get Details, and put the following javascript on the click event of this hotspot:
 document.forms[0].hGetDetails.click();

3) Field: ddMatchedFullNames, ComboBox, editable, 
default value: ddMatchedFullNames, 
use formula for choices: @Unique(@Explode(ddMatchedFullNames;",")), 
onChange event (js): var frm = document.forms[0]; frm.ddMatchedGIDs.selectedIndex = frm.ddMatchedFullNames.selectedIndex;

4) Field: ddMatchedGIDs, ComboBox, editable, 
default value: ddMatchedGIDs, 
use formula for choices: @Unique(@Explode(ddMatchedGids;",")), 
onChange event (js): var frm = document.forms[0]; frm.ddMatchedFullNames.selectedIndex = frm.ddMatchedGIDs.selectedIndex;

5) Hidden Button HotSpot: hGetDetails, 
Formula: fullNames:=@Explode(@NameLookup([Exhaustive];@Text(txtPersonName);"FullName");",");
gids:=@Transform(fullNames;"x";@NameLookup([Exhaustive];x;"VisionID"));
onlyNames:=@Transform(fullNames;"y";@Name([CN];y));
onlyNames=@If(@IsError(onlyNames);"No Such Name";onlyNames); 
gids=@If(@IsError(gids);"No Such GID";gids); @SetField("ddMatchedFullNames";onlyNames);
@SetField("ddMatchedGIDs";gids)

After doing all this, open the form in web and put the firstname or lastname or both in the textbox and click on GetDetails button. The comboboxes would be populated with the matching entries from the server NAB. Choose the one which is most appropriate to you.

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

This tip was submitted to the SearchDomino.com tip exchange by member Sunilkumar Vishwakarma. 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 bimonthly 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
View hidden fields on Lotus Notes/Domino forms
Case-insensitive @Unique version combines fields on Lotus Notes forms
Provide rich-text formatting via the Profile document and 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

Address Book
Formula language button manages Deny Access list searches
Find a Lotus Notes user within NAB Deny Access groups
Synchronize LinkedIn contacts with Lotus Notes Domino
How to correct Lotus Notes public key mismatches in four easy steps
Creating a Lotus Notes Personal Address Book replica
Admin user unable to create NAB
Change NAB while maintaining integrity of documents
NAB: A key piece of the Domino administration puzzle
Build an extended directory catalog
Synchronizing your contacts

Lotus Notes Domino Formula Language
View hidden fields on Lotus Notes/Domino forms
Case-insensitive @Unique version combines fields on Lotus Notes forms
Do I use Formula or LotusScript to include a doclink to a Notes view?
Top 10 Lotus Notes/Domino coding and development tips of 2008
Provide rich-text formatting via the Profile document and Formula
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

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 technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




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