In our SM71 implementation we have place where users can put a list of CI business services (affected.services) that are impacted by the change (or should I say the CI selected as logical.name which is the first in the assets list). I would like to limit the CI business services query list to CIs within the CI Device Type and Subtype of the CI listed in logical.name field if it is not empty. We are currently using a link to our affected.services field which is like (OOB):
field: affected.services file: device field (to/target): logical.name expressions: >if gui() then ($fill.search.format="device.cm3rrfc.search") >if (not null(affected.services in $File)) then ($query="logical.name#affected.services in $File") else ($query="true") >if $query#"true and " then ($L.void=strclpl($query, 9)) source field: affected.services target field: logical.name all other fields are blank.
Is there a way that I can adjust this to pull the device type and subtype from the logical.name CI and filter my resulting query list of affected.services?
One easy way to do it is on the link line for the logical.name, also add the device type and subtype fields to the list in the Source Field/Target Field array, pulling the values back to $variables (like $type and $subtype)
Then, in the affected.services link line, after the second line, add:
if (not null(logical.name in $File)) then ($query=$query+" and type=\""+$type+"\" and subtype=\""+$subtype"\"")
Then, when the user Fills the logical.name, it will pull back those other values as well, and then sure those to build the next query.