2012-07-06 96 views
0

我試圖添加一個按鈕到聯繫人窗體,該窗體創建一個鏈接到父級聯繫人的子活動記錄。動態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。當我回到同一點時,我會回到這個話題。謝謝!

回答

0

導入屏幕的最後一頁應該有一個錯誤,可以幫助您推斷出問題。我花了一段時間才意識到錯誤日誌甚至在該頁面上。如果我沒有記錯,它看起來像一個超鏈接。

您可以在錯誤日誌中發佈錯誤消息嗎?

+0

剛纔我發現您可能正在使用工作臺而不是上傳解決方案。要執行關於您提到的故障排除步驟,您需要[爲您的功能區創建新解決方案](http://gtcrm.wordpress.com/2011/01/18/how-to-view-ribbon-definitions-in-crm -2011-3 /)並將你的XML合併到它。 – 2012-07-06 17:26:54

0

Ribbon Workbench不會發布JavaScriptFunction參數的'Name'屬性,因爲它們只在將參數添加到Url動作時才使用 - 所以我認爲問題不在於此。

你有什麼錯誤?也許你可能會超時 - 你是否發佈到Dynamics CRM Online?