How to set validation via Microflow

I have following situation - I have two entities allocation and resource in which I want to allocate a resource between the following date- start date and end date and I want to write a validation if someone wants to allocate that resource in between the last allocated dates the validation will be fired
1 answers

Hello Shirjay, 


To validate this you can create a validation microflow and build there your specific logic for validating.


Please checkout this learning path: 



In your case you need to know if the resource is not already occupied to an allocation with a start and end date: 


- probably you need to retrieve if there is already an allocation for the resource on the given dates

- you can use a database retrieve action and within your xpath you need to make sure you only retrieve the associated objects of allocation to resource, furthermore you need to specify your date requirements, probably something like this:


Associated with resource


currentAllocation/startdate <= Enddate 


currentAllocation/enddate >= Startdate 


- if that returns empty you have a valid allocation if this is not returning empty then you have a conflicting allocation 


Good luck!!!*

I hope it helps