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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 17.10.2013, 23:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
Gareth Tucker: Using Business Rules for Calculated Fields in CRM 2013
Источник: http://garethtuckercrm.com/2013/10/1...s-in-crm-2013/
==============

Business Rules are a viable alternative to JavaScript for basic field calculations, such as the below example where I want Line Total to be calculated based on Unit Amount x Qty:



To automate this simple calculation I configured 3 Business Rules.  Firstly, the rule that sets Line Total =  Unit Amount x Qty (when both those fields are populated):



And two additional Business Rules to clear the Line Total field once either of the input fields are cleared:

 

And:



</p></p>I describe this as a JavaScript replacement and it is.  However, that doesn’t mean either JavaScript or a Business Rule is the right solution to this automation requirement.  They both have the same weakness, they only fire when the data is changed through the CRM form.   Understanding when Business Rules fire is easy, just think of them as JavaScripts.  Behind the scenes the Business Rules you author are translated into JavaScript so there really is no difference.    Implementing a calculation via just a JavaScript or Business Rule leaves your data integrity exposed to updates via Bulk Edit, Data Import, Mobile Express, API and Workflow updates where updates to your fields won’t trigger the recalc of the calculated field.   For that reason, I would meet this requirement with a combination of a Business Rule and a Plug-in.  The Business Rule provides a real time calculation experience for the user, the Plug-in ensures the calculation happens regardless of the source of the update.    Wondering whether a simple Real Time Workflow could do the job of the Plug-in?  The answer is no, the workflow designer doesn’t provide the ability to define this type of calculation.




Источник: http://garethtuckercrm.com/2013/10/1...s-in-crm-2013/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 15 Blog bot Dynamics CRM: Blogs 1 10.02.2016 10:26
Gareth Tucker: CRM 2013 New Features: Business Process Flows Blog bot Dynamics CRM: Blogs 0 17.10.2013 04:36
Gareth Tucker: CRM 2013 New Features: Business Rules Blog bot Dynamics CRM: Blogs 0 16.10.2013 03:12
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 13 Blog bot Dynamics CRM: Blogs 0 27.03.2013 22:12
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 10 Blog bot Dynamics CRM: Blogs 0 17.08.2012 03:27

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

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

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