- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 07:33 AM
Hi Everyone,
I need to update a condition on Relationships, Where
Need to update the query to filter only for Personal Computer:
model_category=451c87f6db41e2407be67bec0f96193a
Applies to Table - Hardware
Queries from table - sys_email
Script:(function refineQuery(current, parent) {current.addQuery('instance', parent.sys_id);})(current, parent);Thanks Everyone
@Dr Atul G- LNG @Maik Skoddow @Sandeep Rajput
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 09:08 AM
try this,
function onLoad() {
var ModalCat = g_form.getValue('model_category');
if (ModalCat != '451c87f6db41e2407be67bec0f96193a') {
g_form.hideRelatedList('REL:48c2c2f9977fb110fea876d11153af0c');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 08:12 AM
Hello @venugopal s ,
Your query looks correct, make sure you are using alm_hardware table, instead of cmdb_ci_hardware table.
For the model_category=451c87f6db41e2407be67bec0f96193a , Do you only want show the related list when the this condtion satisfied? Please give more clarification.
Regards,
Siddhesh
,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 08:22 AM - edited 01-29-2024 08:31 AM
Yes @Siddhesh Gawade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 08:43 AM
So you can write a onload client script hardware table as below.
function onLoad() {
var ModalCat = g_form.getValue('model_category');
if(ModalCat != '451c87f6db41e2407be67bec0f96193a'){
// Use below format for hiding the related list REL:sys_id of relationship record.
g_form.hideRelatedList('REL:07d38bd547000210a0c8d24b116d4323');
}
}
Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.
Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 09:01 AM
Hi @Siddhesh Gawade ,
not working