- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 12:45 PM
I read through the following thread:UI policies on record producers should be applied on incident form variable editor and many others (even posted one Re: Applying UI Policies to Variable Editor, which ended up on a different issue all together) and am still struggling with this. Similar to the issue in 'UI Policies on record Producer...' I have UI Policies applied to my record producer and I do have a script in place that removes 'empty' variables on the Incident Variable Editor, however, most of my questions are 'Yes/No' with a default answer and thus they are not empty. I've tried writing a few Client Script similar to:
functon onLoad () {
if (variables.device_with_issue == 'my printer') {
g_form.setVisible(variables.lasercycle_number, false);
g_form.setVisible(variables.print_application, false);
g_form.setVisible(variables.print_application_name, false);
g_form.setVisible(variables.short_description, false);
g_form.setVisible(variables.u_does_this_issue_affect_more_, false);
g_form.setVisible(variables.u_who_is_affected_, false);
g_form.setVisible(variables.u_number_of_employees_affected, false);
g_form.setVisible(variables.u_are_you_able_to_work_around_, false);
But I'm discovering that 'variables.device_with_issue' isn't working. I tried 'producer.device_with_issue' and still nothing. Has anyone tried this sort of Client Script and had success?
Thanks,
Lindsey
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 01:15 PM
Lindsey,
There are syntax errors in your script and you need to do something like:
functon onLoad () {
if (g_form.getValue('variables.device_with_issue') == 'my printer') {
g_form.setVisible('variables.lasercycle_number', false);
g_form.setVisible('variables.print_application', false);
g_form.setVisible('variables.print_application_name', false);
g_form.setVisible('variables.short_description', false);
g_form.setVisible('variables.u_does_this_issue_affect_more_', false);
g_form.setVisible('variables.u_who_is_affected_', false);
g_form.setVisible('variables.u_number_of_employees_affected', false);
g_form.setVisible('variables.u_are_you_able_to_work_around_', false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 01:15 PM
Lindsey,
There are syntax errors in your script and you need to do something like:
functon onLoad () {
if (g_form.getValue('variables.device_with_issue') == 'my printer') {
g_form.setVisible('variables.lasercycle_number', false);
g_form.setVisible('variables.print_application', false);
g_form.setVisible('variables.print_application_name', false);
g_form.setVisible('variables.short_description', false);
g_form.setVisible('variables.u_does_this_issue_affect_more_', false);
g_form.setVisible('variables.u_who_is_affected_', false);
g_form.setVisible('variables.u_number_of_employees_affected', false);
g_form.setVisible('variables.u_are_you_able_to_work_around_', false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2015 07:34 AM
I had a feeling it was my scripting, I am still learning. This worked perfectly! One question I don't know if you or anyone can answer - After these fields are hidden, there is just white space in it's place. Is there a way to put something in the scripting to remove this white space? Here is an image of what it looks like:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2015 07:51 AM
hi Lindsey,
instead of g_form.setVisible use g_form.setDisplay('field name', false)
then it wont show the missing white space
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2015 07:55 AM
Thank you!