Hide Ribbon Button Crm 2011

我只是一个虾纸丫 提交于 2019-12-24 04:10:52

问题


I have to hide a ribbon button when the owner of the record isn't the current user.

I'm using Visual Ribbon Editor for CRM 2011 however I didn't find out the solution yet. I tried to use Field rule ValueRule but it just allows me to put a bool value (1 or 0).

Can anyone please tell me how can I do that?

Thank you in advance!


回答1:


Add a Enable Rule like this:

<EnableRules>
    <EnableRule Id="YourEntity.Form.XXX.MainTab.XXXXXXXXXX.CustomRule" />
</EnableRules>

Rule Definitions as below:

<RuleDefinitions>
    <TabDisplayRules />
        <DisplayRules />
        <EnableRules>
            <EnableRule Id="Email.Form.email.MainTab.XXXXXXXXXX.CustomRule">
                <CustomRule FunctionName="DisableButton" Library="$webresource:new_/js/xxx.js" InvertResult="true" />
            </EnableRule>
        </EnableRules>
</RuleDefinitions>

Write a JavaScript function DisableButton and to return true or false based on your condition. Reference the js webresource in CustomRule Library.




回答2:


Value Rules cannot be used with Hide Actions - so you'll need to use a Custom JavaScript Rule with an Enable rule to enable/disable the button rather than hide it.



来源:https://stackoverflow.com/questions/18452521/hide-ribbon-button-crm-2011

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!