Показать сообщение отдельно
Старый 13.08.2009, 15:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
CRM Programmer: Remove 'Add Existing...' button from associated view entities form
Источник: http://crmpro.blogspot.com/2009/08/r...tton-from.html
==============

I was found this code at Dave Hawes blog — http://blog.davehawes.com/post/2008/...xx-button.aspx
This code should be added to onLoad event for the form of the entity where you want to hide buttons for the associated views of other entities.


HideAssociatedViewButtons('new_account_new_accountclassificate', ['Добавить к этой записи существующий объект Классификация организации']);

function HideAssociatedViewButtons(loadAreaId, buttonTitles){
var navElement = document.getElementById('nav_' + loadAreaId);
if (navElement != null) {
navElement.onclick = function LoadAreaOverride() {
loadArea(loadAreaId);
HideViewButtons(document.getElementById(loadAreaId + 'Frame'), buttonTitles);
}
}
}

function HideViewButtons(Iframe, buttonTitles) {
if (Iframe != null ) {
Iframe.onreadystatechange = function HideTitledButtons() {
if (Iframe.readyState == 'complete') {
var iFrame = frames[window.event.srcElement.id];
var liElements = iFrame.document.getElementsByTagName('li');

for (var j = 0; j < buttonTitles.length; j++) {
for (var i = 0; i < liElements.length; i++) {
if (liElements[i].getAttribute('title') == buttonTitles[j]) {
liElements[i].style.display = 'none';
break;
}
}
}
}
}
}
}

Publishing it here for memory.


Источник: http://crmpro.blogspot.com/2009/08/r...tton-from.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.