Are you talking about dream incubation? I've had very little success with it in non-lucid dreams, but if you can gain lucidity it becomes pretty easy to remember a task and try to complete it.