Mark_HE

Tip -- Set default filter for Visualizer button on SDM UI

Discussion created by Mark_HE Employee on Jun 16, 2015
Latest reply on Jun 16, 2015 by Chris_Hackett

Here is an example to specify the default filter for Visualizer on CI detail screen.

1.

Open cmdb_launch_visualizer.htmpl on WSP and find the following lines:

<PDM_LIST PREFIX="filter" FACTORY=vis_object_store_master

WHERE="(inactive=0) AND ((object_sub_type=0 OR object_sub_type=3) OR (object_sub_type=1 AND creation_user.userid IN '$cst.userid'))"

ORDER_BY="id ASC">

<option value="$filter.id">$filter.object_name</option>

</PDM_LIST>

</select>

<script type="text/javascript">

 

 

2. after the last line of above source code, add the following script.

function setdefault(fid)

{

  for (i = 0; i < document.getElementById("CmdbVizLaunchFilterSelect").length; i++) {

    filterId = document.getElementById("CmdbVizLaunchFilterSelect").options[i].value;

    if (filterId == fid){ //find the Filter

        document.getElementById("CmdbVizLaunchFilterSelect").selectedIndex = i;

        break;

    }

  }

}

//set the default filter as Browse Filter

setdefault(1011);

 

3. Save and publish

 

 

To find the filterid for the filters, run the SQL below:

select id, object_name from vis_object_store_master;

By default, it should be:

1010Cause and Effect CIs
1011Browse Filter
1012Root Cause Analysis
1013Impact Analysis
1014Trace relation
1015Shortest Path

Outcomes