一句话总结2010年

住了新房,花钱不少,口袋空了

心情不是很好,工作还是干了不少

2010不给力,收成不好

2010,我操操操操

Posted in 我的生活 at December 28, 2010. by 傻猫 .    Views: 6986    4 Comments

SQL语句修改表字段名/修改字段长度/增加字段/删除字段

修改字段名
Exec sp_rename 'zxchem_Suggest.End_Date','Yj_Finish_Date','Column' 

修改字段长度
Alter Table zxchem_Suggest Alter Column Yj_Finish_Date Varchar(10) Not Null

增加字段
alter table docdsp    add dspcode char(200)

删除字段
ALTER TABLE table_NAME DROP COLUMN column_NAME

修改字段类型
ALTER TABLE table_name    ALTER COLUMN column_name new_data_type

Posted in 数据库 at December 28, 2010. by 傻猫 .    Views: 13786    No Comments

Mscrm4 获取lookup的值

var lookupItem = new Array;
    lookupItem = crmForm.all.new_buildingid.DataValue;

    if (lookupItem[0] != null)
    {
       crmForm.all.new_name.DataValue=lookupItem[0].name;
    }

 

Posted in Web开发 at December 28, 2010. by 傻猫 .    Views: 3933    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: 4406    No Comments

mscrm4 用js阻止表单保存

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

Posted in Web开发 at December 28, 2010. by 傻猫 .    Views: 4379    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');"
             Client="Web">
      <Titles>
       <Title LCID="1033" Text="Web Only" />
      </Titles>
      <ToolTips>
       <ToolTip LCID="1033"
                Text="Web client only. This will not appear in any Outlook pages." />
      </ToolTips>
     </Button>
     <Button Icon="/_imgs/ico_18_debug.gif" JavaScript="alert('test');"
             Client="Outlook" AvailableOffline="true">
      <Titles>
       <Title LCID="1033" Text="Outlook Only" />
      </Titles>
      <ToolTips>
       <ToolTip LCID="1033"
                Text="Outlook Only - This is available offline also." />
      </ToolTips>
     </Button>
     <Button Icon="/_imgs/ico_18_debug.gif" JavaScript="alert('test');"
             Client="Web, Outlook" AvailableOffline="true">
      <Titles>
       <Title LCID="1033" Text="Both" />
      </Titles>
      <ToolTips>
       <ToolTip LCID="1033"
                Text="Both Clients - This is available for both Web and Outlook Clients" />
      </ToolTips>
     </Button>
    </ToolBar>
   </Root>
<!-- Microsoft Customer Relationship Management Entities (Objects) -->
   <Entities>
    <Entity name="account">
     <MenuBar>
<!-- Custom Menus that you can add -->
      <CustomMenus>
       <Menu>
        <Titles>
         <Title LCID="1033" Text="ISV.NEW" />
        </Titles>
        <MenuItem Url="http://www.microsoft.com" PassParams="0"
                  WinMode="1">
         <Titles>
          <Title LCID="1033" Text="Coming Soon..." />
         </Titles>
        </MenuItem>
        <MenuSpacer />
        <SubMenu>
         <Titles>
          <Title LCID="1033" Text="Sub Test" />
         </Titles>
         <MenuItem Url="http://www.microsoft.com" PassParams="1">
          <Titles>
           <Title LCID="1033" Text="Test Sub 1" />
          </Titles>
         </MenuItem>
         <MenuSpacer />
         <MenuItem>
          <Titles>
           <Title LCID="1033" Text="Test Sub 2" />
          </Titles>
         </MenuItem>
        </SubMenu>
        <MenuSpacer />
        <MenuItem Url="http://www.microsoft.com" PassParams="0">
         <Titles>
          <Title LCID="1033" Text="Coming Soon..." />
         </Titles>
        </MenuItem>
        <MenuItem Client="Web">
         <Titles>
          <Title LCID="1033" Text="Web Only" />
         </Titles>
        </MenuItem>
        <MenuItem Client="Outlook" AvailableOffline="true">
         <Titles>
          <Title LCID="1033" Text="Outlook Only" />
         </Titles>
        </MenuItem>
        <MenuSpacer />
        <MenuItem ValidForCreate="0">
         <Titles>
          <Title LCID="1033" Text="Valid For Update Only" />
         </Titles>
        </MenuItem>
        <MenuItem ValidForUpdate="0">
         <Titles>
          <Title LCID="1033" Text="Valid For Create Only" />
         </Titles>
        </MenuItem>
       </Menu>
      </CustomMenus>
     </MenuBar>
<!-- The Account Tool Bar -->
     <ToolBar ValidForCreate="0" ValidForUpdate="1">
      <Button Icon="/_imgs/ico_18_debug.gif"
              Url="http://www.microsoft.com" PassParams="1"
              WinParams="" WinMode="0">
       <Titles>
        <Title LCID="1033" Text="asdf" />
       </Titles>
       <ToolTips>
        <ToolTip LCID="1033" Text="Info on Test" />
       </ToolTips>
      </Button>
      <ToolBarSpacer />
      <Button Icon="/_imgs/ico_18_debug.gif"
              Url="http://www.microsoft.com" PassParams="1" WinParams=""
              WinMode="1">
       <Titles>
        <Title LCID="1033" Text="Test" />
       </Titles>
       <ToolTips>
        <ToolTip LCID="1033" Text="Info on Test" />
       </ToolTips>
      </Button>
      <Button Icon="/_imgs/ico_18_debug.gif" JavaScript="alert('test');"
              Client="Web">
       <Titles>
        <Title LCID="1033" Text="Web Only" />
       </Titles>
       <ToolTips>
        <ToolTip LCID="1033" Text="Web client only. This will not appear in any Outlook pages." />
       </ToolTips>
      </Button>
      <Button Icon="/_imgs/ico_18_debug.gif" JavaScript="alert('test');"
              Client="Outlook" AvailableOffline="true">
       <Titles>
        <Title LCID="1033" Text="Outlook Only" />
       </Titles>
       <ToolTips>
        <ToolTip LCID="1033" Text="Outlook Only - This is available offline also." />
       </ToolTips>
      </Button>
     </ToolBar>
<!-- The Account Left Nav Bar -->
     <NavBar>
<!--
  Valid Areas Include
  ===================
  Sales
  Marketing
  Service
  Info
-->
      <NavBarItem Icon="/_imgs/ico_18_debug.gif"
                  Url="http://www.microsoft.com" Id="navItem">
       <Titles>
        <Title LCID="1033" Text="ISV Default" />
        </Titles>
      </NavBarItem>
      <NavBarItem Icon="/_imgs/ico_18_debug.gif"
                  Url="http://www.microsoft.com" Id="navItemWeb"
                  Client="Web">
       <Titles>
        <Title LCID="1033" Text="ISV Web Only" />
       </Titles>
      </NavBarItem>
      <NavBarItem Icon="/_imgs/ico_18_debug.gif"
                  Url="http://www.microsoft.com" Id="navItemOutlook"
                  Client="Outlook" AvailableOffline="true">
       <Titles>
        <Title LCID="1033" Text="ISV Outlook Only" />
       </Titles>
      </NavBarItem>
      <NavBarItem Icon="/_imgs/ico_18_debug.gif"
                  Url="http://www.microsoft.com" Id="navSalesItem"
                  Area="Sales">
       <Titles>
        <Title LCID="1033" Text="ISV Sales" />
       </Titles>
      </NavBarItem>
      <NavBarItem Icon="/_imgs/ico_18_debug.gif"
                  Url="http://www.microsoft.com" Id="navInfoItem"
                  Area="Info">
       <Titles>
        <Title LCID="1033" Text="ISV Info" />
       </Titles>
      </NavBarItem>
      <NavBarItem Icon="/_imgs/ico_18_debug.gif"
                  Url="http://www.microsoft.com" Id="navMarketingItem"
                  Area="Marketing">
       <Titles>
        <Title LCID="1033" Text="ISV Marketing" />
       </Titles>
      </NavBarItem>
      <NavBarItem Icon="/_imgs/ico_18_debug.gif"
                  Url="http://www.microsoft.com" Id="navServiceItem"
                  Area="Service">
       <Titles>
        <Title LCID="1033" Text="ISV Service" />
       </Titles>
      </NavBarItem>
     </NavBar>
     <Grid>
      <MenuBar>
       <ActionsMenu>
        <MenuItem Url="http://www.microsoft.com" WinMode="1">
         <Titles>
          <Title LCID="1033" Text="Coming Soon..." />
         </Titles>
        </MenuItem>
        <MenuSpacer />
        <SubMenu>
         <Titles>
          <Title LCID="1033" Text="Sub Test" />
         </Titles>
         <MenuItem Url="http://www.microsoft.com">
          <Titles>
           <Title LCID="1033" Text="Test Sub 1" />
          </Titles>
         </MenuItem>
         <MenuSpacer />
         <MenuItem>
          <Titles>
           <Title LCID="1033" Text="Test Sub 2" />
          </Titles>
         </MenuItem>
         <MenuItem Client="Web">
          <Titles>
           <Title LCID="1033" Text="Web Only" />
          </Titles>
         </MenuItem>
         <MenuItem Client="Outlook" AvailableOffline="true">
          <Titles>
           <Title LCID="1033" Text="Outlook Only" />
          </Titles>
         </MenuItem>
        </SubMenu>
        <MenuItem Client="Web">
         <Titles>
          <Title LCID="1033" Text="Web Only" />
         </Titles>
        </MenuItem>
        <MenuItem Client="Outlook" AvailableOffline="true">
         <Titles>
          <Title LCID="1033" Text="Outlook Only" />
         </Titles>
        </MenuItem>
       </ActionsMenu>
       <Buttons>
        <Button Icon="/_imgs/ico_18_debug.gif"
                Url="http://www.microsoft.com" WinParams="" WinMode="2">
         <Titles>
          <Title LCID="1033" Text="Test" />
         </Titles>
         <ToolTips>
          <ToolTip LCID="1033" Text="Info on Test" />
         </ToolTips>
         </Button>
         <ToolBarSpacer />
         <Button Icon="/_imgs/ico_18_debug.gif"
                 Url="http://www.microsoft.com" WinParams="" WinMode="1">
          <Titles>
           <Title LCID="1033" Text="Test" />
          </Titles>
          <ToolTips>
           <ToolTip LCID="1033" Text="Info on Test" />
          </ToolTips>
         </Button>
         <Button Icon="/_imgs/ico_18_debug.gif"
                 JavaScript="alert('test');" Client="Web">
          <Titles>
           <Title LCID="1033" Text="Web Only" />
          </Titles>
          <ToolTips>
           <ToolTip LCID="1033" Text="Web client only. This will not appear in any Outlook pages." />
          </ToolTips>
         </Button>
         <Button Icon="/_imgs/ico_18_debug.gif"
                 JavaScript="alert('test');" Client="Outlook"
                 AvailableOffline="true">
          <Titles>
           <Title LCID="1033" Text="Outlook Only" />
          </Titles>
          <ToolTips>
           <ToolTip LCID="1033" Text="Outlook Only - This is available offline also." />
          </ToolTips>
         </Button>
        </Buttons>
       </MenuBar>
      </Grid>
     </Entity>
      <Entity name="contact" />
      <Entity name="lead" />
      <Entity name="opportunity" />
      <Entity name="list" />
      <Entity name="campaign" />
      <Entity name="campaignactivity" />
      <Entity name="campaignresponse" />
      <Entity name="incident" /><!-- Case -->
      <Entity name="quote" />
      <Entity name="salesorder" /><!-- Order -->
      <Entity name="invoice" />
      <!-- Custom Entities -->
      <!-- <Entity name="new_myentity"/> -->
      <!-- End Custom Entities -->
    </Entities>
<!-- Microsoft Customer Relationship Management Service Management Customization -->
   <ServiceManagement>
    <AppointmentBook>
     <SmoothScrollLimit>2000</SmoothScrollLimit>
     <TimeBlocks>
<!-- All CSS Class mapping for Service activities -->
      <TimeBlock EntityType="4214" StatusCode="1"
                 CssClass="ganttBlockServiceActivityStatus1" />
      <TimeBlock EntityType="4214" StatusCode="2"
                 CssClass="ganttBlockServiceActivityStatus2" />
      <TimeBlock EntityType="4214" StatusCode="3"
                 CssClass="ganttBlockServiceActivityStatus3" />
      <TimeBlock EntityType="4214" StatusCode="4"
                 CssClass="ganttBlockServiceActivityStatus4" />
      <TimeBlock EntityType="4214" StatusCode="6"
                 CssClass="ganttBlockServiceActivityStatus6" />
      <TimeBlock EntityType="4214" StatusCode="7"
                 CssClass="ganttBlockServiceActivityStatus7" />
      <TimeBlock EntityType="4214" StatusCode="8"
                 CssClass="ganttBlockServiceActivityStatus8" />
      <TimeBlock EntityType="4214" StatusCode="9"
                 CssClass="ganttBlockServiceActivityStatus9" />
      <TimeBlock EntityType="4214" StatusCode="10"
                 CssClass="ganttBlockServiceActivityStatus10" />
<!-- All CSS Class mapping for Appointments -->
      <TimeBlock EntityType="4201" StatusCode="1"
                 CssClass="ganttBlockAppointmentStatus1" />
      <TimeBlock EntityType="4201" StatusCode="2"
                 CssClass="ganttBlockAppointmentStatus2" />
      <TimeBlock EntityType="4201" StatusCode="3"
                 CssClass="ganttBlockAppointmentStatus3" />
      <TimeBlock EntityType="4201" StatusCode="4"
                 CssClass="ganttBlockAppointmentStatus4" />
      <TimeBlock EntityType="4201" StatusCode="5"
                 CssClass="ganttBlockAppointmentStatus5" />
      <TimeBlock EntityType="4201" StatusCode="6"
                 CssClass="ganttBlockAppointmentStatus6" />
     </TimeBlocks>
    </AppointmentBook>
   </ServiceManagement>
  </configuration>
 </IsvConfig>
 <EntityMaps />
 <EntityRelationships />
 <Languages>
  <Language>1033</Language>
 </Languages>
</ImportExportXml>

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

控制MSCRM4菜单栏

修改_root/bar_top.aspx文件,在文件末尾添加以下代码,可以达到隐藏菜单的效果。

<script type="text/javascript">
document.getElementById("mnu_new_activity").style.display="none";
document.getElementById("mnu_new_record").style.display="none";
document.getElementById("btn_download_olk").style.display="none";
document.getElementById("help").style.display="none";
document.getElementById("btn_advfind").style.display="none";
document.getElementById("goto").style.display="none";
document.getElementById("tools").style.display="none";
</script>

mnu_new_activity 新建活动
mnu_new_record  新建记录
goto  转至
tools 工具
btn_advfind  高级查找
btn_download_olk  CRM For Outlook
help   帮助

mscrm4菜单栏.jpg

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

MSCRM4 隐藏按钮方法

///////////////////////////////////隐藏  将现有客户收费单添加到此记录 按钮//////////////////////////////////////////newnewkhjbxxnewkhsfd
//客户收费单
HideAssociatedViewButtons('new_new_khjbxx_new_khsfd',  ['_MBtoplocAssocOneToMany10040newnewkhjbxxnewkhsfd']); 
//客户证件信息
HideAssociatedViewButtons('new_new_khjbxx_new_khzjxx', ['_MBtoplocAssocOneToMany10074newnewkhjbxxnewkhzjxx']);
//客户帐号信息
HideAssociatedViewButtons('new_new_khjbxx_new_khzhxx', ['_MBtoplocAssocOneToMany10043newnewkhjbxxnewkhzhxx']);

//延期客户信息
HideAssociatedViewButtons('new_new_khjbxx_new_yqkhxx', ['_MBtoplocAssocOneToMany10060newnewkhjbxxnewyqkhxx','_MBcrmGridPrint','_MBcrmGridExportToExcel','_MBWebMailMergecrmGrid10060'
,'_MBdoActioncrmGrid10060assign','_MBdoActioncrmGrid10060delete','MoreActions']);


//-----------------------------------隐藏帧里的按钮----------------------
//-----------------------------------by 王大勇 2010-12-24----------------
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function HideAssociatedViewButtons(loadAreaId, HideEleIDs) {
    var navElement = document.getElementById('nav_' + loadAreaId);
    if (navElement != null) {
        navElement.onclick = function LoadAreaOverride() {
            // Call the original CRM method to launch the navigation link and create area iFrame
            loadArea(loadAreaId);
            HideViewButtons(document.getElementById(loadAreaId + 'Frame'), HideEleIDs);
        }
    }
}

function HideViewButtons(Iframe, HideEleIDs) {
    if (Iframe != null) {
        Iframe.onreadystatechange = function HideTitledButtons() {
            if (Iframe.readyState == 'complete') {
                var iFrame = frames[window.event.srcElement.id]; //var liElements = iFrame.document.getElementsByTagName('li');     
    
    for (var j = 0; j < HideEleIDs.length; j++) {
                  iFrame.document.getElementById(HideEleIDs[j]).style.display = 'none';
                }
    
            }
        }
    }
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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