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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 20.05.2013, 18:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
dynamics-coe: Show Members Sub Grid on Marketing List Form in Dynamics CRM 2011
Источник: http://blogs.msdn.com/b/dynamics-coe...-crm-2011.aspx
==============

In one of my recent engagement, my customer asked us to show members sub grid on the marketing list form. In out of box implementation, one has to click on links to see marketing list members and it also demands navigating out of marketing list form.

There were many challenges in configuring this sub-grid on the marketing list form –
  1. Marketing List Member is not a normal entity but it is a special “relationship entity”. You cannot list view for it.
  2. In Marketing List, members could be “Lead”, “Contact” or “Account”. So which sub-grid do we add?
We gave thought to many options ranging from dynamically binding a sub-grid with fetch XML to something custom in Silverlight.

Finally, we finalized for a very simple solution.

Solution

The solution goes as following –
  1. On the marketing list form – add three tabs. In one tab add a sub-grid of “related records” for “Lead”. In other two tabs, do the same for “Account” and “Contact”. Give these tabs some nice “Label” something like “Marketing List Accounts”, “Marketing List Leads” and ““Marketing List Contacts”.
  2. Write java script on Marketing List form (“On-Load” event, for “Create Form” type), which hides all three tabs on the form. Well, when creating a new marketing list, you don’t know the “Member Type” till the time you select and save.
  3. Finally, write java script on the “On-Load” event (for “Edit Form” type) which runs the following logic –
  • If Member Type is “Lead”, show ONLY the “Marketing List Leads” tab.
  • If Member Type is “Account”, show ONLY the “Marketing List Accounts” tab.
  • If Member Type is “Contact”, show ONLY the “Marketing List Contacts” tab.
The following java script when registered on the Marketing List Form “On-Load” event does all the magic –

function hidethelist() {

if (Xrm.Page.ui.getFormType() ==1) {

Xrm.Page.ui.tabs.get("leadtab").setVisible(false);

Xrm.Page.ui.tabs.get("contacttab").setVisible(false);

Xrm.Page.ui.tabs.get("accounttab").setVisible(false);

}



if (Xrm.Page.ui.getFormType() ==2) {

if (Xrm.Page.getAttribute("createdfromcode").getText() == 'Account') {

Xrm.Page.ui.tabs.get("leadtab").setVisible(false);

Xrm.Page.ui.tabs.get("contacttab").setVisible(false);

}

if (Xrm.Page.getAttribute("createdfromcode").getText() == 'Lead') {

Xrm.Page.ui.tabs.get("contacttab").setVisible(false);

Xrm.Page.ui.tabs.get("accounttab").setVisible(false);

}

if (Xrm.Page.getAttribute("createdfromcode").getText() == 'Contact') {

Xrm.Page.ui.tabs.get("leadtab").setVisible(false);

Xrm.Page.ui.tabs.get("accounttab").setVisible(false); } }

}

The “leadtab”, “accounttab” and “contacttab” are the ids of three tabs we defined earlier.

Conclusion

This is a simple yet on-spot solution. It helps reduce navigation. Not sure, how relevant it will be in Orion but till then keep using when need comes. Thanks!




Источник: http://blogs.msdn.com/b/dynamics-coe...-crm-2011.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 10 Blog bot Dynamics CRM: Blogs 0 17.08.2012 03:27
crminthefield: Microsoft Dynamics CRM 2011 White Papers & Technical Documentation Blog bot Dynamics CRM: Blogs 0 29.12.2011 01:12
Microsoft Dynamics CRM Team Blog: Microsoft Dynamics CRM 2011 ~ Online Test Drive Guide Blog bot Dynamics CRM: Blogs 0 05.08.2011 20:13
Microsoft Dynamics CRM Team Blog: Microsoft Dynamics CRM 2011 ~ Book Club Blog bot Dynamics CRM: Blogs 0 02.02.2011 00:16
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

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:43.