Most children who don't wet the bed at night have the ability to hold it all night or else they get up and use the bathroom. A child who is unable to hold it all night MUST be potty trained for nighttime. Following are instructions on what worked with my oldest when he was 4 and still wetting the bed...he was a heavy sleeper:
At bedtime, have him lay down in the dark with all bathroom and hallway lights off just as if it is the middle of the night. Ask him to pretend to be asleep and then think about how he feels when he needs to go during the day and pretend he is having that feeling while he is pretending to sleep. Ask him what he normally does when he feels the urge during the day...should be, "run to the bathroom". Have him practice "waking up", going into the bathroom, pulling his pants/undies down, pretending to urinate then pulling up the pants, flushing and getting back to bed. Have him do this visualization and practice routine 5-6 times in the evening at bedtime every night. Within a week or two he will probably be getting up in the middle of the night to go and most likely will not even recall doing it. My son, now 14 still "sleepwalks" to the bathroom to use the toilet in the middle of the night. I read about and tried this technique right before we tried the sheet alarm or putting him back in diapers...no pull ups at the time.
I hope it works as well for you. Good luck!