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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 04.08.2018, 00:26   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
powerobjects: Using an OnKeyPress Event to Dynamically Load Values from Global Option Sets
Источник: https://www.powerobjects.com/2018/08...l-option-sets/
==============


Ever wish you could dynamically set the available values of a field to reflect picklist values?

Sure, there are ways of filtering out unwanted options based on some filter criteria, but if you’re dealing with data constraints that are constantly changing (ex: the brands of cars sold by a merchant at a particular location) it can get pretty messy, pretty quickly.

That said, the best way to achieve ease of consistency and maintainability when it comes to data is through the use of Global Option Sets and Auto-completion.

First, you’ll want to create a Global Option Set that has the values you’d like to leverage.

Next, you’ll need to write some JavaScript code that brings in the metadata of the Global Option Set (thanks to the CRM Web API, this is possible):



Once that’s been completed, we’ll want to add some more JavaScript code to our OnLoad event to register our OnKeyPress logic with the appropriate control:



Lastly, we’ll need to ensure that the text selected matches one of the available picklist values before saving the record:



And that should do it!

NOTE: For enhanced performance, you can make “picklistOptions” a global variable, and only populate when/if your picklist selection criteria changes.

Be sure to subscribe to our blog for more helpful Dynamics 365 tips!

Happy Dynamics 365’ing!



Источник: https://www.powerobjects.com/2018/08...l-option-sets/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
powerobjects: Global Options Sets in Microsoft Dynamics 365 Blog bot Dynamics CRM: Blogs 0 21.12.2017 01:12
crmtipoftheday: Tip #1047: When in Doubt, Go Global (With Option Sets) Blog bot Dynamics CRM: Blogs 0 20.12.2017 04:13
Navigate Into Success: Trick: Subscribing to any Control Add-in event through pure C/AL Blog bot Dynamics CRM: Blogs 0 04.08.2014 11:00
CRM DE LA CREME! Some more useful javascripts for MS CRM Blog bot Dynamics CRM: Blogs 0 04.05.2010 11:05
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23

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

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

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