Timesheet portal Project time category
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 02:13 PM
Hi All,
Been trying all day to figure out how to not show Project time categories that are disabled. I disabled some project categories on the table "project_time_category" however they are still showing on the timesheet portal. Does anyone have any idea how to not show inactive categories from showing up?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 04:56 AM
Hi,
Well, first of all how did you disable the project categories?
It took me a while to figure out a solution, but I added a new field (u_active) to the project categories table and then went to Time Card Grid (tc-grid) widget's link function and added this condition to the getDataHandler function
return function(term, page) {
var containsTermQuery = "^nameLIKE"+term+"^ORDERBYname";
if(field == "project_time_category") {
containsTermQuery += "^u_active=true";
}
return {
sysparm_query : activeQuery+containsTermQuery,
sysparm_fields: 'sys_id,name',
sysparm_display_value: 'all',
sysparm_limit: scope.data.pageSize,
sysparm_offset: (page-1)*scope.data.pageSize,
sysparm_exclude_reference_link: true
};
}
This did the job for me.
Best,
Aniko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2024 06:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2024 07:58 AM
Well, it's difficult to say anything without seeing your code. Maybe there's a syntax error or typo? Do you see any error messages in the console or in the logs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2024 08:19 AM
I have fixed the issue, I noticed I had error in my code which was causing it to not show the values correctly.