Scoped Application setDisplay on variable set fails due to cross-scope access denied?

akaupisch
Kilo Guru

I saw this other thread, but it doesn't fully explain what is going on, and my situation is a bit different, so I'm hoping there is a better solution. Here's what I have going on:

I have a scoped application (created via the Create Template, this is a Service Management application i.e. sm_order, not the sc_req).

I created a Record Producer in that scope for the Request Table (both are PI)

I created a bunch of variable sets mapped to custom variables I added to that request table

I also create a variable set that has 2 variables that are not related to any table and are just 'floaters' for testing purposes (to test this bug out)

I have ui policy debugging on

My goal is to show/hide entire variable sets based on user input as there are a ton of variables on this form (around 35 in total) and hiding them individually will be a total pain based on all the different conditions I have.

I created a UI Policy (I tried Client Script too) for both onLoad and onChange. I disabled reverse on false and under Run Script, I put the following code:

g_form.setDisplay('variable_set_name', false);

When I load the page, I get the following error:

Display false not set on field test: cross-scope access denied.

So I tried a few things:

1) I am able to setDisplay on every variable in the set and they all hide properly (and the set disappears after all are false)

2) I tried setVisible and it worked fine on the variable set.

3) I even created a new variable set with 2 bogus variables that aren't related to any tables, still doesn't work.

As far as I can tell, everything is scoped properly...all variable sets, record producer, ui policy are scoped the same. I'm not trying to access any variables that might be out of scope (i.e. short description). All of the permissions are set to allow all access.

Now, based on that other thread, if I do create a Global UI Policy, it works just fine. However, that seems really messed up to me. The whole point of scoped applications is to keep them self contained. Anyone know what is going on? Is this a known bug? is their a workaround? I'm on developer instance of Helsinki.

Thanks!

5 REPLIES 5

ELLIOTT_HOLCMAN
Kilo Contributor

Greetings,

 

I have a situation where I have a catalog item I created in a non-global scope and, within that catalog item, I have a bunch of variable sets. I have a requirement to set a field in one of the variable sets to visible and mandatory IF a combination of answers to variables which reside in two different variable sets meets a certain criteria.

 

For example

 

Variable Set #1

 

Field1

 

Variable Set #2

 

Field 2

Field 3

 

Requirement

 

Make Field 3 visible and required if Field 1 = "abc" and Field 2 = "xyz".

 

To do accomplish this, if all of the fields were on the catalog item and/or in the same variable set, I would use a UI Policy and leverage the condition builder to establish the condition. HOWEVER, since the fields are not all 'together', they are not all available in the select list in the condition builder.

 

So... to do this, I need to either use the scripting portion of the UI Policy OR, create a Client Script to set the Visible and Mandatory properties on Field 3.

 

The problem I ran into with both approaches is that it seems that the setMandatory and setDisplay functions are not allowed 'cross-scope' so, once the catalog item is used to create a "RITM", I get an error message that says that the field was not set to Mandatory and not set to Display.

 

Does anyone know if I am doing something wrong and/or if there is a solution for this?

 

Thanks,

Elliott