A Legacy Notes Developer's journey into madness.

Tim’s Magic Button

Devin Olson  March 31 2015 12:05:12 PM
Whenever I set up a new Notes Client, there are a certain set of "things" I do to tweak it a bit and make it easier for me to work.

I'm sure everybody has their own set of these "things" as well.  

Today was no different.  I had just finished a clean install of a new development VM, and was working in my freshly installed Notes Client when I remembered (because I needed it) that I had forgotten to install a bit of code I call Tim's Magic Button.  

Several years ago my partner Tim Tripcony and I were working at a client's site, and he showed me this custom Smart Icon Toolbar button code.   It is concise, clean, and absolutely brilliant (much like Tim -RIP my friend).  

You may ask "What does it do?"  (Go ahead, ask out loud)  

Well, it allows you to select a document from a view and then add, edit, or delete any field on the document. Nothing more, nothing less.   But sometimes, that is exactly what you need.

Anyway, here is the code:

targetField := @Prompt([OkCancelEditCombo]; "Select Field"; "Select a field to override:"; ""; @DocFields );
updateTypes := "Text":"Number":"Time":"Delete Field";
updateType := @Prompt([OkCancelList]; "Select Type"; "Choose a type or action:"; "Text"; updateTypes );
@If(updateType = "Delete Field"; @Return(@SetField(targetField;@DeleteField)); "" );
newValue := @Prompt([OkCancelEdit];"New Value";"Enter the new value:"; @Text(@GetField(targetField )));
newTypeValue := @Select(@TextToNumber(@Replace(updateType; @Subset(updateTypes;3);"1":"2":"3" )); newValue; @TextToNumber(newValue); @TextToTime(newValue));
@SetField(targetField; newTypeValue)

Some time after giving me this code Tim wrote a blog post about it (my how time flies) .  You can read his post here.


1Brian Moore  03/31/2015 1:04:28 PM  Tim’s Magic Button

Chad Smiley had a more extensive one. You can't find it (or I couldn't) from the link on Tim's blog, but it is on mine:

{ Link }

It has a number of useful functions and it's a standard part of my toolbox.



2Nathan T. Freeman  04/01/2015 1:22:49 AM  Tim’s Magic Button

Tim was indeed absolutely brilliant, but I'm not sure you could call him "clean", and you definitely can't call him "concise." :-)

3Patrick Kwinten  04/28/2015 12:15:09 AM  Tim’s Magic Button

smart icons - aaargh

just he problem alone to select a proper icon for an action is a pain in the ass :-?

perhaps Tim knew a solution for that too

4Devin Olson  09/28/2015 2:57:35 PM  Tim’s Magic Button