UI Action Condition on Task table - Should check value in 'u_m2m_tasks_tasks' table

Supriya39
Giga Guru

Hi All,

 

I have a requirement. I have UI action button 'Convert Ticket' . I have another table u_m2m_tasks_tasks table with column u_to. this u_to is reference column from task table only. 

I want to put a condition on UI action to check whether current.sys_id is present on u_m2m_tasks_tasks table's u_to column and also query u_type is of value 'Conversion'. If present the UI action is should not be visible, it not present then visibile. 

Plz help .

 

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

Hi @Supriya39 you may need to write a script include to glide u_m2m_tasks_tasks and return true/false based on logic,

then call this script include in UI Action condition to validate whether to make the button visible or not

 

Below link has the reference to implement the same.

 

https://www.servicenow.com/community/developer-blog/use-script-include-in-a-condition-field/ba-p/227...

Regards
Harish

View solution in original post

3 REPLIES 3

Harish KM
Kilo Patron
Kilo Patron

Hi @Supriya39 you may need to write a script include to glide u_m2m_tasks_tasks and return true/false based on logic,

then call this script include in UI Action condition to validate whether to make the button visible or not

 

Below link has the reference to implement the same.

 

https://www.servicenow.com/community/developer-blog/use-script-include-in-a-condition-field/ba-p/227...

Regards
Harish

Supriya39
Giga Guru

Hi Harish, 

Thanks for responding. I created script include as mentioned. Find below screenshot. 

 

Also Called it from ui action. Still failing 

 

 

Hi @Supriya39 there is a error in your script include at line 8. it must be gr.hasNext() not check.hasNext().

Regards
Harish