I have a friend that lives in a condo on the 5th floor and she uses this trick year around... she has a very small dog... it all started when she had surgery and even really going to the elevator was challenging... She bought the smallest kiddie pool she could find, she lined it with puppy pads, then cat litter ( to absorb and for the smell), then with a few piece of sod placed on top... and a supply of doggie doo bags.... and it worked really great... she kept it out on her patio... it was really easy for her to manage on her own... she practiced with her dog so that he would understand what to do before the surgery....
Not sure how small is small, but for a sand box for grandkids, we use a cement mixing bin . Large one for base, smaller one for cover. For a small dog, I'm guessing that might work too.