function loadLOBForm() {

    var HDFORMID = "836e163c-5f4e-4abb-a75b-5e8e9c70deb4";
    var HBFORMID = "d8e13fa0-e09f-482b-ac15-d7d212ff323e";
    var ROFORMID = "73b31959-329b-4967-ab19-cf115109c91c";
    var NCCHVFORMID = "e3e6071c-c046-4deb-90ad-f9ae69a5e3b5";

    if (Xrm.Page.ui.getFormType() != 1) {
        var currentFormName = Xrm.Page.ui.formSelector.getCurrentItem().getLabel();
        var currentFormId = Xrm.Page.ui.formSelector.getCurrentItem().getId();

        var lob = Xrm.Page.getAttribute("DNS_lobid").getValue();
        var formId = ROFORMID;

        switch (lob[0].name) {
            case "Help Desk":
                if (Xrm.Page.ui.formSelector.items.get(HDFORMID) != null) {
                    formId = HDFORMID;
                }
                break;
            case "Health Benefits":
                if (Xrm.Page.ui.formSelector.items.get(HBFORMID) != null) {
                    formId = HBFORMID;
                }
                break;
            case "HRC":
                if (Xrm.Page.ui.formSelector.items.get(HBFORMID) != null) {
                    formId = HBFORMID;
                }
                break;
            case "NCCHV":
                if (Xrm.Page.ui.formSelector.items.get(NCCHVFORMID) != null) {
                    formId = NCCHVFORMID;
                }
                break;
            default:
                formId = ROFORMID;
                break;
        }

        if (Xrm.Page.ui.formSelector.items.get(formId) != null && currentFormId != formId) {
            Xrm.Page.ui.formSelector.items.get(formId).navigate();
        }
    }
}

var mvi = {
    personSelected: function (id, name) {
        var veteran = new Array();
        veteran[0] = new Object();
        veteran[0].id = id;
        veteran[0].name = name;
        veteran[0].entityType = "contact";
        Xrm.Page.getAttribute("customerid").setValue(veteran);

        Xrm.Page.getAttribute("customerid").fireOnChange();
    }
}
