Bring a pot of salted water to a boil. Set up a large bowl of ice water. Add the fresh beans to the boiling water, and cook until crisp-tender, about 4 to 5 minutes. Drain and plunge the beans into the ice water to stop the cooking and set their color. Drain.
In a medium bowl, combine the beans and the onion.
In a small saucepan, bring the sugar, vinegar, oil, and salt to a simmer. Pour the liquid over the beans.
Marinate the beans at room temperature for 1 hour, tossing several times.
Just before serving, season with salt and pepper to taste, add the parsley. Serve.