I am trying to perform validation on the project for screen EP307000.
Under Project Preferences we have defined the non project code as ‘X’.
What I want to achieve is to prevent users from saving their time entry when they have not selected their project, and it defaults on ‘X’.
I would appreciate any help.
Best answer by Cesar Betances
If you are trying to add validation at the moment the user presses the Save button on your screen, you could try to add your validation on Persist() method. You could:
-Create graph extension of that screen’s graph.
-Override Persist() method.
-On this override you will add your validation, and then call base(persist) method, similar to this:
public void Persist(Action baseMethod)
if( YourValidationFailed) throw new Exception("Fail!"); //Add your validation code
baseMethod(); //Call base method