我試圖添加一個按鈕到聯繫人窗體,該窗體創建一個鏈接到父級聯繫人的子活動記錄。動態CRM,功能區按鈕,添加鏈接的子實體
我正在使用Ribbon Workbench來嘗試此操作。 我有按鈕顯示成功,但我無法獲得要創建的子記錄。 功能區工作臺不會公佈如下XML
的XML我至今是:
<?xml version="1.0" encoding="utf-16"?>
<RibbonDiffXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CustomActions>
<CustomAction Id="new.contact.Button1.Button.CustomAction" Location="Mscrm.Form.contact.MainTab.Actions.Controls._children" Sequence="19">
<CommandUIDefinition>
<Button Command="new.contact.Command0.Command" Description="Send SMS" Id="new.contact.Button1.Button" Image32by32="$webresource:new_sms32" Image16by16="$webresource:new_sms16" LabelText="$LocLabels:new.contact.Button1.Button.LabelText" Sequence="19" TemplateAlias="o1" ToolTipTitle="$LocLabels:new.contact.Button1.Button.ToolTipTitle" ToolTipDescription="$LocLabels:new.contact.Button1.Button.ToolTipDescription" />
</CommandUIDefinition>
</CustomAction>
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates" />
</Templates>
<CommandDefinitions>
<CommandDefinition Id="new.contact.Command0.Command">
<EnableRules />
<DisplayRules />
<Actions>
<JavaScriptFunction FunctionName="AddSMS" Library="$webresource:new_WFTrigger">
<StringParameter Name="child" Value="new_sms" />
<CrmParameter Name="parentRecordId" Value="PrimaryItemIds" />
<CrmParameter Name="parente" Value="PrimaryEntityTypeCode" /> <!--The ribbon workbench refuses to fill the Name of this parameter and tries to publish it as blank -->
</JavaScriptFunction>
</Actions>
</CommandDefinition>
</CommandDefinitions>
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules />
<EnableRules />
</RuleDefinitions>
<LocLabels>
<LocLabel Id="new.contact.Button1.Button.LabelText">
<Titles>
<Title description="Send SMS" languagecode="1033" />
</Titles>
</LocLabel>
<LocLabel Id="new.contact.Button1.Button.ToolTipTitle">
<Titles>
<Title description="Send SMS" languagecode="1033" />
</Titles>
</LocLabel>
<LocLabel Id="new.contact.Button1.Button.ToolTipDescription">
<Titles>
<Title description="Send SMS" languagecode="1033" />
</Titles>
</LocLabel>
</LocLabels>
</RibbonDiffXml>
和JavaScript的Web資源我擁有的是:
function AddSMS(child, parente, parentRecordId) {
var url = Xrm.Page.context.getServerUrl() + "main.aspx?etn= " + child + " &extraqs=%3f_CreateFromId%3d" + parentRecordId + "%26_CreateFromType%3d" + parente + "%26etn%" + child + " &pagetype=entityrecord";
open(url, 'Create SMS');
}
更新:有問題在我的環境中開發,所以我開始了一個新的組織來開發cusomtisations。當我回到同一點時,我會回到這個話題。謝謝!
剛纔我發現您可能正在使用工作臺而不是上傳解決方案。要執行關於您提到的故障排除步驟,您需要[爲您的功能區創建新解決方案](http://gtcrm.wordpress.com/2011/01/18/how-to-view-ribbon-definitions-in-crm -2011-3 /)並將你的XML合併到它。 – 2012-07-06 17:26:54