How to make the project time sheet category mandatory in the time sheet portal after clicking add to time sheet from the task list

Ken65
Mega Expert

After clicking add to time sheet from the task list, an entry is created. The project time category drop down is not required and defaults to None when the time card is saved. Looking to make that drop down mandatory. Please advise.  thanks

1 ACCEPTED SOLUTION

Ken65
Mega Expert

I have implemented a solution although a bit of a hack. The time sheet portal doesn't appear to adhere to the dictionary configurations for a property to be mandatory. In the save function in the time card main container widget, I added an explicit check for a value in the field in the record coming into the function. Threw an alert and return false if validation failed. Thanks Andrew for your reply.

View solution in original post

10 REPLIES 10

Maitri Shah1
Kilo Explorer

Hello Ken,

i kind of needed the same solution could you paste your code of how did you edit the widget i am not able to find a solution for this.

 

Thanks in advanced

Maitri Shah

GregF2
Tera Expert

If anyone else is interested in this :

Please consider upvoting the idea submitted in community.  

GregF2
Tera Expert

Found a pretty straight-forward solution for this.  Try a data policy on time_card table.  Condition:  State = Submitted (OR State = Approved (if auto-approving timesheets)) AND Category is Project/Project Task.

Data policy rule on project_time_category = mandatory.

This should work in time sheet portal.  

Hi @GregF2 

Thank you for your solution. I have implemented this data policy, when trying to submit a time card without notes the data policy is triggered and an alert pops up that the field is mandatory. However, after completing the mandatory field and then trying to re submit there is some issue. Not able to submit as the same alert pops up even if the mandatory field has been completed. Can you assist please?