From 2d5b6ced9bbcb7a30159fd892b39d27a7e048b82 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期日, 24 四月 2022 09:41:45 +0800
Subject: [PATCH] BatchForAgencyContact
---
force-app/main/default/pages/NewAndEditAddress.page | 40 ++++++++++++++++++++++++++--------------
1 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/force-app/main/default/pages/NewAndEditAddress.page b/force-app/main/default/pages/NewAndEditAddress.page
index 773d6fe..18649f4 100644
--- a/force-app/main/default/pages/NewAndEditAddress.page
+++ b/force-app/main/default/pages/NewAndEditAddress.page
@@ -1,10 +1,3 @@
-<!--
- @description :
- @author : ChangeMeIn@UserSettingsUnder.SFDoc
- @group :
- @last modified on : 03-23-2022
- @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
--->
<apex:page standardController="Address__c" extensions="NewAndEditAddressController" id="page">
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
@@ -30,7 +23,7 @@
var VLookUpFields = new Set(['Contacts__c', 'Province__c', 'City__c', 'Customer__c']);
function ProcessPI(addressJson, payloadForNewPI) {
blockme();
- if ({!isNewMode}) {
+ if ({!isNewMode} || {!isCloneMode}) {
NewPIToAWS(addressJson, payloadForNewPI)
}else {
UpdatePIToAWS(addressJson, payloadForNewPI)
@@ -88,7 +81,7 @@
if(phone ){
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){
@@ -172,10 +165,14 @@
payloadJson.Detailed_Address_Encrypted__c = r.object[0].detailedAddressEncrypt;
//payloadJson.AWS_Data_Id__c = r.object[0].dataId;
payloadJson.AWS_Data_Id__c = '{!AWSDataId}';
- if (isNewMode) {
+ if (isNewMode || {!isCloneMode}) {
payloadJson.AWS_Data_Id__c = r.object[0].dataId;
+ delete payloadJson.OwnerId;
} else {
payloadJson.AWS_Data_Id__c = '{!AWSDataId}';
+ }
+ if('{!rtTypeId}'){
+ payloadJson.RecordTypeId = '{!rtTypeId}';//Add by zhj for Record Type Issue 20220421
}
return payloadJson;
}
@@ -379,7 +376,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="saveAddressProcess('Save')" />
<input class="btn" type="Button" value="淇濆瓨骞舵柊寤�" onclick="saveAddressProcess('SaveAndNew')" />
<apex:commandButton action="{!cancel}" value="鍙栨秷" />
@@ -402,8 +399,12 @@
<!--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="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
+ <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
required="{!layoutField.isRequired}" />
+ <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
+ required="{!layoutField.isRequired}" />
+ <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
+ />
<apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
</apex:pageblocksectionitem>
</apex:repeat>
@@ -418,7 +419,16 @@
for (let n = 0; n < layoutSection.length; n++) {
let layoutField = layoutSection[n];
if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) {
- document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField);
+ let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']");
+ e.disabled = !(layoutField.editableField);
+ if (!(layoutField.editableField)) {
+ if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') {
+ e.parentNode.classList.add("disabledbutton");
+ }
+ if (e.tagName == 'DIV') {
+ e.classList.add("disabledbutton");
+ }
+ }
}
}
}
@@ -434,6 +444,8 @@
replaceSearchContactLookup();
//3. Set Readonly Attribute
// document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
+ document.getElementById('topButtonRow').style = '';
+聽 聽 聽 聽 聽 聽 聽 document.getElementById('bottomButtonRow').style = '';
/*
jQuery(".lookupInput").each(function(i,e){
let je =jQuery(e).find('input');
@@ -492,7 +504,7 @@
<tr>
<td class="pbTitle">
<img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> </td>
- <td class="pbButtonb" id="bottomButtonRow">
+ <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
<input class="btn" type="Button" value="淇濆瓨" onclick="saveAddressProcess('Save')" />
<input class="btn" type="Button" value="淇濆瓨骞舵柊寤�" onclick="saveAddressProcess('SaveAndNew')" />
<apex:commandButton action="{!cancel}" value="鍙栨秷" />
--
Gitblit v1.9.1