2013-01-17 85 views

回答

5

我建議使用http://crmvisualribbonedit.codeplex.com/來編輯您的功能區。在您的按鈕上,將操作設置爲網址並鏈接到您的網絡資源。在贏牌模式設置中選擇模型對話框。

這是我在行動上的地址欄:

http://server/organization/WebResources/new_htmlpage 

new_htmlpage是webresource的名稱。

這裏是ribbondiff

<CommandDefinitions> 
    <CommandDefinition Id="new.Form.account.MainTab.ExportData.modalPopup.Command"> 
    <EnableRules /> 
    <DisplayRules /> 
    <Actions> 
     <Url WinMode="1" Address="http://server/organization/WebResources/new_htmlpage" PassParams="false" /> 
    </Actions> 
    </CommandDefinition> 
</CommandDefinitions> 
3

在地址的CommandDefinitions一部分,你應該有$ webresource:new_htmlpage

這種方式,你有一個相對鏈接到網絡的資源!

1

不知道CRM 2011年,但在2015年最好不要用URL操作打開HTML網頁資源,MSDN:

不要使用這個動作(URL操作),打開實體形式或網絡資源。使用(RibbonDiffXml)和使用Xrm.Utility.openEntityForm或Xrm.Utility.openWebResource的函數。

此外,使用Url動作,您不能簡單地向Html Web Resource發送查詢字符串參數,參數必須在「數據」查詢字符串參數中編碼。

var customParameters = encodeURIComponent("first=First Value&second=SecondValue&third=Third Value"); 
Xrm.Utility.openWebResource("new_webResource.htm",customParameters); 

MSDN:
Xrm.Utility (client-side reference)

相關問題