Depends on the the way the question was worded.
"Have you ever been violated" => you can answer no to that unless you were investigated, and formally violated.
"Have you ever been under investigation or violated" => in that case answer yes if violated OR you actually got the official written notification of an investigation, or possibly were notified by FSDO personnel about an investigation when they called you for info.
IMO getting a phone number and chewed out by tower/TRACON supervisor does not count as an investigation. And there would be no record. Pilot investigations are conducted by FAA/FSDO staff, not ATC personnel.
An airline might be able to get (via FOIA) records related to an investigation which did not result in violation, so probably best to be honest if actually investigated.