Hide a field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 10:12 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 07:21 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 09:45 AM
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.