How to hide custom fields on Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2023 01:22 PM
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?
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);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2023 01:33 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2023 02:07 PM
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.