a!sectionLayout( label: "Enter Waiver Information", firstColumnContents: { /**Citizenship Waiver**/a!gridLayout( headerCells: { a!gridLayoutHeaderCell( label: "First Name" ), a!gridLayoutHeaderCell( label: "Last Name" ), a!gridLayoutHeaderCell( label: "Country" ), a!gridLayoutHeaderCell( label: "Province" ), a!gridLayoutHeaderCell( label: "" ) }, validations: { if( count(ri!externalPerson.FirstName)>length(ri!externalPerson.FirstName),a!validationMessage( message: "The highlighted row requires a First Name", validateAfter: "SUBMIT" ),""), if( count(ri!externalPerson.LastName)>length(ri!externalPerson.LastName),a!validationMessage( message: "The highlighted row requires a Last Name", validateAfter: "SUBMIT" ),""), if( count(ri!externalPerson.CountryId)>length(ri!externalPerson.CountryId),a!validationMessage( message: "The highlighted row requires a Country", validateAfter: "SUBMIT" ),""), if( count(ri!externalPerson)=0,a!validationMessage( message: "Submission requires at least one row", validateAfter: "SUBMIT" ),"") }, columnConfigs: { a!gridLayoutColumnConfig( width: "DISTRIBUTE" ), a!gridLayoutColumnConfig( width: "DISTRIBUTE" ), a!gridLayoutColumnConfig( width: "DISTRIBUTE" ), a!gridLayoutColumnConfig( width: "DISTRIBUTE" ), a!gridLayoutColumnConfig( width: "NARROW" ) }, rows: a!applyComponents( function: rule!CATS_FORM_DIR_WAIVERS_eachRowDirectorsWaiversCitizenship( items: ri!externalPerson, index: _, itemsToken: local!itemsToken, activeCountries: local!activeCountries ), array: if( rule!ARR_isEmpty( ri!externalPerson ), {}, 1 + enumerate( count( ri!externalPerson ) ) ), arrayVariable: local!itemsToken ) ), a!linkField( label: "Add Link", labelPosition: "COLLAPSED", links: a!dynamicLink( label: "+Add Person", value: { FirstName: null, LastName: null, CountryId: null, Province: null }, saveInto: { a!save( ri!externalPerson, append( ri!externalPerson, save!value ) ), a!save( local!itemsToken, append( local!itemsToken, save!value ) ) } ) ) } )