Trial and Error (1997)
Trial and Error is a 1997 release from New Line Cinema starring Michael Richards, Jeff Daniels, and Charlize Theron, about an attorney and the attorney's actor friend, who takes his place in court to defend the boss's hopelessly guilty relative. Comedic interplay and new romance ensues.
More at Wikipedia.