Update template and the code to include column LASTMODIFIED with date from accession#lastModifiedDate.
LASTMODIFIED
accession#lastModifiedDate