Showing posts with label alphabatics in axapta. Show all posts
Showing posts with label alphabatics in axapta. Show all posts

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;
}

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;
}