Li Jun
2022-05-09 8baef49505113fb3edee372c370e9c859cd7c762
force-app/main/default/pages/NewAndEditContact.page
@@ -1,5 +1,5 @@
<apex:page standardController="Contact" extensions="NewAndEditContactController" id="page" action="{!PageLoad}">
    <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script>
    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
@@ -156,7 +156,7 @@
        function ProcessPI(sobjJson, payloadForNewPI) {
            blockme();
            if ({!isNewMode} || {!isCloneMode}) {
               NewPIToAWS(sobjJson, payloadForNewPI)
                NewPIToAWS(sobjJson, payloadForNewPI)
            }else {
                UpdatePIToAWS(sobjJson, payloadForNewPI)
            }
@@ -184,8 +184,8 @@
            }
            return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1;
        }
       function IsFormElement(e){
        function IsFormElement(e){
            return IsFormTag(e.tagName);
        }
@@ -202,7 +202,7 @@
            // if(email ){
            //     if(email.value){
            //         if(!/^[\w-]{3,12}@[\da-zA-Z]{2,16}\.[a-zA-Z]+$/.test(email.value)){
            //            error_msg += ';邮件格式错误';
            //          error_msg += ';邮件格式错误';
            //         }
            //     }else{
            //         if(email.previousSibling && email.previousSibling.className.indexOf('requiredBlock')>-1){
@@ -215,7 +215,7 @@
            // if(phone && false ){
            //     if(phone.value){
            //         if(!/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)){
            //            error_msg += ';电话号码错误';
            //          error_msg += ';电话号码错误';
            //         }
            //     }else{
            //         if(phone.previousSibling && phone.previousSibling.className.indexOf('requiredBlock')>-1){
@@ -288,7 +288,7 @@
                
                // let e1 = document.getElementById(api_id_map[field_api_name]);
                // if(!result[field_api_name] && e1 && e1.value){
                //    result[field_api_name] = e1.value;
                //  result[field_api_name] = e1.value;
                // }
            }
            return result;
@@ -474,20 +474,20 @@
            var api_id_map={};
            for(let ei in init_nodes){
                let e = init_nodes[ei];
               if(IsFormElement(e)){
                if(IsFormElement(e)){
                    if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
                        api_id_map[GetEleApiName(e)] = e.id;
                    }
                }
            }
            console.log(api_id_map);
            sfdcPage.appendToOnloadQueue(function () {
                
                jQuery('option').each(function(i,e){
                   if(e.value == '_\x01_'){
                      e.value = '';
                   }
                    if(e.value == '_\x01_'){
                        e.value = '';
                    }
                })
                
                //1. Set Last Name label
@@ -498,7 +498,7 @@
                    blockme();
                    QuerySobjectFromAWS();
                }else{
                   let ot = jQuery('input[data-id="OwnerId"]');
                    let ot = jQuery('input[data-id="OwnerId"]');
                    let oi = document.getElementById(ot.attr("id")+'_lkid');
                    ot.val('{!CurrentUserName}');
                    ot.attr("readonly","");
@@ -507,7 +507,7 @@
                    ot.css("outline","0");
                    
                    if(oi){
                       oi.value = '{!CurrentUserId}'
                        oi.value = '{!CurrentUserId}'
                    }
                }
                document.getElementById('topButtonRow').style = '';