CRM 2013 JAVASCRIPT TRY CATCH ÖRNEĞİ

CRM 2013 JAVASCRIPT TRY CATCH ÖRNEĞİ

//kaydet anında hata patlatıp engelleyen fonksiyon

onSave = function () {
    try {
        //Variables
        var attSabitTel = Xrm.Page.getAttribute("telephone1");
        var attCepTel = Xrm.Page.getAttribute("mobilephone");

        if (attSabitTel != null && attCepTel != null) {
            if (attSabitTel.getValue() == null && attCepTel.getValue() == null) {
                alert("Sabit Telefon veya Cep Telefon bilgilerinden enaz birisi doldurulmuş olmalıdır.");
                event.returnValue = false;
                return false;
            }
        }
        else {
            alert("telephone1 veya mobilephone null olamaz. Lütfen Sistem Yöneticinize danışın.");
        }

    } catch (ex) {
        throw ex;
    }
}

Yorumlar

Bu blogdaki popüler yayınlar

CRM search can not find deactive records

Microsft CRM makale arama seçeneklerinin default değerini değiştirme