Is it necessary to record a transaction if it has no effect on the accounting equation?

No, it is not necessary to record a transaction if it has no effect on the accounting equation. Transactions that do not affect the accounting equation are not recorded in the books of accounts.