Erdman was elected as a Democrat to the Twenty-ninth Congress. He was an unsuccessful candidate for reelection in 1846.
Later career and death
He was elected associate judge of Lehigh County Court on November 9, 1866 and served until his death in Coopersburg, Pennsylvania, He is interred in Blue Church Cemetery near Coopersburg.