Table query not working

Mike D1
Giga Guru

Hi

I am trying to run a background script to print the names of some templates on the sn_hr_core_template table.

When I run this query it does not print anything. If I enter that query in the list view it displays the records, so I am confused what is wrong with this script?

find_real_file.png

4 REPLIES 4

Tudor
Tera Guru

Hi Mike,

Are you sure you don't want to target the "sn_hr_core_task" table instead of the "sn_hr_core_template"?

I'm asking because "sn_hr_core_template" records don't have the "task_type" property OOTB.

If you're trying to target "task_type" as a field defined in the template under "template" that might prove difficult to achieve due to the way the field is configured.

Hope this helps!

 Tudor

 

Thanks for the response Tudor.

Ok I see what you mean. However it is definitely sn_hr_core_template/sys_template table I need to query. See an example below of fields I am wanting to query.

When I run it in the list view it returns the records fine. Is there some dot walking required to get there?

find_real_file.png

find_real_file.png

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Mike,

There's an error in addEncodedQuery string. What is the following query suppose to filter?

Is the query suppose to filter on template does not contain "hr_task_type=mark_when_complete"?

templateNOT LIKEhr_task_type=mark_when_complete

The screenshots are querying on "sys_template" table with filter condition "Short description", "starts with", "check for". There's no "hr_task_type" field in the screenshot.

Try setting a filter on the table and then right click on the filter and select "Copy query" and the paste the query to .addEncodedQuery() statement.

find_real_file.png

Hi Hitoshi

Sorry I was just showing another example to show the list and form I am trying to query. sn_hr_core_template is extended from sys_template.

Refer to my original post for the actual query I am using

 

Thanks

Mike