I’ve been playing around with this all day and I believe I understand now how this works. I have some functions that get executed at various spots in the code and it’s working as expected. Most of what I am trying to do is hide unnecessary fields. I tried a couple of methods, but I’m wondering if there is a simpler way and I’m missing something. For example, I created a function “printCommonFooter” that checks the current context and then hides the fields. Like this:
print '<script type="text/javascript" language="javascript">document.getElementById("options_iqa_level").hidden = true;</script>';
This works fine when I want to always display the field, but only allow admins to edit. However, when I always want to remove a field, I’m not sure how to do. When displaying the form, I thought I might be able to use the $object variable and just set the “visible” attribute to “0”. That way, it doesn’t show up in the view, modify or create actions. Can someone recommend the best way to “hide” unwanted fields?