When the request type variable is selected as none in catalog form, then no options should appear.

Deeplaxmi
Tera Contributor

Hi All,

 

Problem : There is a variable named "Request type" with type as select box. It has 3 choices on catalog.

1. None

2. XYZ

3. MMN.

When I select None, then all the variables below variable "Request type" should be hidden.

When I select XYZ, then some 6 variables to be displayed below variable "Request type" .

When I select MMN, then some 6 variables to be displayed below variable "Request type" .

 

I have wriiten 3 UI policies with below conditions.

1st UI policy name : When its None.

I created condition -> <Request type || is || None> and created all policy actions which I wanted to hide. Set their visible to false.

Similarly did for the other two as well (XYZ and MMN)

The issue that happens :

1). When I click "Try it" :- When I select "none", some random variables appear (When actually it must not appear). Every time some different random variables appear

2). Second issue, when I select "XYZ", some unwanted variables appear, which I have not even created in UI policy action. To avoid their appearance , I still created them as UI policy action and made them false but still they appear

 

I also created a Client script as below for "None" but no luck

function onLoad() {
   
    if(request_type=='None'){
    g_form.setVisible('reason_replaced_by_Justification_impact'false);
    g_form.setVisible('justification_of_reason'false);
    g_form.setVisible('effective_month_s'false);
    g_form.setVisible('reason'false);
    g_form.setVisible('reason_with_checkboxes'false);
    g_form.setVisible('justification_impact'false);
    g_form.setVisible('forecast_point'false);
    g_form.setVisible('ramp'false);
    g_form.setVisible('airport_location'false);
    g_form.setVisible('list_station_id_s_assignment'false);
    g_form.setVisible('old_airport'false);
   
    g_form.setVisible('reason_stationmove'false);
    }

 

I am really struggling and stuck with this..... please suggest me, Thanks !

8 REPLIES 8

Community Alums
Not applicable

Hi @Deeplaxmi ,

 

Do not use Try it, use it in Portal. "Try it" sometimes display incorrectly.

If the issue still occurs, limit your variables to 2 or 3 variables to test it first.

Community Alums
Not applicable

Hi @Deeplaxmi ,

 

Does your code in Client script includes all needed variables for XYZ and MMN? I can see there are 12 variables so it is 6 for each choice am I right?

If that is the case then:

1. Disable that Client script.

2. Disable the UI Policy for 'None' option.

3. Only remain 2 UI Policies for XYZ and MMN. (Each one will have Visible True for 6 variables)

 

The reason is you should not create duplicate UI Policy action on the same variable because it may not behave correctly as you wish (their run order is not predictable).

Again try it in Portal.

Hi Jack40,

 

When "request type" option is None, I want to hide all the variables that are below the request type variable (they should not appear below "Request type" variable)

 

When option is XYZ, I want only below variables to display. (To be displayed after/below the "request type " variable):

1. Reason

2. Justification of reason

3. Reason with checkboxes

4. Forecast point

5. Reason 3

6. Airport location

7. List station IDS

8. Reason 4

9. Old airport

10. New airport

11. Example

12. List station ID for new airport location

13. Additional comments 1

14. Additional comments 2

 

When the option is MMN, I want only below variables to display. (To be displayed after/below the "request type " variable)

1. Justificaction impact

2. Justification of reason

3. reason with checkboxes

4. Forecast point

5. Ramp

6. Airport location

7. List station IDS

8. Reason 3

9. Old airport

10. New airport

11. Example

12. List station IDs for new airport location

13. Additional comments 1

14. Additional comments 2

 

So, How can i achieve this. Please help me on this.

Does your code in Client script includes all needed variables for XYZ and MMN? I can see there are 12 variables so it is 6 for each choice am I right?

-  Client script is for "Request type" as None. I have written client script to hide the variables when request type = None. Also there are common variables to appear for XYZ and MMN . They are not 6 different.

 

If that is the case then:

1. Disable that Client script.

2. Disable the UI Policy for 'None' option.

3. Only remain 2 UI Policies for XYZ and MMN. (Each one will have Visible True for 6 variables)