How to restrict Date fields to select past dates, weekend & public holidays in Alfresco Process Servicce?

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
deepak_talape
Active Member

How to restrict Date fields to select past dates, weekend & public holidays in Alfresco Process Servicce?

Hello Experts,

I am quite new to Alfresco Process Service, I have one workflow due date field on metadata form but now it's allowing users to select past dates also, but workflow due date will never be past date.

I also wan't to restrict users to select Saturday's & Sunday's which are holidays.

And if possible, I also want to restrict users to select public holidays.(It's ok if we can provide the hard coded list of public holidays)

Please suggest the possible ways to do this, also share any code snippet if it only possible through some customization.

Thanks in Advance.

5 Replies
deepak_talape
Active Member

Re: How to restrict Date fields to select past dates, weekend & public holidays in Alfresco Process Servicce?

Can someone please provide some guidance or a direction that how can I proceed further to achieve this in my APS workflow. Any suggestions or help will be really appreciated.

vikash_patel
Established Member

Re: How to restrict Date fields to select past dates, weekend & public holidays in Alfresco Process Servicce?

Hi Deepak,
I have one solution I don't know which will be suitable for you but you can try,
You can use script tasks, in script task get the value of date and check date is past date or holiday,

if your condition matches then go forward else return the task to the same task.

Thanks,

Vikash

deepak_talape
Active Member

Re: How to restrict Date fields to select past dates, weekend & public holidays in Alfresco Process Servicce?

Vikash Patel‌ Thanks for the reply, but I have to provide this validation on metadata form itself, I don't have option to return a complete task to the same task if date is invalid. Instead of the I want to prevent users by selecting invalid date from metadata form itself without delegating workflow task.

vikash_patel
Established Member

Re: How to restrict Date fields to select past dates, weekend & public holidays in Alfresco Process Servicce?

Hi Deepak, 

I think you need to create custom form field,

Here is an document for custom form field this may solve your problem
https://community.alfresco.com/community/bpm/blog/2016/11/23/activiti-enterprise-developer-series-cu... 

mdtabrezmca
Established Member II

Re: How to restrict Date fields to select past dates, weekend & public holidays in Alfresco Process Servicce?

Hi Deepak,

    Your orignal question looks to be a kind of form validation before you submit a task. I think one of the other approach is to use Alfresco ADF custom form validation. But it is purely based on latest Angular framewoork

ADF Component Catalog