AXForum  
Вернуться   AXForum > Блоги > Akvelon MS CRM Development
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

Akvelon MS CRM Customization Services
http://www.akvelon.com/default.aspx
Оценить эту запись

Adding new button “complete and new” for Phone Call entity.

Запись от Ketevan размещена 06.06.2011 в 15:31
Обновил(-а) Ketevan 06.06.2011 в 15:40

We’ll add a custom tab with custom button “Complete and New” for Phone Call entity as shown in the screenshot
Нажмите на изображение для увеличения
Название: 1.png
Просмотров: 956
Размер:	7.0 Кб
ID:	128
This Button allows you to complete the current phone call with activity status “completed” and open the form for new phone call.
To do this you need:
1. Create new solution, add there Phone Call entity and Web Resource “phonecall_ribbon.js” save it and export.
2. Unzip the solution and find the “customizations.xml” file, open it with any XML editor, e.g. XML Notepad.
3. Find in customization.xml RibbonDiffXml for Phone Call entity, you should change it on:

<RibbonDiffXml>
<CustomActions>
<CustomAction Id="CustomRibbon.Form.phonecall.CustomTab.CustomAction" Location="Mscrm.Tabs._children" Sequence="4">
<CommandUIDefinition>
<Tab Id="CustomRibbon.Form.phonecall.CustomTab" Command="CustomRibbon.Form.phonecall.CustomTab" Title="ISV Phone Call Form" Description="ISV Phone Call Form" Sequence="20">
<Scaling Id="CustomRibbon.Form.phonecall.CustomTab.Scaling">
<MaxSize Id="CustomRibbon.Form.phonecall.CustomTab.FirstGroup.MaxSize" GroupId="CustomRibbon.Form.phonecall.CustomTab.FirstGroup" Sequence="10" Size="LargeMedium" />
</Scaling>
<Groups Id="CustomRibbon.Form.phonecall.CustomTab.Groups">
<Group Id="CustomRibbon.Form.phonecall.CustomTab.FirstGroup" Command="CustomRibbon.Form.phonecall.FirstGroup" Sequence="10" Title="Operations" Template="Mscrm.Templates.3.3">
<Controls Id="CustomRibbon.Grid.phonecall.CustomTab.FirstGroup.Controls">
<Button Id="CustomRibbon.Form.phonecall.CustomTab.FirstGroup.FirstButton" ToolTipTitle="Complete and New" ToolTipDescription="Complete and New" Command="CustomRibbon.Form.phonecall.FirstButton" Image16by16="/_imgs/SFA/MarkAsWon_16.png" Image32by32="/_imgs/SFA/MarkAsWon_32.png" Sequence="10" LabelText="Complete and New" Alt="Complete and New" TemplateAlias="o1" />
</Controls>
</Group>
</Groups>
</Tab>
</CommandUIDefinition>
</CustomAction>
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
</Templates>
<CommandDefinitions>
<CommandDefinition Id="CustomRibbon.Form.phonecall.CustomTab">
<EnableRules>
<EnableRule Id="Mscrm.Enabled" />
</EnableRules>
<DisplayRules />
<Actions />
</CommandDefinition>

<CommandDefinition Id="CustomRibbon.Form.phonecall.FirstGroup">
<EnableRules>
<EnableRule Id="Mscrm.Enabled" />
</EnableRules>
<DisplayRules />
<Actions />
</CommandDefinition>

<CommandDefinition Id="CustomRibbon.Form.phonecall.FirstButton">
<EnableRules>
<EnableRule Id="Mscrm.Enabled" />
</EnableRules>
<DisplayRules />
<Actions>
<JavaScriptFunction FunctionName="Mscrm_Isv_phonecall_Form_Group0_Control0_1" Library="$Webresource:phonecall_ribbon.js" />
</Actions>
</CommandDefinition>

</CommandDefinitions>
<RuleDefinitions>
<TabDisplayRules>
<TabDisplayRule TabCommand="CustomRibbon.Form.phonecall.CustomTab">
<EntityRule Context="Form" />
</TabDisplayRule>
</TabDisplayRules>
<DisplayRules />
<EnableRules />
</RuleDefinitions>
<LocLabels />
</RibbonDiffXml>


It allows you to add new custom button “Complete and new” on the ribbon Phone Call entity.
4. Zip the Solution and import it to CRM, publish all customization and you can see the desired result, on the ribbon Phone Call entity appeared new custom tab with new custom button “Complete and New”.
5. Now we need to edit Web Resource “phonecall_ribbon.js” to add action for this button.
Open Web Resource and edit JavaScript on:


function Mscrm_Isv_phonecall_Form_Group0_Control0_1(){
if (!crmForm.IsValid()) {
return false;
}

if (crmForm.SubmitCrmForm(58, true, true, false))
{
var entWindowFeatures = 'toolbars=0,width=880,Height=700,Left=10,top=90';
var entWindowUrl = "/main.aspx?etc=4210&pagetype=entityrecord&daparams=populate";
var entWindowName = '_blank';

openStdWin(entWindowUrl, entWindowName, entWindowFeatures);
}
}


Нажмите на изображение для увеличения
Название: 2.png
Просмотров: 913
Размер:	19.8 Кб
ID:	129
This script allows completing current phone call and creating new phone call.
6. Now you can see the result of action this button.
Размещено в Без категории
Просмотров 41592 Комментарии 0
Всего комментариев 0

Комментарии

 


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