The movie is based on the book "Hard Sell: The Evolution of a Viagra Salesman" by Jamie Reidy.
Jamie Randall (Jake Gyllenhaal) is a guy who goes through jobs and women pretty frequently until he takes a job for Pfizer as a drug sales rep, and meets Maggie (Anne Hathaway), a young woman with early onset Parkinson's. She doesn't want to get serious with anyone because of her disease, and thinks he's the right choice to have casual encounters with. Of course the two of them fall in love.
To cap off the end:
Jamie lands Viagra and becomes very successful. Maggie decides her sickness will only hold him back, so she breaks up with him. While apart, he gets promoted to Chicago without Bruce (Oliver Platt's character.) While packing his things for Chicago, he comes across a video he and Maggie made, and remembers how happy the two of them made each other. He stops the tour bus she's on taking the seniors to Canada for their prescriptions and tells her they need each other. She hates that she will always need him more, and he declares his devotion to her. He gives up Chicago and stays there with Maggie, applying for med school.