How to use javascript condition in a report

KaMmILa__
Tera Expert

I have a report in which we need to use  javascript:new Filter_Agent().filterlocation() for locations 

how to do that ?

find_real_file.png

1 ACCEPTED SOLUTION

KaMmILa__
Tera Expert

I fixed this issue by going to reports table and selected the report , there I have an Option to use the java script in the UI 16 I am not able to do that 

View solution in original post

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron

This is a limitation of the condition builder trying to be helpful, only offering/allowing certain conditions for certain field types.  I've only gotten this to work on String type fields, without any Choices, using the operator is one of.  It looks like the only operator that will allow you to enter your javascript condition for Location is contains, so your script would have to return something that matches that, which is probably not likely.  A workaround I have used when a javascript condition is absolutely necessary is to create a new string field on the table, called something like Reporting location in this case.  Use a Fix Script to copy the (sys_id) value of location to u_reporting_location, then a simple Business Rule to keep them in sync with any further record additions and/or changes to location.  In your report, you can now use Reporting location is one of javascript... with the script returning one, or a list of, location sys_ids.

 

KaMmILa__
Tera Expert

I fixed this issue by going to reports table and selected the report , there I have an Option to use the java script in the UI 16 I am not able to do that