Li Jun
2022-04-27 24fda5246494953a232b37547fb50bde77bd9886
force-app/main/default/pages/NewAndEditLead.page
@@ -24,12 +24,25 @@
        function ProcessPI(leadJson, payloadForNewPI) {
            blockme();
            if ({!isNewMode} || {!isCloneMode}) {
            NewPIToAWS(leadJson, payloadForNewPI)
        }else {
            UpdatePIToAWS(leadJson, payloadForNewPI)
        }
                NewPIToAWS(leadJson, payloadForNewPI)
            }else {
                UpdatePIToAWS(leadJson, payloadForNewPI)
            }
        }
        function EditButton(isDisabled){
            var topele = document.getElementById('topButtonRow');
            var bottomele = document.getElementById('bottomButtonRow');
            if (isDisabled) {
                topele.classList.add("disabledbutton");
                bottomele.classList.add("disabledbutton");
            }else {
                topele.classList.remove("disabledbutton");
                bottomele.classList.remove("disabledbutton");
            }
        }
        function enableButton(obj) {
            obj.classList.remove("btnDisabled");
        }
@@ -189,6 +202,9 @@
            } else {
                payloadJson.AWS_Data_Id__c = '{!AWSDataId}';
            }
            if('{!rtTypeId}'){
                payloadJson.RecordTypeId = '{!rtTypeId}';//Add by zhj for Record Type Issue 20220421
            }
            return payloadJson;
        }
@@ -241,6 +257,7 @@
            return blankRequiredFields;
        }
        function saveLeadProcess(saveMode) {
            EditButton(true);
            disableButtonStatus();
            redirectMode = saveMode;
@@ -276,6 +293,7 @@
            errorMsgNode.innerText = errorMsg;
            errorMsgNode.className = 'pbError';
            unblockUI();
            EditButton(false);
        }
        function hiddenErrorMsgNode() {
            let errorMsgNode = document.getElementById("page:form:block:msgContent");
@@ -414,7 +432,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">意向编辑</h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveLeadProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveLeadProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
@@ -437,8 +455,15 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                        <!-- <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}" required="{!layoutField.isRequired}" />
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&layoutField.fieldAPI!='RecordTypeId'}" required="{!layoutField.isRequired}" />
                        <apex:outputField html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&layoutField.fieldAPI=='RecordTypeId'}"   /> -->
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
                        />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -576,6 +601,9 @@
                    
                    unblockUI();
                }
                document.getElementById('topButtonRow').style = '';
           document.getElementById('bottomButtonRow').style = '';
                let previous_value = {};
                    jQuery(".lookupInput input").each(function(i,e){
                        let je =jQuery(e);
@@ -701,7 +729,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButton" id="bottomButtonRow">
                            <td class="pbButton" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveLeadProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveLeadProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />