It is not necessary to replace BOTH the keyless entry unit and the transmitter when repairing the keyless entry systems.
If there are any concerns with the keyless entry system, then first determine which of the parts is inoperative, and replace only the failed part.
For troubleshooting the keyless entry system, refer to the appropriate Workshop Manual (section 09) for Symptom Troubleshooting the Keyless Entry System.