We have introduced a suite of new client-side JavaScript APIs designed to give you precise, real-time control over form validation and user feedback directly in your Live App. This will allow you to build responsive, highly customized workflows that validate inputs on the fly, preventing invalid form submissions before they happen.
This update includes the following new capabilities:
-
Contextual Field Messages: Use showFieldMessage() to display visually distinct messages (supporting info, warning, error, and success states) directly beneath or near specific form fields. Use clearFieldMessage() to remove them once the input is corrected.
-
Submit Button Control: Use setSubmitEnabled(boolean) to dynamically enable or disable the form’s submit button based on your custom validation logic.
-
View Data Retrieval: Use getData() on supported views (such as DataTable) to fetch current data records on the client side. This is extremely powerful for checking duplicate entries or cross-referencing values across views before form submission.
-
Field Change Event Listener: Use the new ‘form:field-change:viewKey’ event to trigger custom validation scripts the moment a user changes a field value.
See Record and Form Events for examples.
Cheers!
Kara