The CreatorCon Call for Content is officially open! Get started here.

How to hide custom fields on Service Portal

Gemma4
Mega Sage

I have a requirement to add 1new field on the request item table that only display if State has changed. The catalog client script I have is working perfectly. However, while testing I noticed this new custom field being displayed on the portal. How can I hide this on the portal but make sure it is visible on the platform on the request item? statePortal.PNG

 

Catalog Client Script for State Reasoning

function onLoad() {
//Type appropriate comment here, and begin script below

var ritmState = g_form.getValue('state');

//if (ritmState === '10') {
if ((ritmState === '10') || (ritmState === '11')){ //Stopped or Deferred State
g_form.setMandatory('u_reasoning', true);

g_form.setDisplay('u_reasoning', true);
}
}

2 REPLIES 2

Jaspal Singh
Mega Patron
Mega Patron

Hi,

I believe the current Client script has UI Type set to Both and Applies to Catalog Item view and Applies to Requested Item set to True. If so, disable the Applies to Catalog Item view  and then create a new Catalog UI policy to simply hide the field on portal.

maroon_byte
Mega Sage

Catalog Client Scripts are for catalog items and they work on variables.

You need Client script on RITM table with UI Type = Mobile / Service Portal.