Encompass offers a valuable feature that can significantly enhance input forms: custom event handlers. In this blog, we’ll delve into the details of custom event handlers, their importance, and how they can take our Encompass input forms to the next level.
What Are Custom Event Handlers?
- Custom event handlers allow you to execute custom code in response to user interactions with your Encompass forms.
- These interactions, often referred to as “events,” can include actions like clicking a button or modifying the contents of a text box.
- By adding own own code to these events, we can extend the functionality of your forms beyond the default behavior, making them more dynamic and user-friendly.
Types of Events and Supported Controls
- Encompass provides various events that can be triggered by different controls within your forms.
- Common events include the “Click Event” (triggered when a user clicks a button control) and the “Change Event” (occurs when the contents of a text box are modified).
- Encompass offers an extensive list of available events and the controls with which they are compatible, allowing for fine-tuning to match the specific needs.
Writing Custom Event Handlers
- Creating custom event handlers involves writing code in either VB.NET or C#, depending on the EventLanguage property associated with the form.
- Limited coding experience is required to get started, as Encompass offers “macros,” which are predefined pieces of code that can be used to perform common actions.
- Even users with basic coding skills can use these macros to enhance their forms.
- Proficient coders can leverage the full power of Microsoft’s .NET Framework to craft complex event behaviors that meet the unique requirements of their forms.
How to Create Custom Event Handlers
- To create a custom event handler, start by identifying the control on which the event will occur.
- Once we have determined the control and the specific event you want to handle, we can begin writing the code to define the desired behavior.
- For example, we can create a custom event handler for the button’s click event to copy the value of one loan field into another.
- This not only streamlines data entry but also enhances the user experience by automating certain tasks.
Example: Automating Email Notifications
- Trigger: Create a custom event handler to initiate when a user clicks a specific button control on the Encompass form.
- Data Extraction: Write code within the event handler to extract relevant field IDs from Encompass.
- Outlook Integration: Populate the recipient’s email address, subject, and message body within an Outlook email using the extracted field IDs.
- Efficiency: Streamline the email sending process and reduce the risk of manual data entry errors.
- Enhanced User Experience: Automating email notifications ensures that the right data from the Encompass form is included in the email, improving the user experience.
Looking for more information on using custom event handlers in Encompass 360 or need help with implementing any technology solution within Encompass, leave us a message.


