The record date is the cut-off date used to determine which shareholders of a stock are entitled to a dividend. The record date is set by the board of directors of a corporation. Based on the record date, the board of directors can also determine who should receive stock reports and other financial information relating to the investment.
The ex-dividend date (or ex-date) of a stock is dictated by stock exchange rules and is usually set to be one business day before the record date.
To be eligible for any corporate action, you will have to have a position in the relevant stock before the ex-date, and on the record date, the stock needs to be present in your demat account.
For example: Consider corporate action of dividend for ABC company, where ex-date is 1st Oct 2020, and the record date is 3rd Oct 2020, then you should have the stock in your demat account by the 3rd of October 2020 for being eligible for receiving the dividend.