Reference qualifier field should restrict some values

suresh kaliappa
Tera Expert

Hi All , 

I have a reference qualifier field called swapped_ci in task_ci table. this table stores data about related records information.  now my requirement is if task number contains INC then this field should restrict values based on the model present in affected ci field. Ex. in the selected affected ci if model is personal computer then only the ci which have model personal computer should be available in the reference field. Also , This should be applicable only for incident records but nor for other records . for other records it does not have any condition. So if anyone knows solution to this then please assist. 

 

 

1 ACCEPTED SOLUTION

You might need to switch to the advanced view.

LorenzVdV_0-1722503732976.png

 

View solution in original post

7 REPLIES 7

Mark Manders
Mega Patron

Put your model condition on the reference qualifier within a dictionary override on the incident table.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Hi Mark , Actually dictionary override option was not displaying. The reference field is not extended from any other table. only if the field was extended from any table we see dictionary override option. if the field exists in the same table then dictionary override will not be an option. 

 

To be more in detail. the task_ci stores related list information Ex. in incident form if affected ci was selected then in related list it will display ci name. like this simularly in problem and change also the related list will display based on the affected ci selected. so now particularly to incident table if there is any value in the related list. then swapped ci field should restrict the reference field with some conditions otherwise it should not. 

If it's not extended from task (which was my assumption because you wanted it to work only for incidents, not on other tables), you can just put the reference qualifier on the field itself. It will have no impact on other tables, if the field is on the table itself.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

LorenzVdV
Giga Guru

 

javascript: var toReturn = ""; if(current.task.getDisplayValue().startsWith('INC')) toReturn = 'sys_class_name=' + current.ci_item.sys_class_name; toReturn

 

 

It looks wonky but it works. My working example to only show users of a certain department when the task is an INCxxx :

LorenzVdV_0-1722428524559.png

Edit: Rereading your requirements, I forgot it needs to dynamically use the class of the affected CI. I don't think it's possible in this way. What I posted doesn't seem to allow dotwalking, which is what you need to retrieve the class of the affected ci.  It does support dotwalking. My previous attempt must have had another error somewhere. I don't know if my code will work exactly for what you want, but it should give you a structure to adjust to your needs.