Since there are no code regulations directly concerning dishwashers, your best place to ensure correct operation is probably the dishwasher's installation manual. For example, in the installation guide for my particular dishwasher, it mentions, among other requirements:
- use a new drain hose with a maximum length of 12 ft (3.7 m) that meets all current AHAM/IAPMO test standards, is resistant to heat and
detergent, and fits the 1" (2.5 cm) drain connector of the dishwasher.
- Make sure to connect drain hose to waste tee or disposer inlet above drain trap in house plumbing and 20" (50.8 cm) minimum above the
floor. It is recommended that the drain hose either be looped up and
securely fastened to the underside of the counter, or be connected to
an air gap.
Of course, your particular dishwasher model may have different requirements! I would say if you think your drain line is going to be much longer than 10' (depending on your dishwasher), then shirlock's answer of installing a new trap behind the dishwasher is likely the best advice.