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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.10.2013, 10:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Gareth Tucker: CRM 2013 New Features: Actions
Источник: http://garethtuckercrm.com/2013/10/1...tures-actions/
==============

Ok, so this feature took me a little while to get my head around.  I felt there was a fair gap between the conceptual description of the feature from Microsoft and the reality of how and when you would use it.   Hopefully this post speeds up the learning process for others.

Here’s when you would you use this new feature.  Imagine you want to execute some custom business logic in real time when a button is clicked or an OnLoad, OnChange or OnSave event occurs.  With CRM 2011 you would typically write some JavaScript and develop the business logic in code.  You might query values on the form, you might even hit the CRM APIs to query other data and then you might update values on the CRM form or hit the CRM APIs to create/update other CRM records or pop a URL.     The new Action feature allows us to relocate that business logic into a configurable rule (similar to a workflow rule) and provides a framework for executing that rule from JavaScript.  This means we code the invocation once and then we are done.  The business logic can then be messed around with through a simple GUI.

The common scenario for this I think will be for Approval processes.   Imagine we want an Approve button added to the CRM form and when that button is clicked we want stuff to happen. 

Here’s the steps (in completely the wrong order):

Firstly, add the button to the form.  In CRM 2013 we now have a Command Bar that replaces the Ribbon on most forms.  It is still customized the same way though.  Best bet at this point in time is to use the Ribbon Workbench utility, a CRM 2013 version was recently released.   The button will execute a JavaScript function.

Secondly, write your JavaScript function that will execute the Action.  This will need to be a SOAP call.  Sadly Microsoft have not provided a nice function for this yet.  Actions are defined with input and output arguments so when invoking the Action you can pass values in and then perform additional steps with the values it returns.  I’ve seen these steps documented in a nice lab internally, I assume this info will be publically availably in the SDK or on blog some where.  Let me know if you see a good walkthrough and I’ll reference it here.

Thirdly, configure your Action.   Here, you use the same GUI that you have used in the past for Workflows and Dialogs:



You define your Input and Output arguments:



And then you write your business logic using the normal Conditions and Actions you will be used to from your Workflow configuration days:



You can do some Check Conditions to perform different actions based on the input arguments:



You can create, update and assign records and send emails, etc.   And you can assign values to those Output arguments:



Your button will fire the JavaScript function which will invoke this Action.  The Action will process the inputs, perform whatever actions you have asked it do, then it will return the outputs to the java script function.  The java script will do whatever you want it to do with those outputs (update the form, construct and then pop a URL, alert the user).

Going back to the Approval scenario I could see the following working nicely:

  1. - The user changes an Approval field to Approved
  2. - A JavaScript function is invoked, it calls the Approval Action passing in the Opportunity Type and Opportunity Value
  3. - The Approval Action runs those Input arguments through a series of Conditions assigning values to an Approver field and a Approval Due Date field
  4. - The JavaScript function receives those Output arguments and uses them to populate corresponding fields on the form and to pop an alert to the user to inform them of the Approver that had been assigned
  5. - The user has immediate visibility of who has been assigned as Approver and is happy
I hope this helps others understand Actions a little better.  I do wonder what they have to offer over a real time workflow.  I think the choice between the 2 will take some careful consideration.  More learning required




Источник: http://garethtuckercrm.com/2013/10/1...tures-actions/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Старый 17.10.2013, 11:50   #2  
g.Naukovych is offline
g.Naukovych
Участник
MCBMSS
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
 
405 / 130 (5) +++++
Регистрация: 23.03.2011
Когда я читал о actions, то это я нашел очень быстро.
Собственно MS это все давно заявил.
Мне помогла вот эта статья. http://inogic.blogspot.ru/2013/09/in...-crm-2013.html
Здесь явно пример дан, как и что нужно делать.
__________________
Мой блог https://procrm.tv
За это сообщение автора поблагодарили: kalina (1).
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
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 Rules Blog bot Dynamics CRM: Blogs 0 16.10.2013 03:12
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 14 Blog bot Dynamics CRM: Blogs 0 12.07.2013 07:13
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, время: 05:47.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.