The error thrown is as follows:
One of the scripts for this record has caused an error. For more details, download the log file.
Cannot read property '0' of null
Session Id: c9106d20-41db-4879-923e-158f1fe8f696
Correlation Id: dc1c11a1-3481-4837-98f5-a46bb93649cbEvent Name: onchangeWeb
Resource Name: XXXXXXXXX
Solution Name: ActivePublisher Name: DefaultPublishercorizance2Time: Sun Nov 29 2020 13:34:04 GMT+0530 (India Standard Time)
I have added this JS for onchange event handling for the lookup field name2.
While entering lookup field - "name2" (optional field), I need to validate it against name1 (required field) whether they are equal.
If equal - throw error.
If not equal - no action required.
If I clear the lookup field - the script throws error.