Hiding Variable Editor formatter when the variables are not required
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2019 02:57 AM
Hi all. I have a custom table called u_finance. I have created a 'Variable Editor' formatter for this table which works well. However, I don't want it to appear for all records. Is there a way to hide/show the whole Variable Editor section based when certain conditions are met? Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2019 04:29 AM
Follow-up questions:
- Do you want to hide the entire formatter or individual fields?
- Did you clone the existing variable editor? Is the code the same?
- What are examples of "certain conditions"? How would you want to manage these conditions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2019 06:11 AM
Thanks for the reply.
Do you want to hide the entire formatter or individual fields?
Yes, the whole formatter, not just certain fields.
Did you clone the existing variable editor? Is the code the same?
Yes, no code has changed.
What are examples of "certain conditions"? How would you want to manage these conditions?
I am going to create a new True/False field called Generic (u_generic). If this is true, I don't want the formatter to appear. This field will be set True when the Record Producer doesn't have Variables that aren't fields on the form.
Hope that makes sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2019 06:35 AM
Assuming the u_generic is available on the target record, you could place the variable editor in a section of its own and hide the section conditionally using a client script or ui policy.
This g_form function hides a section with the name "schedule" but beware of the section naming conventions:
g_form.setSectionDisplay('schedule', false);
Display the section: g_form.setSectionDisplay('schedule', true);
Se this guide: Show/Hide Form Section by Name