Running Solenoids from RAMPS
Solenoids produce back voltage upon shutoff, so they cannot be driven directly by RAMPS without using protective flyback diodes. The RAMPS on-board transistors do not have flyback diodes with them. [1].
Thus, use external relays for switching. Use M42 with the numerous I/O pins on RAMPS. Such as the AUX pins on RAMPS.