In this article, optimal design and advanced exergetic, exergoeconomic, and exergoenvironmental analyses of a trigeneration system for an office building based on integration flat plate solar collector and gas turbine have been performed. The proposed system includes a heat recovery steam generator, a steam turbine, a solar plate collector, and an absorption chiller. The transient simulation for solar calculation has been done using transys software. In addition, a computer code was built to compute conventional and advanced exergy, exergoeconomic, and exergoenvironmental evaluation dynamically. Furthermore, multiobjective optimization by NSGA-II and cuckoo Search algorithm with maximum exergetic efficiency, minimum total exergetic cost, and minimum exergetic environmental impacts has been carried out simultaneously. The results demonstrate that the three objective parameters have been enhanced. Also, the endogenous, exogenous, available, and unavailable parts of exergy destruction have been determined.