• MSCRM中用IFRAME显示实体的关联视图


    例如现在有一个工作汇报,要将上周总结跟本周计划放在一个表单一起管理,则可以用IFRAME实现

    代码
    //----------------方法1(只能用于1:n关系)-----------
    //上周工作汇报
    if(crmForm.FormType !='1' && crmForm.FormType !='5' && crmForm.FormType !='6')
    {
             
    var sArea = "new_new_departmentweekreport_new_departmentla";
             
    if(location.href.toLowerCase().indexOf(ORG_UNIQUE_NAME.toLowerCase()+".")>0)
             {
        
    var sBaseUrl = "http://"+document.location.host+"/userdefined/areas.aspx?";
             }
             
    else
             {
        
    var sBaseUrl = "/"+ORG_UNIQUE_NAME+"/userdefined/areas.aspx?";
             }
             
    var html = sBaseUrl;
             html 
    += "oId=" + crmForm.ObjectId;
             html 
    += "&oType=" + crmForm.ObjectTypeCode;
             html 
    += "&security=" +crmFormSubmit.crmFormSubmitSecurity.value;
             html 
    += "&tabSet=" + sArea;
             crmForm.all.IFRAME_new_departmentlastweekreport.src 
    = html;
    }
    else
    {
             
    if(crmForm.FormType =='1')
             {
                      crmForm.all.IFRAME_new_departmentlastweekreport.style.display 
    = 'none';
             }
    }


    //本周工作安排
    if(crmForm.FormType !='1' && crmForm.FormType !='5' && crmForm.FormType !='6')
    {
             
    var sArea = "new_new_departmentweekreport_new_departmentwe";
             
    if(location.href.toLowerCase().indexOf(ORG_UNIQUE_NAME.toLowerCase()+".")>0)
             {
        
    var sBaseUrl = "http://"+document.location.host+"/userdefined/areas.aspx?";
             }
             
    else
             {
        
    var sBaseUrl = "/"+ORG_UNIQUE_NAME+"/userdefined/areas.aspx?";
             }
             
    var html = sBaseUrl;
             html 
    += "oId=" + crmForm.ObjectId;
             html 
    += "&oType=" + crmForm.ObjectTypeCode;
             html 
    += "&security=" +crmFormSubmit.crmFormSubmitSecurity.value;
             html 
    += "&tabSet=" + sArea;
             crmForm.all.IFRAME_new_departmentweekplanreport.src 
    = html;
    }
    else
    {
             
    if(crmForm.FormType =='1')
             {
                      crmForm.all.IFRAME_new_departmentweekplanreport.style.display 
    = 'none';
             }
    }
    //---------方法2(能用于1:n跟n:n关系)-------------
    代码
    /*seer lin modified from jim wang*/
    var navId = "nav_new_new_myentity_account";
    var objIFrame = crmForm.all.IFRAME_view;
    loadMyArea(navId,objIFrame);

    function loadMyArea(navId,objIFrame){
        
    if(document.getElementById(navId) != null)
        {
          
    var tmp = document.getElementById(navId).onclick.toString();
          tmp 
    = tmp.substring(tmp.indexOf("'")+1, tmp.indexOf(";"));
          
    var tabSet = tmp.substring(0, tmp.indexOf("'"));
          
    var roleOrd =  (tmp.indexOf("roleOrd"== -1? -1 : tmp.substring( tmp.indexOf("roleOrd"), tmp.lastIndexOf("'")).replace("\\x3d""=");
          
    var path="";
            
    if (crmForm.ObjectId != null)
          {
            
    var id = crmForm.ObjectId;
            
    var type = crmForm.ObjectTypeCode;
            
    var security = crmFormSubmit.crmFormSubmitSecurity.value;
            
    var pathbase = document.location.pathname.substring(0, document.location.pathname.indexOf("edit.aspx")) + "areas.aspx?";
        
            path
    =pathbase + "oId=" + id + "&oType=" + type + "&security=" + security + "&tabSet=" + tabSet;
          }
          
    else
          {
            path
    = "about:blank";
          }
          
    if(roleOrd == -1){
                  objIFrame.src
    =path;
          }
    else{
              objIFrame.src
    =path+"&"+roleOrd;
          }
        }
    }
  • 相关阅读:
    flutter-常见的基础组件(一)
    flutter-dart语言初识
    从零开始配置安装Flutter开发环境
    vue路由vue-router
    css秘密花园一
    mvvm实现一个简单的vue
    js常见的设计模式一
    es6 generator函数的异步编程
    es6 async和await
    模块--random
  • 原文地址:https://www.cnblogs.com/seerlin/p/1828947.html
Copyright © 2020-2023  润新知