Hi,
I have a form requirement as below where one of the validation is - for same combination of Operation, Comp stream, product code and end date being null for both, the error message to be displayed as below and raise trigger failure.

But this error is actually not retained as soon as I click on OK and also allows me to save the record without any issue. My expected resulted is to stop completely once that error is encountered.
The code which I have written is :

Just note that here we are handling a scenario where 1 row is already created in table and while second is going to be created then the comparison is between previous saved data plus current unsaved data.
Also if you could assist in a scenario where user enters first record and then enter second record. Those are not saved. Howz that to be handled.