Discussion

new Rule-Edit-Validate rule not defined

Hello,
i created a new new Rule-Edit-Validate rule today called AlphaSpaceValidation. This checks a data field to make sure that only letters are allowed including spaces.

I then wanted to choose this validation rule on a Last name property form under the Input Processing Section of the form, and I see the new validation rule after hitting the smart prompt dropdown list. After selecting AlphaSpaceValidation, and click save I get an error message that says

"AlphaSpaceValidation is not a valid entry.
Edit Validate AlphaSpaceValidation not defined in Rule-Edit-Validate"

I then looked at the Rules by Type nav bar and I see it listed under Rule-Edit-Validate. So what could the problem be here?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

November 18, 2008 - 9:54am

this is now resolved.

thanks

November 19, 2008 - 3:12am

quote:


Originally posted by KAFRAWYE

this is now resolved.

thanks


Could you please also share the solution.

November 19, 2008 - 11:05am

I needed to save this new validate rule on the actual ruleset of the specific property I was using for this validation.

January 5, 2016 - 7:10am

thanks

January 5, 2016 - 7:15am

Could you please share the 'AlphaSpaceValidation' java code. I have tried with tha same name like 'AlphaSpaceValidation' as follows, but it's not working

-----------------------------------------------------------------------------

boolean valid = (theValue!= null) && (theValue.length() > 0);
   if (valid)
   {
           char c;
           for (int i=0; valid && i < theValue.length(); i++)
        {
               c = theValue.charAt(i);
               valid = Character.isLetter(c)||Character.isWhitespace(c);
           
             if(valid=false){ 
              theProperty.addMessage("Please enter a valid text.");
             }   
         

            }

    return valid;
   } else{

    theProperty.addMessage("Please enter a valid text."); 
    return valid;
   }

-----------------------------------------------------------------------------------

thanks