Create dummy string and return error message if true

158 Views Asked by At

I need to create a dummy string for my application on when a user search for an existing mail and if it is tagged as "erased" it will return an error message "user erased"

here is my wod file.

WOD:

<WebObject name=form2>

Customer email address:

<WebObject name=emailField></WebObject>

<WebObject name=submitEmailButton></WebObject>

</WebObject>

submitEmailButton : WOSubmitButton {
    action = submitEmail;
    value = "Search";
}

java:

NSArray persons = Person.personsWithEmail(email, session().defaultEditingContext());
        if ( (persons == null) || (persons.count() == 0) ) {
            errorMessage = "customer email \"" + email + "\" could not be found.";
            return null;
        }
1

There are 1 best solutions below

0
On

this is how submitemail look like in wod.

<WebObject name=form2>
Customer email address: <WebObject name=emailField></WebObject>
<WebObject name=submitEmailButton></WebObject>
</WebObject>

<br>
submitEmailButton : WOSubmitButton {
    action = submitEmail;
    value = "Search";

I need to add a condition that will check once a flag is tagged as erased it will show the error message.