No special setting on the dishwasher prevents cloudy glasses. Cloudy glasses and dishes are a result of other factors such as mineral deposits, a clogged drain or a low water temperature. Using detergent incorrectly can also lead to cloudiness.
Dishwasher detergent is most effective if there is some residue left on dishes. If there is no dirt on the dishes, no acid is present for the detergent to neutralize. As a result, the detergent scratches the dishes, resulting in a cloudy appearance. Gel detergents tend to leave a residue on dishes so it is optimal to use a powder or liquid form detergent.