Python Validation Code:
# Use failed = True to specify that the id number is not valid.
# You can use the following variables :
# - self: browse_record of the current ID Category browse_record
# - id_number: browse_record of ID number to validate
# Sample 1: ID number only contains digits
if not id_number.name.isdigit():
failed = True
else:
failed = False
# Sample 2: Length of ID number cannot exceed 10 chars
failed = len(id_number.name) > 10 and True or False
# Sample 3: ID number must start with the category code
failed = not id_number.name.startswith(self.code) and True or False