MSCRM禁用标签页内所有组件

 //已经审核的单据禁止修改  
   if(crmForm.all.new_shzt.DataValue==2){
    disableTab(0);
   }   
   
//禁用标签
function disableTab(tabIndex) {
 var tab = document.all["tab" + tabIndex];
 for (var i = 0; i < tab.all.length; i++) {
  if (tab.all[i].Disabled !== undefined) {
   tab.all[i].Disabled = true;
  }
 }
}

Posted in Web开发 at February 7, 2012. by 傻猫 .    Views: 4561    No Comments

mscrm4屏幕ctrl+s热键

在MSCRM4的项目中,有一个特别的要求,需要把热键ctrl+s屏蔽掉,在onsave事件里添加以下脚本即可,当按下ctrl+s时,直接取消操作。

function document.onkeydown()  
{
    if (event.ctrlKey == true && event.keyCode == 83)
    {//Ctrl+S
        window.event.cancelBubble = true;//禁止此次操作
   }
}
onsave.jpg

Posted in Web开发 at January 7, 2011. by 傻猫 .    Views: 6953    1 Comment

mscrm4隐藏grid页上的按钮

前几篇文章里,介绍了如何在toolbar上面增加按钮,如何去掉详细页上的toolbar上的按钮,如何去掉菜单,如何添加菜单,那要在搜索页grid页上隐藏按钮怎么做呢? 修改_root目录下的HomePage.aspx文件,在<head>之前添加一个onload脚本,先找到要隐藏按钮的ID值,通过下面的函数即可隐藏grid页上的按钮。

不同实体grid页上的按钮都可以隐藏的,即使相同的功能的按钮,他的ID值不一样。

<script language="JavaScript">
function window.onload()
{
   // HandleBackButtonIssues(_currentTypeCode);
    for (var index in document.getElementsByTagName("LI")) {
            var o = document.getElementsByTagName("LI")[index];
            if (o.id == "_MBopenObj10072") {
                o.style.display = 'none'; //隐藏
            }
        }
  
}
</script>
</head>

Posted in Web开发 at January 7, 2011. by 傻猫 .    Views: 5325    No Comments

mscrm 将自定义的视图在sitemap中显示

<SubArea Title="我已完成的任务"Id="nav_task01"Url="/Workplace/home_activities.aspx?type=task&viewid=%7bD70EA66D-4B41-DF11-B3AB-0026182FF465%7d"/>

 如下图mscrm_viewid.jpg

其中viewid可以用microsoft developer tool找到

Posted in Web开发 at December 28, 2010. by 傻猫 .    Views: 5513    No Comments

mscrm4 用js阻止表单保存

onsave 事件里
event.returnValue = window.confirm("是否要保存?");

Posted in Web开发 at December 28, 2010. by 傻猫 .    Views: 5316    No Comments

MSCRM4 ISV.Config

<ImportExportXml version="4.0.0.0" languagecode="1033" generatedBy="OnPremise">
<Entities></Entities>
<Roles></Roles>
<Workflows></Workflows>
 <IsvConfig>
  <configuration version="3.0.0000.0">
   <Root>
<!-- This section describes how to customize the area labels in the left pane in forms.
 <NavBarAreas>
  <NavBarArea Id="Sales">
   <Titles>
    <Title LCID="1033" Text="Customized Sales Label" />
    <Title LCID="1031" Text="Deush Sales Label" />
   </Titles>
  </NavBarArea>
  <NavBarArea Id="Service">
   <Titles>
    <Title LCID="1033" Text="Customized Service Label" />
   </Titles>
  </NavBarArea>
 </NavBarAreas>
-->
<!-- The main Global Menu Bar located at the top of all root level areas -->
    <MenuBar>
<!-- Custom Menus that appear between the Goto Menu and the Help Menu -->
     <CustomMenus>
      <Menu>
       <Titles>
        <Title LCID="1033" Text="ISV" />
       </Titles>
       <MenuItem Url="http://www.microsoft.com">
        <Titles>
         <Title LCID="1033" Text="New Window" />
        </Titles>
       </MenuItem>
       <MenuSpacer />
<!-- A horizontal drop-down menu spacer -->
       <SubMenu>
        <Titles>
         <Title LCID="1033" Text="ISV Tests" />
        </Titles>
        <MenuItem Url="http://www.microsoft.com" WinMode="2">
         <Titles>
          <Title LCID="1033" Text="Modeless Dialog" />
         </Titles>
        </MenuItem>
        <MenuSpacer />
        <MenuItem Url="http://www.microsoft.com" WinMode="1">
         <Titles>
          <Title LCID="1033" Text="Modal Dialog" />
         </Titles>
        </MenuItem>
        <MenuSpacer />
        <MenuItem JavaScript="alert('test');">
         <Titles>
          <Title LCID="1033" Text="Custom JavaScript" />
         </Titles>
        </MenuItem>
       </SubMenu>
      </Menu>
     </CustomMenus>
    </MenuBar>
<!-- Application Level Tool Bar -->
    <ToolBar>
     <Button Icon="/_imgs/ico_18_debug.gif" JavaScript="alert('test');">
      <Titles>
       <Title LCID="1033" Text="Test" />
      </Titles>
      <ToolTips>
       <ToolTip LCID="1033" Text="Info on Test" />
      </ToolTips>
     </Button>
     <ToolBarSpacer />
<!-- A vertical toolbar spacer -->
     <Button Icon="/_imgs/ico_18_debug.gif" JavaScript="alert('test');"