App Builder \ Code Events
On Render
Thaha
App Builder & Automation Expert
Stay Updated with ProcFu!
Subscribe to our newsletter for the latest tips, updates, and automation insights.
Subscribe Now
-->
- This is a client-side event that utilizes JavaScript, with jQuery available by default.
- It activates after the "Before Render" event has processed and displayed the data on screen.
- Important Note: This event may trigger multiple times. For example, ajax-loading additional records into a table by clicking the "more…" link will cause the event to fire with each new data load.
- Due to security considerations, the data available in this client-side context is limited. The accessible variables include:
target
: A jQuery DOM wrapper of the current screen.my_variables
: An array holding key-value pairs set during any previous server-side ProcScript event. These variables are read-only in this context.- Please note that any variables you declare or modify with JavaScript during this event are temporary. They will not persist beyond the current session nor be transmitted back to the server.
- For additional functionality, the PfJs helper class is available. PfJs offers various methods to enhance your on-render logic.
- Click here for complete documentation and use cases for PfJs Helper classes.
- Changing Form Background Based on Status: If you've stored the current item's
status and need to highlight forms with a "Critical" status in red, you could use:
if (my_variables.status == "Critical") { $("form").css("background", "red"); }
- Conditional Display Based on User Role: To hide the "Save" button for users who are
not managers, assuming you've saved the user's role in a variable:
if (my_variables.user_role != "manager") { $("button.primary").remove(); }