Dividends account

How do you set up a dividend general ledger account to ensure it rolls into retained earnings at year-end? I initially set up a dividend account as a balance sheet account, but it didn’t roll into retained earnings as expected, leading me to suspect an error in my approach. Can I rectify this by creating a journal entry to the Retained Earnings account setup in Book Maintenance?
What is the correct procedure for setting up a dividend account?