Check Record For NULL End Date Before Creating New Record

Hi, I have a table that stores records for people allocated to resources, the record has a start and end date for the duration of the use of the resource. What I need to be able to do is to check all records for a person to see if there is already a record that has a start date but a NO end date before adding another ward record. Basically people can move from one resource to another and there needs to be a record of the duration of use of each resource. So I need to ensure that the previous record is completed with an end date before creating a new record. How would I do this, I'm guessing a microflow and rule? Hope this makes sense!!!! Regards Nick
1 answers

You need te execute a microflow indeed.

To check whether such a record exist, you can use retrieve an allocation with the following xpath: Retrieve from database, first only, where [module.Allocation_Persion = $myperson][startdate != empty][enddate = empty]