We really like the @IsValid formula to check to see if a document is valid before performing another operation, but sometimes we’re not using formula language, so a script equivalent is needed.
When writing script and you want to find out if the current document has any validation errors, use this code:
Read more…
Viewed 5390 times by 1477 viewers
Recently a developer of ours had a need to swap two rich text fields on a form. The rich text fields were going to be text only (no attachments or images) but the customer wanted to be able to use things like bold and colors in the two fields that were to be swapped, so they had to be rich text. If the two fields were regular text fields, then swapping their values is pretty straightforward – you swap the two fields in the back end, perform a reload and a refresh in the front end, and you’re done.
Read more…
Viewed 7601 times by 2537 viewers
Recently, we were working on a project where one requirement was to have, according to the specifications, “one view per department showing…”. It turns out that the design of the views were going to be identical, they just wanted to see only one department at a time.
Read more…
Viewed 5758 times by 1556 viewers
Custom classes in LotusScript have been around as long as LotusScript (since version 4 of Notes), but with the introduction of Web Services in version 7, they are going to become more and more important. If you don’t already know, when creating a web service you have to code things in a custom class when the web service is coded in LotusScript. This quick article tells you how I work with custom classes in LotusScript, which might be of some help to you.
Read more…
Viewed 5415 times by 1417 viewers
The first thing that we do is follow a set structure for all our LotusScript. If it’s a function or subroutine (in a script library, as part of an agent, as part of a form, etc), then here is the structure:
Read more…
Viewed 5401 times by 1483 viewers
After nearly punching a hole in my computer monitor recently, I learned something that I thought I’d share with all of my readers. (and it’s not “don’t punch a hole in your computer monitor”).
I was working on an application that has a lot of LotusScript code in forms, views, agents, script libraries, and everywhere else. I was trying to update a form but was getting the “error loading USE or USELSX” error. Notes couldn’t bring in one of the script libraries. OK. That’s fine. I’ve seen that before. I commented out the script library and the function calls in the script library so I was able to save my form. I went back in, removed the comments from everything, and got the same error.
Read more…
Viewed 6560 times by 1965 viewers
One of the drawbacks of computed text is that you can’t put a hotspot around it. But, if you’re using a form design element (either a regular form, or a $$Template), then there is a way to get the text of a hotspot to be dynamic.
What you want to do is create a computed for display text field. The value of the field is the same as what your computed text used to be. So now this field will display a text value, and it will be the same as your computed text.
You can now put a hotspot around a compute for display field. Viola! You have a hotspot where the “clickable” text is computed.
Read more…
Viewed 7296 times by 2001 viewers
For those of you that write Java in Notes, you have probably realized that it doesn’t matter what version of the Java Virtual Machine (JVM) you have installed on your system (workstation or server) because Notes uses a set JVM version. But which one? This little piece of Java code can tell you what JVM is being used.
Read more…
Viewed 7424 times by 2250 viewers
In a Notes mail message, you can set all kinds of delivery options. One of the options is “Return Receipt”. If this setting is enabled on a message you send, you will receive an email back when the recipient opens the message. The only way the recipient knows about the “return receipt” setting is after the fact when they see “return receipt submitted for delivery” in their status bar. With this tip, you can identify messages that have this setting enabled.
Read more…
Viewed 11120 times by 3842 viewers
If you have a need to read the windows clipboard (or write to it) while in LotusScript, this custom class makes it easy. Create a Script Library, and call it Windows Clipboard. Go into the (Declarations) area of the script library, and put in this class definition.
Read more…
Viewed 11917 times by 3047 viewers