<!--
|
@description :
|
@author : ChangeMeIn@UserSettingsUnder.SFDoc
|
@group :
|
@last modified on : 02-22-2022
|
@last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
|
-->
|
<apex:page standardController="Contact" extensions="NewAndEditContactController" id="page">
|
<apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/>
|
<apex:form id="form">
|
<apex:pageblock id="pageBlock">
|
<apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection">
|
<!--Each section has layoutFields, let's iterate them as well-->
|
<!-- <apex:repeat value="{!layoutEncryptedAPIList}" var="encryptedAPI">
|
<apex:outputField html-data-id="{!encryptedAPI}" title="{!ApiPrefix}{!encryptedAPI}" value="{!Contact[encryptedAPI]}" />
|
</apex:repeat> -->
|
<apex:outputField html-data-id="{!encryptedAPIList[0]}" title="{!ApiPrefix}{!encryptedAPIList[0]}" value="{!Contact[encryptedAPIList[0]]}" />
|
<br/>
|
<!-- Title -->
|
<apex:outputField html-data-id="{!encryptedAPIList[1]}" title="{!ApiPrefix}{!encryptedAPIList[1]}" value="{!Contact[encryptedAPIList[1]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[2]}" title="{!ApiPrefix}{!encryptedAPIList[2]}" value="{!Contact[encryptedAPIList[2]]}" />
|
|
<apex:outputField value="{!Contact.Title_IsChanged__c}" />
|
<!-- Mobile Phone -->
|
<apex:outputField html-data-id="{!encryptedAPIList[3]}" title="{!ApiPrefix}{!encryptedAPIList[3]}" value="{!Contact[encryptedAPIList[3]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[4]}" title="{!ApiPrefix}{!encryptedAPIList[4]}" value="{!Contact[encryptedAPIList[4]]}" />
|
|
<apex:outputField value="{!Contact.MobilePhone_IsChanged__c}" />
|
<!-- Phone -->
|
<apex:outputField html-data-id="{!encryptedAPIList[5]}" title="{!ApiPrefix}{!encryptedAPIList[5]}" value="{!Contact[encryptedAPIList[5]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[6]}" title="{!ApiPrefix}{!encryptedAPIList[6]}" value="{!Contact[encryptedAPIList[6]]}" />
|
|
<apex:outputField value="{!Contact.Phone_IsChanged__c}" />
|
<!-- Fax -->
|
<apex:outputField html-data-id="{!encryptedAPIList[7]}" title="{!ApiPrefix}{!encryptedAPIList[7]}" value="{!Contact[encryptedAPIList[7]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[8]}" title="{!ApiPrefix}{!encryptedAPIList[8]}" value="{!Contact[encryptedAPIList[8]]}" />
|
|
<apex:outputField value="{!Contact.Fax_IsChanged__c}" />
|
<!-- OtherPhone -->
|
<apex:outputField html-data-id="{!encryptedAPIList[9]}" title="{!ApiPrefix}{!encryptedAPIList[9]}" value="{!Contact[encryptedAPIList[9]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[10]}" title="{!ApiPrefix}{!encryptedAPIList[10]}" value="{!Contact[encryptedAPIList[10]]}" />
|
|
<apex:outputField value="{!Contact.OtherPhone_IsChanged__c}" />
|
<!-- Email -->
|
<apex:outputField html-data-id="{!encryptedAPIList[11]}" title="{!ApiPrefix}{!encryptedAPIList[11]}" value="{!Contact[encryptedAPIList[11]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[12]}" title="{!ApiPrefix}{!encryptedAPIList[12]}" value="{!Contact[encryptedAPIList[12]]}" />
|
|
<apex:outputField value="{!Contact.Email_IsChanged__c}" />
|
<!-- Postcode -->
|
<apex:outputField html-data-id="{!encryptedAPIList[13]}" title="{!ApiPrefix}{!encryptedAPIList[13]}" value="{!Contact[encryptedAPIList[13]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[14]}" title="{!ApiPrefix}{!encryptedAPIList[14]}" value="{!Contact[encryptedAPIList[14]]}" />
|
|
<apex:outputField value="{!Contact.Postcode_IsChanged__c}" />
|
<!-- Address1 -->
|
<apex:outputField html-data-id="{!encryptedAPIList[15]}" title="{!ApiPrefix}{!encryptedAPIList[15]}" value="{!Contact[encryptedAPIList[15]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[16]}" title="{!ApiPrefix}{!encryptedAPIList[16]}" value="{!Contact[encryptedAPIList[16]]}" />
|
|
<apex:outputField value="{!Contact.Address1_IsChanged__c}" />
|
<!-- Address2 -->
|
<apex:outputField html-data-id="{!encryptedAPIList[17]}" title="{!ApiPrefix}{!encryptedAPIList[17]}" value="{!Contact[encryptedAPIList[17]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[18]}" title="{!ApiPrefix}{!encryptedAPIList[18]}" value="{!Contact[encryptedAPIList[18]]}" />
|
|
<apex:outputField value="{!Contact.Address2_IsChanged__c}" />
|
<!-- Address3__c -->
|
<apex:outputField html-data-id="{!encryptedAPIList[19]}" title="{!ApiPrefix}{!encryptedAPIList[19]}" value="{!Contact[encryptedAPIList[19]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[20]}" title="{!ApiPrefix}{!encryptedAPIList[20]}" value="{!Contact[encryptedAPIList[20]]}" />
|
|
<apex:outputField value="{!Contact.Address3_IsChanged__c}" />
|
<!-- ContactEnglishName -->
|
<apex:outputField html-data-id="{!encryptedAPIList[21]}" title="{!ApiPrefix}{!encryptedAPIList[21]}" value="{!Contact[encryptedAPIList[21]]}" />
|
<apex:outputField html-data-id="{!encryptedAPIList[22]}" title="{!ApiPrefix}{!encryptedAPIList[22]}" value="{!Contact[encryptedAPIList[22]]}" />
|
</apex:pageBlockSection>
|
<script>
|
var config = {
|
SobjectName : "{!SobjectName}",
|
ApiPrefix:"{!ApiPrefix}",
|
AWSToSobjectMap:{!AWSToSobjectMapJson},
|
AWSToSobjectNonEncryptedMap:{!AWSToSobjectNonEncryptedMapJson},
|
AWSToSobjectEncryptedMap:{!AWSToSobjectEncryptedMapJson}
|
};
|
var staticResources = JSON.parse('{!staticResource}');
|
function QuerySobjectFromAWS() {
|
AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token);
|
}
|
var queryBack = function queryBack(data) {
|
if(!data.object){
|
console.log('data.object is ' + data.object);
|
return;
|
}
|
|
for(let f in config.AWSToSobjectNonEncryptedMap){
|
let t = "[title='"+config.ApiPrefix+config.AWSToSobjectNonEncryptedMap[f]+"']";
|
let ele = document.querySelector(t);
|
if(ele){
|
ele.title = '';
|
if(data.object.hasOwnProperty(f)){
|
ele.innerHTML = data.object[f];
|
}
|
else{
|
console.log(f + 'is not in data.object');
|
}
|
}else{
|
console.log('selector='+t+' not found');
|
}
|
|
}
|
// 当不能自动正确替换加密数据时需要在此处添加js,硬编码处理
|
// document.querySelector("[data-id='LastName']").value = data.object.lastName;
|
};
|
sfdcPage.appendToOnloadQueue(function () {
|
console.log('sfdcPage.appendToOnloadQueue')
|
// document.querySelector("[data-id='LastName']").parentNode.parentNode.parentNode.children[0].innerText = '姓名'
|
QuerySobjectFromAWS();
|
});
|
</script>
|
</apex:pageblock>
|
</apex:form>
|
</apex:page>
|