Sort time cards on Copy from previous Time Sheet feature

Casey Jones
Tera Contributor

We had a request from one of our users to change the sort on the Select Time Sheet option on the Copy from previous Time Sheet feature. This feature is an out of the box feature with the Time Sheet Portal. We have looked at a few widgets, but we have been unable to find where we can change the sort. Can anyone help with a possible place to look or maybe steer us in the correct location? I have included a screenshot to show how how the time sheets are sorted in our system.

8 REPLIES 8

Mahendra RC
Mega Sage

Hello @Casey Jones 

Could you please share on what basis you need to sort the Select time field data?

 

Currently it is sorted oldest to newest and we are wanting it sorted newest to oldest. When a customer tries to use the feature they are scrolling through weeks and weeks of time sheets to get to the most recent week. They have started using the search option as a workaround, but we are still wanting to change the sort.

Narendran Dhana
Tera Contributor

Hi Casey,

Did you managed to fix this sorting issue?

 

Regards,

Narendran

Aniko Hegedus
Tera Expert

Hello Everyone,
I was struggling with this issue too and figured out that you have to make changes in the link function of the "Time Card Portal Main Container" widget. Go to "$scope.timesheetFilter" and add "+ '^ORDERBYDESCweek_starts_on';"

AnikoHegedus_0-1675252802353.png

 

Just FYI, this filter is called in the widget's angular template: "copy-timesheet-modal".
Hope it helps,
Aniko