Validation

Hi guys,

See the .oml

No duplicate data records should be enter between from date - to date

Suppose,

Start date= 1 Apr 2022

End date= 13 Apr 2022

And no record should be enter between Start date and End date.

Suppose I enter

Start date = 2 Apr 2022 

End date = 10 Apr 2022

then it must show me an message.

How to compare the all the from dates and to dates from the database to the entered from date and to date. 

See the Performance schedule screen

 

EPES.oml

HI Rohan,

Use some think like this in Aggregate filter  and if you return any item that means the date is already present in database.


As an alternative approach you can also use SQL query where you can use BETWEEN keyword to find date between two dates.

Please find attached sample in Validation page

TestJob.oml

Hi Rohan,

agree with Devendra that this is done by a filter in your aggregate, but suggested filter won't catch all overlap (if overlap is what you are looking for)

An existing record in the database that starts after the newly entered record, and stops before the newly entered record, won't be found with this filter.

this is a filter that will work to catch all overlap :

DB.FromDate < NewRecord.ToDate AND DB.ToDate>NewRecord.FromDate

OR, if a record is not allowed to start on the same day another stops :

DB.FromDate <= NewRecord.ToDate AND DB.ToDate>=NewRecord.FromDate

Dorine

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.