Events

Initialize(UserName, EmailAddress)

InitializeField(FieldName, FieldValue)

ValidateField(FieldName, FieldValue)

Initialize(UserName, EmailAddress)

This event occurs before a form is displayed on the device panel.

Arguments

UserName

The logged on user’s username

EmailAddress

The logged on user’s email Address

Remarks

You can use this event to determine the current logged on user and perform any needed initializations

Example

Dim g_UserName

Dim g_EmailAddress

Sub Initialize(UserName, EmailAddress)

Write custom code to keep the logged on username information for later use

g_UserName = UserName

g_EmailAddress = EmailAddress

End Sub

InitializeField(FieldName, FieldValue)

This event occurs prior to when a field on a form is displayed.

Arguments

FieldName

The name of the field

FieldValue

The value of the field

Remarks

You can use this event to provide a field value

Example

Function InitializeField(FieldName, FieldValue)

‘Write custom code to lookup the user’s home directory.

If (FieldName = “Path”) Then

InitializeField = LookupHomeDirectory(g_UserName)

End If

End Function

ValidateField(FieldName, FieldValue)

This event occurs when a when user attempts to set a new value for a field on the form.

Arguments

FieldName

The name of the field that requires validation

FieldValue

The value of the field that requires validation.

Remarks

You can use this event to perform tasks such validating user input for a form field.  If the return value is empty string then validation is assumed to have been successful.

Example

Function ValidateField (FieldName, FieldValue)

ValidateField = “”

‘Write custom validation to check that the user is attempting to enter a value for ‘the Amount field that is less then 100.

If (FieldName = “Amount”) Then

If (CInt(FieldValue) > 100) Then

ValidateField = “Amount cannot be greater than 100.”

End If

End If

End Function