From 03523642de0c4f319d90d0aec8a756f9e80e6a7e Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期四, 17 三月 2022 21:27:47 +0800
Subject: [PATCH] PIPLFunctionDeployV2

---
 force-app/main/default/pages/NewRentalApply.page |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/pages/NewRentalApply.page b/force-app/main/default/pages/NewRentalApply.page
index 02d03e3..a9ba68d 100644
--- a/force-app/main/default/pages/NewRentalApply.page
+++ b/force-app/main/default/pages/NewRentalApply.page
@@ -1,3 +1,10 @@
+<!--
+  @description       : 
+  @author            : ChangeMeIn@UserSettingsUnder.SFDoc
+  @group             : 
+  @last modified on  : 03-17-2022
+  @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
+-->
 <apex:page standardController="Rental_Apply__c" extensions="RentalApplyController" id="page">
     <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
     <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
@@ -244,7 +251,8 @@
             return template.content.firstChild;
         }
         function queryContactName() {
-            let sfId = document.getElementById(document.querySelector("[data-id='Loaner_medical_Staff__c']").id + '_lkid').value;
+            // let sfId = document.getElementById(document.querySelector("[data-id='Loaner_medical_Staff__c']").id + '_lkid').value;
+            let sfId = document.getElementById(document.querySelector("[data-id='Account__c']").id + '_lkid').value;
             let contactsInfo = JSON.parse('{!contactsInfo}');
             let dataId = contactsInfo[sfId];
             let url = staticResourcesContact.queryUrl + '?dataId=' + dataId;
@@ -355,6 +363,16 @@
             <script>
                 //Append Page
                 sfdcPage.appendToOnloadQueue(function () {
+                    var layoutSections = JSON.parse('{!layoutSectionsStr}');
+                    for (let m = 0; m < layoutSections.length; m++) {
+                        let layoutSection = layoutSections[m].layoutFields;
+                        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);
+                            }
+                        }
+                    }
                     //2. Query AWS Data by dataId 
                     console.log('Mode for rentalApply Page:' + {!isNewMode});
                     if (!{!isNewMode}) {

--
Gitblit v1.9.1