/*GokhanMentese Ornek Javascript*/
function Quote_OnLoad() {
var formType = Xrm.Page.ui.getFormType();
if (formType == 1) {
/*Form Create Hali*/
}
else {
}
/*Formdaki alana keydown , keyup ekleme*/
Xrm.Page.getControl('new_fileexplanation')._control._element.attachEvent("onkeydown", addQuoteNameKeyDown);
Xrm.Page.getControl('new_fileexplanation')._control._element.attachEvent("onkeyup", addQuoteNameKeyUp);
}
function addQuoteNameKeyDown() {
return KeyDown("new_fileexplanation");
}
function addQuoteNameKeyUp() {
return KeyUp("new_fileexplanation");
}
function KeyDown(field) {
var e = window.event;
if (e != null && e.keyCode != null) {
if (KarakterGecerliMi(e)) {
return true;
}
else {
return false;
}
}
}
function KeyUp(field) {
var e = window.event;
if (e != null && e.keyCode != null) {
if (KarakterGecerliMi(e)) {
var fileExplanation = document.getElementById(field);
var quote = Xrm.Page.getAttribute("name");
var quoteName = quote.getValue();
if (fileExplanation != null && fileExplanation != undefined) {
var nameSecond = fileExplanation.value;
if (quoteName.length >= 13) {
var nameFirst = quoteName.substring(0, 13);
nameSecond = nameSecond != null && nameSecond != "" ? "-" + nameSecond : "";
quote.setValue(nameFirst + nameSecond);
}
}
}
}
}
function KarakterGecerliMi(e) {
if (e.keyCode != null) {
return true;
}
else {
return false;
}
}
Hiç yorum yok:
Yorum Gönder