Adding a Trend encoded query to a Business Rule

matthew_hughes
Kilo Sage

In a Business Rule, I'm wanting to add the following Trend search:

matthew_hughes_0-1696839938557.png

 

When I right click on the query and select 'Copy Query', it appears as:

sys_created_onDATEPARTMidnight hour@javascript:gs.datePart('hour','0','GE')^sys_created_onDATEPART8 am hour@javascript:gs.datePart('hour','8','LT')

 

I'm wanting to copy this query and apply it in a Business Rule as a condition. However, I get the following error:

matthew_hughes_1-1696840022620.png

 

If somebody could please explain what I need to do, that would be great.

16 REPLIES 16

Hi @matthew_hughes 

Which table this rule is running on? Is it a custom one which extends Task table?

If that so, you need to set the Order of your Business Ruler greater than the Order of the OOTB rule below.

Name: Set Closure Fields

URL: https://<instance_name>/sys_script.do?sys_id=59f3ba850a00070416e9c50e6215a8d1

TaiVu_0-1696928579314.png

 

It is because we need the "Closed at" field get populated to get its value. So the Order of your Business Rule should be 11000 for example.

Hi @Tai Vu I've now setup the Business Rule with the following screenshots:

matthew_hughes_0-1696929099497.png

 

matthew_hughes_1-1696929128067.png