Here my field is lookup field
function PMSrecord(executionContext) {
debugger
var formContext = Context.getFormContext();
var wtype = formContext.getAttribute("new_preventivemaintenanceschedule");
if (wtype != null) {
wtypeValue = wtype.getValue();
if (wtypeValue != null) {
var entityTypeCode = wtypeValue[0].type;
var entityTypeName = wtypeValue[0].entityType;
var entityId = wtypeValue[0].id.replace("{", "").replace("}", "");
var entityText = wtypeValue[0].name;
if (entityText == entityText) {
formContext.ui.setFormNotification("Duplicate Record Found.", "INFO");
}
else
{formContext.ui.setFormNotification("Create Record.", "INFO"); }
}
}
}