Monday, October 19, 2015

Change Tab Order in CRM

Default tab order in CRM is top to bottom, if we want to change it and suppose we have lots of field in form then use below function and call it on OnLoad().


TabOrderLefttoRight: function () {
for (var i = 0; i < Xrm.Page.ui.controls.getLength() ; i++) {
var control = Xrm.Page.ui.controls.get(i);
var element = document.getElementById(control.getName());
if (element.tabIndex && element.tabIndex != "0") {
if (element.className == 'ms-crm-Hidden-NoBehavior')
continue;
if (element.tagName == 'A') {
if (element.className != 'ms-crm-InlineTabHeaderText')
continue;
}
element.tabIndex = 1000 + (i * 10);
}
}
},

1 comment:

  1. Your code sets the tab order as left to right. However there is a problem when it comes to currency fields as when you first tab into it the currency symbol is selected, and you can't type anything, and you have to tab again to be able to type anything into the field.

    Is there a way for the code to ignore these symbols and go straight into the field itself?

    ReplyDelete