Hide a field

Rpatil1
Tera Contributor

Hello everyone,

i had a ui policy to display two fields x and y on change of z for 3 catalog items,  now i want to make changes to just one one the catalog item such that it should hide field y want to achieve this without creating anything on table level,
problem is fields x,y,z are not in catalog variable so was not able to create catalog ui policy to achieve this.

any suggestion on how to achive this 

2 REPLIES 2

Josh_H
Giga Guru

Hey @Rpatil1,

 

If you can't accomplish this with a catalog UI policy, then you should be able to accomplish it with a catalog client script. I hope that answers your question.

 

Cheers,

Josh

 

If you found this helpful please give a thumbs up OR mark it as the solution. Thank you!

Community Alums
Not applicable

you can create a Catalog Client Script that specifically targets the catalog item you want to change This way you can hide field y for the specific catalog item without affecting the other catalog items.

 

Catalog Client Script :

function onLoad() {

var catalogItemSysId = g_form.getValue('sys_id'); // Get the sys_id of the current catalog item
var specificCatalogItemSysId = 'YOUR_CATALOG_ITEM_SYS_ID'; // Replace with the sys_id of the specific catalog item

if (catalogItemSysId === specificCatalogItemSysId) {
// Hide field Y
g_form.setDisplay('field_y', false); // Replace 'field_y' with the actual field name
}
}

If my answer helped you in any way,  please then mark it as helpful or correct.