AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
CRM
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 10.11.2009, 14:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
CRM Programmer: How to hide an items of drop-down list?
Источник: http://crmpro.blogspot.com/2009/11/h...down-list.html
==============

"We should not be able to choose some steps of Opportunity History, if the opportunity has no quotes or sales orders." - that was they said.

And that was I wrote.

var oService = null;
var oppid = null;

function FormOnLoad()
{
oService = new Ascentium_CrmService(null, null);

var oParentCrmForm = window.opener.parent.document.all.crmForm;
if(oParentCrmForm)
{
oppid = oParentCrmForm.ObjectId;
}

HideComboboxItems();
}


window.HideComboboxItems = function()
{
var newstep = document.getElementById("new_step");
if(newstep)
{
// checking opportunity for quotes
var sFetchXml =''+
'';

var aoFetchResult = oService.Fetch(sFetchXml);
var quoteCount = 0;

if(aoFetchResult.length > 0)
{
quoteCount = aoFetchResult[0].attributes["count"].value;
}

// if no qoutes, then hiding items 4,5,6,7 of dropdown list
if(quoteCount == 0 )
{
var allDropDownElements = newstep.childNodes;
var lastnodevalue = allDropDownElements.length;
for(var i=lastnodevalue; i >= 4; i--)
{
newstep.options.remove(i);
}
}
else
{
// if there is some qoutes, then checking for salesorders
var sFetchXml ='&lr;fetch mapping="logical" aggregate="true" version="1.0">'+
'';

var aoFetchResult = oService.Fetch(sFetchXml);
var SOCount = 0;

if(aoFetchResult.length > 0)
{
SOCount = aoFetchResult[0].attributes["count"].value;
}

// if no salesorders, then hiding items 6,7
if(SOCount == 0)
{
var allDropDownElements = newstep.childNodes;
var lastnodevalue = allDropDownElements.length;
for(var i=lastnodevalue; i >=6; i--)
{
newstep.options.remove(i);
}
}
}

}
}



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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
CRM DE LA CREME! CRM 4.0 Disaster Recovery Blog bot Dynamics CRM: Blogs 2 26.02.2016 08:23
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
Microsoft Dynamics CRM Team Blog: Building Rich-Client Dashboards for Microsoft Dynamics CRM with Windows Presentation Foundation Blog bot Dynamics CRM: Blogs 1 31.03.2009 13:24
Microsoft Dynamics CRM Team Blog: List Web Part for Microsoft Dynamics CRM 4.0 Deployment Scenarios Blog bot Dynamics CRM: Blogs 0 30.01.2009 22:05
Microsoft Dynamics CRM Team Blog: List Web Part for Microsoft Dynamics CRM 4.0: Understanding Connections Blog bot Dynamics CRM: Blogs 0 20.01.2009 02:07
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 18:03.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.