The environment can only alter genotypes when its action causes alterations in the genetic material (mutations) of the individual, i.e., deletion, addition or substitution of entire chromosomes or of nucleotides that form the DNA molecules.
Mutations are only transmitted to the offspring when affecting the germ cells that produce gametes or the gametes themselves.