Apply Minimum 40 hours to time sheet portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 10:26 AM
Hi Team,
How to apply minimum hours to be filled by user to 40 in time sheet portal. I have verified time sheet properties but I saw only Maximum hours property. Help me here how to achieve minimum hours rule to be applied while clicking on Submit button validation has to happen.
Thanks for support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 05:44 AM
Hi @maneesh3 ,
You can write before insert/update BR with below.
if (current.total_hours < 40) {
gs.addErrorMessage("A minimum of 40 hours is required to submit the timesheet.");
current.setAbortAction(true);
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 10:24 AM
Hi Runjay,
Thanks for your help! Code is not working. Code needed for all time card entries for a week to be minimum 40 hours. Please suggest
Thanks,