call functions from script include in filter condition of widgets

heeram
Tera Contributor

Hello,

I am trying to add a filter condition to the widget instance of a simple list in service portal.

We have a requirement where we have to select a list of cases based on a complex/indirect filter condition.

Can we write the condition in a script include and return the values to be used within the filter condition of the widget instance?

3 REPLIES 3

Rama Chandra D
Kilo Guru

Hi Heera,



I would suggest creating a dynamic filter option and let it call the Script Include. Once, the dynamic filter option is created, you can create an encoded query as you desire and pass it to the widget. The server script should be able to execute this filter.



Here is a link to it : Create a dynamic filter option



If you desire to implement something other that what I think, Please feel free to clarify.



Darshak


So it appears that dynamic filter does not work in scoped apps.  What to do?

 

HungMiju
Mega Expert

Hi Heera,



Please try in client script of widget:
        $scope.data.filter = new [name of script include]().[function]()