Time Cards - Time Sheet Policy
オプション
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
11-02-2023 02:47 PM
Hi , I was wondering if there might be an option to assign different Time sheet policies to users.
I would like to allow one group to post more than 24 hours max a day and the other group shall be
limited to 24hrs max per day.
Thank you for helping me.
1件の返信1
オプション
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
11-03-2023 01:00 PM
Hi @Wolf_k ;
You can create a business rule with the state changes to "submitted" on Update and add a script like this:
var currentUser = gs.getUser();
if( currentUser.isMemberOf('Group1')){
if(current.total <= 10){
gs.addErrorMessage("You need to upload more the 10 Hours");
current.setAbortAction(true);
}
if( currentUser.isMemberOf('Group2')){
if(current.total <= 20){
gs.addErrorMessage("You need to upload more the 20 Hours");
current.setAbortAction(true);
}
if( currentUser.isMemberOf('Group3')){
if(current.total <= 60){
gs.addErrorMessage("You need to upload more the 60 Hours");
current.setAbortAction(true);
}
}
If you want to check the max per day do something like this:
var currentUser = gs.getUser();
if( currentUser.isMemberOf('Group1')){
if(current.sunday > 24){
gs.addErrorMessage("You put more than 24 hours on Sunday");
current.setAbortAction(true);
}
if(current.monday> 24){
gs.addErrorMessage("You put more than 24 hours on Monday");
current.setAbortAction(true);
}
if(current.tuesday > 24){
gs.addErrorMessage("You put more than 24 hours on Tuesday ");
current.setAbortAction(true);
}
if(current.wednesday > 24){
gs.addErrorMessage("You put more than 24 hours on Wednesday");
current.setAbortAction(true);
}
if(current.thursday > 24){
gs.addErrorMessage("You put more than 24 hours on Thursday");
current.setAbortAction(true);
}
if(current.friday > 24){
gs.addErrorMessage("You put more than 24 hours on Friday ");
current.setAbortAction(true);
}
if(current.saturday > 24){
gs.addErrorMessage("You put more than 24 hours on Saturday");
current.setAbortAction(true);
}
}
}
Know you have an idea how to check, the good is the error is displayed in you time sheet portal when the user tried to submit.
Hope that help You