Hide Closed Completed Project Tasks on Time Sheet Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 06:02 AM - edited 08-23-2023 06:08 AM
Hi,
I have a requirement to hide completed project task(which has state=3) on time sheet portal.
for instance, this task shouldn't appear on all tasks.
Firstly I tried to do it on the time card portal - task selector widget. I edited the function getRecords(table) on server script. Here is the code that I changed:
var encodedQuery = actualDatesQuery + plannedDatesQuery + '^sys_class_name=pm_project_task^state!=3';
gr.addEncodedQuery(encodedQuery);
} else {
gr.addEncodedQuery('assigned_to=' + data.userId + '^sys_created_on<=' + weekEndsOnDateTime + '^sys_class_name=pm_project_task^state!=3');
As you see, I only added '^sys_class_name=pm_project_task^state!=3' to encodedquery.
It didn't work. I also tried to do it on script include which named TimeCardQueryHelper. I added gr.addQuery('active',true); line to _projectAndProjectTasksQuery and _allTasksQuery function.
neither that didn't work. If you have any idea, please don't hesitate to share it.
Thank you.