簡體   English   中英

Dynamics CRM,功能區按鈕,添加鏈接的子實體

[英]Dynamics CRM, Ribbon Button, Add linked child entity

我正在嘗試在聯系人表單中添加一個按鈕,以創建鏈接到父聯系人的子活動記錄。

我正在使用功能區工作台嘗試此操作。 我已經成功顯示了按鈕,但是無法創建子記錄。 Ribbon工作台將不會發布以下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網絡資源是:

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');
}

更新:我的環境中出現了一個問題,因此我成立了一個新的組織來開發客戶。 當我回到同一點時,我將回到該主題。 謝謝!

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

您可以在該錯誤日志中發布錯誤消息嗎?

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

你遇到了什么錯誤? 也許您可能會超時-您要發布到Dynamics CRM Online嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM