The correct answer is During the Convention. In order to prepare for the party’s convention, there are several primary elections around the states. This is the opportunity voters from each party have so they can indicate their preference for a candidate to run to the Party’s convention.
Later, in the Party’s Convention, they designate the candidate for the presidential run.