- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2014 11:54 AM
I'm working on a basic catalog request form, which has a few simple UI policies that show/hide fields based on previous selections going down the form. One particular field has 6 choices. The UI Policy created says If this field is one of these 3 choices .. At which point I have the policy hiding 5 fields, reverse if false. My problem is that on load, the field that drives the policy is set to None -- yet 2 of the 5 fields show up still. If I flip the main field to one of the 3 choices, they all show up again. If I flip it to NOT one of the 3 choices, the form only hides 4 of the 5 fields. So very strange, and yet I can find no difference that would cause this. Any thoughts?!
Things I've tried already:
- Disabled all other UI policies on the item
- Started this process using variable sets, then went to just straight variables -- did not fix the issue.
- Other UI policies on the form work when enabled.
We are using the Calgary release.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2014 12:32 PM
This has been fixed. I spoke with one of our consultants and the issue was around the few fields that were being set as mandatory on the variable level instead of the UI Policy level. They refused to hide because they were mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2014 12:57 PM
This is a tricky issue without being able to see the instance. Nearly every time I make catalog items I choose the client script route vs the
ui policy route. I understand that ui policies are easier to manage, but it isn't my go to. With that in mind, here are some things to try:
1.
On the catalog item, hit CTRL+SHIFT+J to bring up the javascript evaluator. Run this:
//hide fields:
g_from.setDisplay('local_accounts',0);
g_form.setDisplay('windows_drives',0);
Do the two fields hide when explictly directed?
2.
Try creating a onChange client script that simply alerts the value of server_function, make sure to NOT implement the "if(!isLoading)" check so
it behavies like an onChange that fires onLoad as well.
function onChange(control, oldValue, newValue, isLoading) {
var sf = g_form.getValue('server_function');
alert(sf);
}
Are you getting the value you expect onLoad? onChange?
3.
You can also try creating a single onLoad client script on that catalog item that sets default values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2014 06:22 AM
1. When trying this on the catalog item I'm getting an error ReferenceError: g_form is not defined
2 + 3 -- will look into today

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2014 12:00 AM
In your condition, have you tried adding an 'or' for server_function is none? Just a thought.
So it would look like this:
server_function is one of x, y, z OR server_function is none
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2014 06:12 AM
Just gave it a try, no dice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2014 12:36 PM
SO actually when I write it in as a 'Run Script' ib the UI Policy, it seems to be playing nicer, however the form just leaves a big blank area. Is there a better way to hide then using g_form.SetVisible?