I want to display an error message with as below with a skuid snippet,
var $ = skuid.$;
var pageTitle = $(‘#PersonalDetailsForm’);
var editor = pageTitle.data(‘object’).editor;
var PersonalDetailsFormModel = skuid.model.getModel(‘PersonalDetailsForm’);
var PersonalDetailsForm = PersonalDetailsFormModel.getFirstRow();
if (PersonalDetailsForm.Asic_CountryOfBirth__c === ‘Australia’) {
editor.handleMessages(
e{
message: ‘Error message xyz’,
severity: ‘ERROR’
}]
);
return false;
}
the “var editor = pageTitle.data(‘object’).editor;” sections gives an error message saying that
“Uncaught TypeError: Cannot read property ‘editor’ of undefined”
The wired thing here is that the same code snippet worked for some other pages in my system without an error.
Why am I getting this error in my second implementation, I have noticed that there is a model with the same name as the pageTitle “PersonalDetailsForm”,
Could this be an issue?
Appreciate your help
thanks.