Wrong validation message displaying while changing email in MyAccount.

When we try to change the email address in profile information in my account with a wrong password the a wrong validation message will be displayed in the pop-up. This issue exists in all the SCA website. For example screenshots of different website has been added below.

Artina:

OneSource:

Cleerline:

Bastion:

The error is coming similar if the we enter a wrong email or password in login page.

While checking it in the netsuite customize text section the first message is getting displayed instead of the second message.

So in order resolve the issue we need to extend the corresponding view and add the below code.

                _.extend(GlobalViewsMessageView.prototype, {
                    getContext: _.wrap(GlobalViewsMessageView.prototype.getContext, function (fn) {
                        try {
                            var context = fn.apply(this, _.toArray(arguments));
                            var currentUrl = this.el.baseURI;
                            if (currentUrl.includes("profileinformation") && document.getElementsByClassName('global-views-modal-content').length) {
                                var message = "Incorrect email or password. Please correct your email and password.";
                                context.message = message;
                            }
                            return context;
                        } catch (error) {
                            console.error('Error in displaying the validation message for', error);
                        }
                    })
                });

By this a proper validation message will be displayed.

Leave a comment

Your email address will not be published. Required fields are marked *