Yes, we've always trained our dogs not to crap in the yard.
It's the only way to go.
Our dogs go to the very edge of our property to take care of business. Also, sometimes they stay in the house but they were never house trained. No accidents in the house.