Global symmetries and D-terms in supersymmetric field theories