Inquiridor
Problema ao tentar esconder um ribbon button

Pergunta
-
Boa tarde a todos
Estou com um sério problema já fazem dois dias. Preciso esconder um botão que eu mesmo criei com o ribbon workbench dependendo do valor de um campo de dois valores, mas tudo o que eu tentei agora não funcionou. Sei que existe uma forma com o próprio RibbonWorkbench, adicionando DisplayRules ao comando, mas tentei usar a ValueRule, mesma que funciona perfeitamente com o EnableRules, e nada!
Por favor, alguém tem ideias de como eu posso prosseguir?
Obrigado
Não importa ao tempo o minuto que passa, mas o minuto que vem.
Todas as Respostas
-
-
Azevedo, não me é apresentado nenhum erro, mas o código XML dos botões é esse:
<RibbonDiffXml> <CustomActions> <CustomAction Id="new.incident.Button1.Button.CustomAction" Location="Mscrm.Form.incident.MainTab.Actions.Controls._children" Sequence="6"> <CommandUIDefinition> <Button Command="new.incident.Command1.Command" Id="new.incident.Button1.Button" Image32by32="/_imgs/ribbon/button-blue-pause.jpg" LabelText="$LocLabels:new.incident.Button1.Button.LabelText" Sequence="6" TemplateAlias="o1" /> </CommandUIDefinition> </CustomAction> <CustomAction Id="new.incident.Button2.Button.CustomAction" Location="Mscrm.Form.incident.MainTab.Actions.Controls._children" Sequence="6"> <CommandUIDefinition> <Button Command="new.incident.Command0.Command" Id="new.incident.Button2.Button" Image32by32="/_imgs/ribbon/button-blue-play.jpg" LabelText="$LocLabels:new.incident.Button2.Button.LabelText" Sequence="6" TemplateAlias="o1" /> </CommandUIDefinition> </CustomAction> </CustomActions> <Templates> <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates> </Templates> <CommandDefinitions> <CommandDefinition Id="new.incident.Command0.Command"> <EnableRules> <EnableRule Id="new.incident.EnableRule0.EnableRule" /> </EnableRules> <DisplayRules> <DisplayRule Id="new.incident.DisplayRule0.DisplayRule" /> </DisplayRules> <Actions> <JavaScriptFunction FunctionName="Reinicia" Library="$webresource:new_Pausa_Inicia_Ocorrencia" /> </Actions> </CommandDefinition> <CommandDefinition Id="new.incident.Command1.Command"> <EnableRules> <EnableRule Id="new.incident.EnableRule1.EnableRule" /> </EnableRules> <DisplayRules> <DisplayRule Id="new.incident.DisplayRule1.DisplayRule" /> </DisplayRules> <Actions> <JavaScriptFunction FunctionName="Pausa" Library="$webresource:new_Pausa_Inicia_Ocorrencia" /> </Actions> </CommandDefinition> </CommandDefinitions> <RuleDefinitions> <TabDisplayRules /> <DisplayRules> <DisplayRule Id="new.incident.DisplayRule0.DisplayRule"> <ValueRule Field="new_dependencia" Value="true" InvertResult="true" /> </DisplayRule> <DisplayRule Id="new.incident.DisplayRule1.DisplayRule"> <ValueRule Field="new_dependencia" Value="true" InvertResult="true" /> </DisplayRule> </DisplayRules> <EnableRules> <EnableRule Id="new.incident.EnableRule0.EnableRule"> <ValueRule Field="new_dependencia" Value="true" InvertResult="false" /> </EnableRule> <EnableRule Id="new.incident.EnableRule1.EnableRule"> <ValueRule Field="new_dependencia" Value="true" InvertResult="true" /> </EnableRule> </EnableRules> </RuleDefinitions> <LocLabels> <LocLabel Id="new.incident.Button1.Button.LabelText"> <Titles> <Title description="Pausar Ocorrência" languagecode="1046" /> </Titles> </LocLabel> <LocLabel Id="new.incident.Button2.Button.LabelText"> <Titles> <Title description="Reiniciar Ocorrência" languagecode="1046" /> </Titles> </LocLabel> </LocLabels> </RibbonDiffXml>
Não importa ao tempo o minuto que passa, mas o minuto que vem.
-
Filipe bom dia.
já tentou com Java Script?
Entre na tela que voce quer desabilitar o botão e aperte F12. Descubra o nome do seu botao na tag ID.
Depois é só ocultar chamando as rotinas deste link http://www.ahmetcankaya.com/hide-ribbon-button-in-crm-2011-by-using-javascript/
Atenciosamente,
Rodrigo Hentz - MCP.MCPS.MCNPS.MCTS.MBSS.MBSP.MCITP
Profile
Blog- Sugerido como Resposta Rodrigo HentzModerator quinta-feira, 11 de abril de 2013 12:37