Source As Field - any properties available?

All fields have the “Source As Field” parameter in their script events. Are there any properties or methods associated with the field that we can access using this?

If not, what’s the point of having it?

Thanks, Eric

Subject: Source As Field Useless, but here’s an alternative to get the Field object

Unfortunately, No. I agree, what the heck?!

To get a handle to the “Field” in LotusScript is somewhat of a hassle, but possible.

You can take advantage of the uidoc.CurrentField property which returns a String of the current field name. However, in the Exiting event, this property refers to where the cursor goes, NOT to the field being exited.

As a result, uidoc.CurrentField works great for the Entering event.

The exiting event is more work. It requires you to create a global string to represent the current field name and then set the global var in the field’s “Entering” event in order to have access to it in the “Exiting” event. Here’s some code that might help.

Globals:

Dim currFld As String

Dim ws As NotesUIWorkspace

Postopen:

Set ws = New NotesUIWorkspace

Field Events (For the fields you need a handle to)

Entering (Event):

currFld = ws.CurrentDocument.CurrentField

Exiting (Event):

’ currFld is available for you to get or manipulate the field as needed.

MsgBox ws.CurrentDocument.FieldGetText( currFld )

I hope this helps!

  • Angie

Subject: RE: Source As Field Useless, but here’s an alternative to get the Field object

This is an excellent and easy way to get the fieldname value. I am using it to avoid having to hardcode fieldnames (ie: f_1, f_2, f_3…) in my exiting events. Now I just get the fieldname, use strrightback to get the iteration number, and away i go. Great stuff, thank you. B