Home > Domino Tips > Developer > LotusScript > 10 everyday LotusScript tips
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

LOTUSSCRIPT

10 everyday LotusScript tips


Bill Buchan
03.27.2007
Rating: -4.18- (out of 5)


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


[TABLE]

Error trapping tests a particular condition when running a program. If the program runs into an error, it will then execute a corresponding routine to fix the error. This should always be done. Error handling is not a joke -- it should always be handled in a serious manner and should always be mandatory.

There are two ways to go about this:

[TABLE]

While it may seem a bit paranoid, you should practice using defensive LotusScript coding -- it will save you time in the long run. Always assume the worst and check all inputs on every function. It doesn't usually affect performance, but it is a good failsafe.

Here is a good example of defensive LotusScript coding in a typical function.

[TABLE]

When creating commercial applications, it's a very good idea to hide your code. But, you may be asking how. There are actually two ways you can go about it:

[TABLE]

You should never store date/time values as strings. It is always good practice to use NotesDateTime structures instead and save them.

You might say, sure, but why? Well, you never know how the client will interpret dates. Is it dd/mm/yyyy or mm/dd/yyyy? It also means that views will be able to sort on dates.

Trust me, this is a good tip to practice. This issue comes up more often than you might think.

[TABLE]

A good reason to consider using DXL as Transport stems from a situation where a customer wants to easily send back "log" documents. When this happens, you can use a LotusScript agent to:

At the receiving end, this will:

This way, you are transferring data without replication. Below is a sample code of this being implemented.

[TABLE]

When using a wizard interface with your Lotus Notes client, there are a few steps you should follow:

[TABLE]

There are two different way


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


RELATED CONTENT
LotusScript
LotusScript sorts lists alphabetically
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication
LotusScript filters and attaches files to a Notes form
How to create mail files using a LotusScript agent
Extract value pairs from text arrays with LotusScript
Mass-input form uses LotusScript to ease large-scale employee moves
LotusScript button updates email addresses in Lotus Notes PAB
Code exports Lotus Notes data to an OpenOffice Calc spreadsheet

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


s you can go about consuming Web services. The first is quick and to accomplish it, you should follow these steps:

Below is some code that illustrates how to create the Microsoft SOAP object.

The other approach is a little different. It's big and robust and uses Stubby. Just point it at a Web service and it produces the code for you.

Some good points about it are that it is multi-platform, scalable and there are no dynamic link libraries. However, it does require you to use more than four lines of code.

[TABLE]

When developing with LotusScript, it is always a good idea to use classes. Here are some reasons why:

Classes have a good design methodology, which leads to Java. But everyone is not used to them and it may take time to sink in. Below you will see some code that implements classes.

[TABLE]

The Evaluate command allows you to run @Functions within LotusScript. It is sometimes quicker and easier, as it allows you to use your favorite function in certain situations.

An example of it might be:

Don't overuse it though. Loads of LotusScript functions mimic @functions.

[TABLE]

It is good practice to use trusted servers because scheduled agents cannot normally open databases on other servers.

The "trusted servers" field in a Lotus Domino R6 server document's security section allows servers to trust other servers. By doing this, it allows you to centralize "collection" agents. You also simplify your architecture and limit the number of agents you use. However, it does rely on a fast, reliable network infrastructure.

As a final note, make sure to never trust servers in another domain.

[IMAGE]
[IMAGE]TUTORIAL: 30 LOTUSSCRIPT TIPS
[IMAGE]
[IMAGE] Home: Introduction
[IMAGE] Part 1: 10 fundamental LotusScript tips
[IMAGE] Part 2: 10 everyday LotusScript tips
[IMAGE] Part 3: 10 advanced LotusScript tips
[IMAGE] Part 4: More LotusScript learning resources

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




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