Timesheet portal Project time category

Efren T_ Marti1
Tera Expert

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?

EfrenT_Marti1_0-1683925948609.png

 

4 REPLIES 4

Aniko Hegedus
Tera Expert

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

AnikoHegedus_0-1706100904950.png

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

Hi Aniko,

 

I am trying to achieve something similar, I tried updating the Link function on Time Card Grid Widget but that dint give the expected results. The dropdown on Time sheet portal is no longer available and secondly it doesn't bring back any value.

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?

I have fixed the issue, I noticed I had error in my code which was causing it to not show the values correctly.