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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 31.01.2015, 17:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
Leon's CRM Musings: Faking JavaScript Codelessly
Источник: http://leontribe.blogspot.com/2015/0...odelessly.html
==============

I am quite a fan of not using code where possible and where practical. However, there is no point sacrificing code if the user experience makes the system unusable. CRM 2013/2015 gives us a few tools in our kitbag for avoiding using code without sacrificing experience. I thought I would explore them.

Real-Time Workflows

I am so pleased to see real-time workflows in CRM. In the old days, workflows could only run in the back end. The problem with this is while you could make them do lots of interesting things (Auto-numbering, Lead Assignment and Counters, for example), the user experience was sub-par. The main problem was that while the workflow did everything you wanted it to, the user did not know what was happening because it was all on the server and not on the form. This has now changed with real-time workflows.

Any workflow can be converted to run in real-time by deactivating it and hitting the ‘Convert to a real-time workflow’ button at the top of the form.



I made of use of real-time workflows in my address finder article. The experience in that case was, once the location was set, the other fields appeared updated on the save of the record. In other words, if you are looking for something which behaves in a similar way to the OnSave event, a real-time workflow gets us close.

So what other events can JavaScript trigger off? You will remember from my Developer Essentials article that JavaScript triggers off of four events:

  • OnSave (saving of the form)
  • OnLoad (when the form opens on the screen)
  • OnChange (when the value in a field changes)
  • TabStateChange (opening and closing of Tabs)
So we have covered off the first one. What about the others? For these we will need Business Rules.

Business Rules

Another new function for CRM 2013/2015, Business Rules allow us to configure form behaviours. I mentioned Business Rules in my updated Auto-Number post from last year. Business Rules are configured on the form and here is a simple one I set up to test the behaviour. In this case, when the Main Phone is populated, the value is copied to the Other Phone field.



When activated, it becomes clear Business Rules run on both the OnLoad event (on loading the form, if the Main Phone had a value and the Other Phone did not, the value was copied) and OnChange event (if I changed the Main Phone value and tabbed out of the field, it was immediately copied to the Other Phone field).

Tab State Changes and Other Stuff

There are no codeless equivalents for triggering off the opening or closing of a Tab and there are plenty of other things you may need to do which simply cannot be done with the limited actions available for Workflows and Business Rules. In these cases you will still need Javascript.

Also, as a word of warning, with the many ways to emulate JavaScript-like behaviour, it can be difficult to determine exactly how a form does what it does. For this reason I know of a few senior developers who prefer to use JavaScript in all cases, even though the codeless alternatives may be quicker and as effective. In their case they are considering the future administration of the form. If everything, or nearly everything can be contained in one place, it is easier for an administrator; no rifling through numerous places trying to find the right thing to change.

Conclusions

If you are upgrading and have a system with lots of code, there is plenty of opportunity with the improved functionality of CRM 2013/2015 to remove some of that code and replace it with configuration (especially if it is breaking in going from CRM 2011). Similarly if, like me, your coding days are a bit of a distant memory, the new functionality gives you something to impress clients and potential clients with when showing off what is possible with CRM forms and making them user friendly. Try them out and see how easy it is to configure what used to be coded.



Источник: http://leontribe.blogspot.com/2015/0...odelessly.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 15 Blog bot Dynamics CRM: Blogs 1 10.02.2016 10:26
Leon's CRM Musings: Book Review: Microsoft Dynamics CRM 2013 Unleashed Blog bot Dynamics CRM: Blogs 0 31.10.2014 10:11
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 17 Blog bot Dynamics CRM: Blogs 0 10.05.2014 06:30
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2013 Update Rollup 2 Blog bot Dynamics CRM: Blogs 0 15.04.2014 01:15
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 16 Blog bot Dynamics CRM: Blogs 0 23.01.2014 03:15

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

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

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