On the other hand, nursery crops of flowering plants such as cilantro and alyssum can be used to attract and maintain populations of beneficial insects that are predators/parasites of many pest insects. Like a trap crop, there needs to be an adequate population of the nursery crop and it needs to be maintained to provide the nectar and pollen that feeds the beneficials.
Young seedlings should be protected from the flies that lay eggs at the base of the stems as the plants emerge. Those eggs hatch into maggot larvae that are pests on numerous vegetable crops (onion maggot, cabbage maggot, seed corn maggot which attacks several crops besides corn). Once those larvae are feeding underground, it is difficult to deliver most insecticides where they are needed to effectively kill the maggots. It is better to keep the adult female flies from laying the eggs in the first place. The challenge in using insecticides for this is in the timing and longevity of the materials available. If not properly timed to be there when the flies land, it will not work. Using a floating row cover insect barrier to exclude the flies from the fields can be a cost effective alternative and can remain on the crop for a longer period of time.