@Programmatic
    public TranslatableString validateApplicationTenancyAndDate(
            final DocumentType proposedType,
            final String proposedAtPath,
            final LocalDate proposedDate,
            final DocumentTemplate ignore) {

        final List<DocumentTemplate> existingTemplates =
                findByTypeAndAtPath(proposedType, proposedAtPath);
        for (DocumentTemplate existingTemplate : existingTemplates) {
            if(existingTemplate == ignore) {
                continue;
            }
            if(java.util.Objects.equals(existingTemplate.getDate(), proposedDate)) {
                return TranslatableString.tr("A template already exists for this date");
            }
            if (proposedDate == null && existingTemplate.getDate() != null) {
                return TranslatableString.tr(
                        "Must provide a date (there are existing templates that already have a date specified)");
            }
        }
        return null;
    }
@ Programmatic public TranslatableString validateApplicationTenancyAndDate ( final DocumentType proposedType , final String proposedAtPath , final LocalDate proposedDate , final DocumentTemplate ignore ) { final List < DocumentTemplate > existingTemplates = findByTypeAndAtPath ( proposedType , proposedAtPath ) ; for ( DocumentTemplate existingTemplate : existingTemplates ) { if ( existingTemplate == ignore ) { continue ; } if ( java . util . Objects . equals ( existingTemplate . getDate ( ) , proposedDate ) ) { return TranslatableString . tr ( "A template already exists for this date" ) ; } if ( proposedDate == null && existingTemplate . getDate ( ) != null ) { return TranslatableString . tr ( "Must provide a date (there are existing templates that already have a date specified)" ) ; } } return null ; }
region > validate...