Section 7 provides that no action, suit or proceeding may be maintained in any court, nor any administrative or other action taken to recover a fine or damages or to compel the removal, alteration, or relocation of any structure or part of a structure or alteration of a structure, by reason of any violation of any zoning bylaw except in accordance with the provisions of Chapter 40A.