Field not showing up in Portal view

oharel
Kilo Sage

Hi all,

For some reason, one of the fields I am trying to add to the Portal View just does not show up on the requested items form, as if a UI policy is restricting it.

There is no UI policy that I can find that's doing that.

Any ideas?

Harel

1 ACCEPTED SOLUTION

Hi all,



So I solved this by using a script instead of the regular conditions.


Andraz, I was not using dot-walking in the condition - I think it does not work in Ui policies.


Pradeep, the view field was already cleared, so that was not it as well.



If anyone needs, here is the script I used (cleared all condition from the UI policy):


function onCondition() {



var catItem = g_form.getParameter('sysparm_id'); //the id of the catalog item.


  if(catItem == '670806ce09963d402fc62090a83df074') {//catalog item is AD Preparation


  g_form.setReadonly('u_ad_account', false);


  g_form.setDisplay('u_ad_account', true);


  } else if(catItem == 'edf0574939e86540b253721d0f834927') { //catalog item is Web Preparation


  g_form.setReadonly('u_ad_account', true);


  g_form.setDisplay('u_ad_account', true);


  } else {


  g_form.setReadonly('u_ad_account', true);


  g_form.setDisplay('u_ad_account', false);


  }


}


View solution in original post

8 REPLIES 8

Chuck Tomasi
Tera Patron

Hi Harel,



Can you include a screenshot please? (One of the default UI and one of the portal view would be great to compare)


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Harel,



Have you configured form layout with correct view.


Also check if there is a client script/UI Policy which is hiding the field on the form.


Hi Pradeep,



Yup, there seems to be a UI policy causing it - I missed it earlier. When disabled, the field shows on all views.


However, the problem is that the UI policy is necessary; the field should only show in certain catalog items and not in others.


So the condition is:


If catalog Item is X     or


catalog item is Y


then show the field.



Any suggestion on how to show it in Portal view and not only in Default view?



Harel


Hi Harel,



Thanks for the update. You can control UI policy via condition field. I.e search for cat item field and then adjust your logic.