binxie
2024-01-18 0f648a2059e4c0f0f850b69128e2123673732ed1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!-- 需要按照转授权字段的ID 改这里-->
<apex:page standardController="SubAuthorized__c" showHeader="false" sidebar="false" lightningStylesheets="true">
    <script type="text/javascript">
        function init() {
            var str = '/a3Q/e?&Name=*';
            if(getParam('retURL') != null){
                str += '&retURL='+getParam('retURL');
            }
           // alert(getParam('CF00N10000008qp8Z')); niwu -CF00N10000008qp8Z
            if(getParam({!$label.subAuthorized_1}) != null){
                str += '&{!$Label.subAuthorized_1}=*';
            }
            if(getParam({!$label.subAuthorized_2}) != null){  //niwu subAuthorized_2 - CF00N10000008qp8Z_lkid
                str += '&{!$label.subAuthorized_2}='+getParam({!$label.subAuthorized_2});
            }
            str += '&nooverride=1';
            window.location.href = str;
        }
        function getParam(paramName) {
            paramValue = "", isFound = !1;
            if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
                arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
                while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
            }
            return paramValue == "" && (paramValue = null), paramValue
        }
        document.addEventListener("DOMContentLoaded", function(event) {
            init();
        });
    </script>
    <body onload="init()">
    </body>
</apex:page>