cancel
Showing results for 
Search instead for 
Did you mean: 

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

deepak_talape
Champ on-the-rise
Champ on-the-rise

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 5

deepak_talape
Champ on-the-rise
Champ on-the-rise

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.

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
Champ on-the-rise
Champ on-the-rise

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.

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
Star Contributor
Star Contributor

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