You can achieve this by setting the validation in a Microflow. It's perfectly fine explained in the following post: https://community.mendix.com/link/space/microflows/questions/96924
Goodluck!
I assume you have the validation on the page. You can do more complex validations by using the onchange with a microflow, where you cab send a feedback message to the attribute you want to show the message. If you also use this validation in your calculate/save routine then the user gets validated on all interactions.
Did you check the learning path section 8 of the rapid developer course?
https://academy.mendix.com/link/modules/95/lectures/770/8.3-Validation-in-Microflows
yes i do this is my Validation