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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 07.09.2011, 17:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,617 / 848 (80) +++++++
Регистрация: 28.10.2006
Gareth Tucker: Utilising some of Microsoft CRM 2011’s Hidden Functions
Источник: http://gtcrm.wordpress.com/2011/09/0...den-functions/
==============

I stumbled across this today.  Not sure if this is common knowledge. It is likely not supported. It is however interesting.

Today I wanted to save an Activity record as completed and close the form all via java script.  i.e. I wanted to be able to do the same thing that clicking this button does:



I wondered whether the CRM ribbon definition would reveal what this button does.  Sure enough it does.   Looking in…

\sdk\samplecode\cs\client\ribbon\exportribbonxml\exportedribbonxml\phonecallribbon.xml

… I found that the “Mark Complete” button calls a command called:

"Mscrm.SavePrimaryActivityAsComplete"

As you can see below:



This Command is a Ribbon Command and a quick ctrl-F in that same file quickly located the definition of the Command:



As you can see the button calls a Function called “SaveAsCompleted” which resides in a java script library called activity.js.

I wondered whether I could call this function from my java script.   Sure enough I can:



Works exactly as I hoped.

Does this mean I have java script access to lots of additional functionality?  I hope so!

p.s. Another approach that might work here and may be a little more supported is to programmatically click the Ribbon button.  I haven’t tried that.

p.p.s  If you are curious as to what the code behind this function is you can locate it on your CRM server under:  \CRMWeb\_static\Activities

Here it is:

function SaveAsCompleted(){if(!crmForm.IsValid())return;crmForm.SubmitCrmForm(58,true,true,false)}
Regards,

Gareth




Источник: http://gtcrm.wordpress.com/2011/09/0...den-functions/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Gareth Tucker: Installing the Customer Care Accelerator (CCA) for CRM 2011 Blog bot Dynamics CRM: Blogs 3 23.12.2011 09:16
crminthefield: Overview: Microsoft Dynamics CRM 4.0 Update Rollup 19 Blog bot Dynamics CRM: Blogs 0 26.08.2011 01:13
crminthefield: Microsoft Dynamics CRM 4.0 and 2011 Update Rollup Release Dates, Build Numbers, and Collateral Blog bot Dynamics CRM: Blogs 0 24.08.2011 02:11
Microsoft Dynamics CRM Team Blog: Microsoft Dynamics CRM 2011 ~ Online Test Drive Guide Blog bot Dynamics CRM: Blogs 0 05.08.2011 20:13
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05

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

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

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