Thursday 24 December 2015

Validation for alphabatics Id

public boolean validateWrite()
{
   //Created by: Dhanya — unibuzz
   //Date Created: 13th june 2011

   boolean ret;
   ;

   ret = super();

   if( (strlen(this.ItemGroupId)  < 3 || strlen(this.ItemGroupId)  > 3))
   {
        throw error(“Family must be exactly 3 characters”);
   }

   if(strnfind(this.ItemGroupId,“ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz”, 1, 3))

   {
       throw error(“Family should contain only alphabets. Numbers or special charaters not allowed”);
   }
   return ret;
}

No comments:

Post a Comment