Hello Ankur ,
I am using below script include and Catalog client script
Script include:

var BusinessAppNameValidator = Class.create();
BusinessAppNameValidator.prototype = Object.extendsObject(AbstractAjaxProcessor, {

    checkName: function () {

        var appName = this.getParameter('sysparm_application_name');

        var result = {
            exactMatch: false,
            exactSysId: '',
            similarRecords: []
        };

        if (!appName)
            return JSON.stringify(result);

        var inputName = appName.trim().toLowerCase();

        var gr = new GlideRecord('cmdb_ci_business_app');
        gr.addQuery('operational_status', 1); 
        gr.addQuery('name', 'CONTAINS', appName);
        gr.orderBy('name');
        gr.query();

        while (gr.next()) {

            var existingName = gr.getValue('name');
            var existingSysId = gr.getUniqueValue();

            if (existingName.trim().toLowerCase() === inputName) {
                result.exactMatch = true;
                result.exactSysId = existingSysId;
            }

            result.similarRecords.push({
                name: existingName,
                sys_id: existingSysId
            });
        }

        return JSON.stringify(result);
    }

});

Catalog Client script:

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || !newValue) return;

    g_form.clearMessages();

    var ga = new GlideAjax('BusinessAppNameValidator');
    ga.addParam('sysparm_name', 'checkName');
    ga.addParam('sysparm_application_name', newValue);

    ga.getXMLAnswer(function(answer) {
        if (!answer) return;

        var result = JSON.parse(answer);
        if (!result || (result.similarRecords.length === 0 && !result.exactMatch)) return;

        var encodedQuery = "nameLIKE" + newValue + "^operational_status=1";
        var listUrl = "/cmdb_ci_business_app_list.do?sysparm_query=" + encodeURIComponent(encodedQuery);

        var message = "";
        message += "<div style='margin-bottom:8px;'>";
        message += "There are other similar records that already exist in CMDB. ";
        message += "Please view the existing records to see if it meets your requirement.";
        message += "</div>";

        message += "<div style='margin-bottom:8px;'><strong>List of Business Application Names:</strong></div>";
        message += "<ul style='margin-top:0;'>";

        // SHOW ALL records including duplicates
        result.similarRecords.forEach(function(rec) {
            message += "<li>" + rec.name + "</li>";
        });

        message += "</ul>";

        message += "<div style='margin-top:8px;'>";
        message += "<a href='" + listUrl + "' target='_blank'><strong>Click Here</strong></a> for more information.";
        message += "</div>";

        // Show error if exact match exists
        if (result.exactMatch) {
            g_form.addErrorMessage(message);
        } else {
            g_form.addInfoMessage(message);
        }
    });
}

I am getting below message on top of form  but it is staying just for 3 seconds and goes away and if i click again out side Application name field then no message as name is not changed .
how can i put this message till the time user does not close or if there is any other approach to do this .I want to show message with hyperlink of list view of those business application.If message is below field then it would be more than fine .

 
 

 

 
There are other similar records that already exist in CMDB. Please view the existing records to see if it meets your requirement.
List of Business Application Names:
  • C
  • C
  • C
CLICK HERE  for more information.