BeforeUserChanged event

Examples


The BeforeUserChanged event occurs when the user changes the contents of a field, then moves the focus out of the field, using the TAB key or the mouse. In fields that toggle, such as push buttons and visual switches, this event occurs when the user clicks the field. For list fields, this event occurs when the user selects an item in the list. In all instances, the BeforeUserChanged event occurs before the Microsoft Dynamics GP user changed event.

Syntax

field_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)

Parameters

field – A window field object.

KeepFocus As Boolean – If True, the focus returns to the current field.

CancelLogic As Boolean – If True, the event cancels the Microsoft Dynamics GP user changed event, and the VBA AfterUserChanged event.

Comments

Use the BeforeUserChanged event to set or evaluate the value of field that’s losing focus. You can also use this event to bypass, or cancel, the Microsoft Dynamics GP user changed event that occurs for the field.

For many data entry fields, the Microsoft Dynamics GP user changed event verifies the value entered in the field. For push buttons, such as a Save or Delete button, the user changed event saves or deletes the record displayed in the window.

Use caution when canceling a data entry field’s user changed events using the BeforeUserChanged event. Canceling the Microsoft Dynamics GP user changed event for these fields inhibits the accounting system’s ability to verify the contents of the field.



Documentation Feedback