From 2bb4a2bc34048f49815846db354b5c8994669a3c Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期一, 09 五月 2022 17:48:43 +0800
Subject: [PATCH] SF PIPL Page Backup
---
force-app/main/default/pages/NewAndEditContact.page | 15 +++++
force-app/main/default/pages/NewAndEditLoanerApplication.page | 15 +++++
force-app/main/default/pages/NewAndEditLoanerUser.page | 15 +++++
force-app/main/default/pages/NewAndEditOrder.page | 39 ++++++++++--
force-app/main/default/pages/NewAndEditOpportunity.page | 15 +++++
manifest/packagestPage.xml | 14 ++++
force-app/main/default/pages/NewAndEditUserFaultInfo.page | 15 +++++
7 files changed, 121 insertions(+), 7 deletions(-)
diff --git a/force-app/main/default/pages/NewAndEditContact.page b/force-app/main/default/pages/NewAndEditContact.page
index 5a50388..bdace2f 100644
--- a/force-app/main/default/pages/NewAndEditContact.page
+++ b/force-app/main/default/pages/NewAndEditContact.page
@@ -136,6 +136,19 @@
UpdatePIToAWS(sobjJson, 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");
+ }
+ }
var GetEleByClass = function(class_name){
let eles = document.getElementsByClassName(class_name);
@@ -310,6 +323,7 @@
return blankRequiredFields;
}
function saveSobjectProcess(save_and_new) {
+ EditButton(true);
if(save_and_new){
config.SaveAndNew = true;
}
@@ -348,6 +362,7 @@
let errorMsgNode = document.getElementById("page:form:block:msgContent");
errorMsgNode.innerText = errorMsg;
errorMsgNode.className = 'pbError';
+ EditButton(false);
}
function hiddenErrorMsgNode() {
let errorMsgNode = document.getElementById("page:form:block:msgContent");
diff --git a/force-app/main/default/pages/NewAndEditLoanerApplication.page b/force-app/main/default/pages/NewAndEditLoanerApplication.page
index 1d9a080..5144554 100644
--- a/force-app/main/default/pages/NewAndEditLoanerApplication.page
+++ b/force-app/main/default/pages/NewAndEditLoanerApplication.page
@@ -136,6 +136,19 @@
UpdatePIToAWS(sobjJson, 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");
+ }
+ }
var GetEleByClass = function(class_name){
let eles = document.getElementsByClassName(class_name);
@@ -317,6 +330,7 @@
return blankRequiredFields;
}
function saveSobjectProcess(save_and_new) {
+ EditButton(true);
if(save_and_new){
config.SaveAndNew = true;
}
@@ -355,6 +369,7 @@
let errorMsgNode = document.getElementById("page:form:block:msgContent");
errorMsgNode.innerText = errorMsg;
errorMsgNode.className = 'pbError';
+ EditButton(false);
}
function hiddenErrorMsgNode() {
let errorMsgNode = document.getElementById("page:form:block:msgContent");
diff --git a/force-app/main/default/pages/NewAndEditLoanerUser.page b/force-app/main/default/pages/NewAndEditLoanerUser.page
index 5e853dd..22ebfe4 100644
--- a/force-app/main/default/pages/NewAndEditLoanerUser.page
+++ b/force-app/main/default/pages/NewAndEditLoanerUser.page
@@ -136,6 +136,19 @@
UpdatePIToAWS(sobjJson, 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");
+ }
+ }
var GetEleByClass = function(class_name){
let eles = document.getElementsByClassName(class_name);
@@ -306,6 +319,7 @@
}
function saveSobjectProcess(save_and_new) {
+ EditButton(true);
if(save_and_new){
config.SaveAndNew = true;
}
@@ -344,6 +358,7 @@
let errorMsgNode = document.getElementById("page:form:block:msgContent");
errorMsgNode.innerText = errorMsg;
errorMsgNode.className = 'pbError';
+ EditButton(false);
}
function hiddenErrorMsgNode() {
let errorMsgNode = document.getElementById("page:form:block:msgContent");
diff --git a/force-app/main/default/pages/NewAndEditOpportunity.page b/force-app/main/default/pages/NewAndEditOpportunity.page
index 03de251..3fca1b0 100644
--- a/force-app/main/default/pages/NewAndEditOpportunity.page
+++ b/force-app/main/default/pages/NewAndEditOpportunity.page
@@ -136,6 +136,19 @@
UpdatePIToAWS(sobjJson, 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");
+ }
+ }
var GetEleByClass = function(class_name){
let eles = document.getElementsByClassName(class_name);
@@ -312,6 +325,7 @@
}
function saveSobjectProcess(save_and_new) {
+ EditButton(true);
if(save_and_new){
config.SaveAndNew = true;
}
@@ -350,6 +364,7 @@
let errorMsgNode = document.getElementById("page:form:block:msgContent");
errorMsgNode.innerText = errorMsg;
errorMsgNode.className = 'pbError';
+ EditButton(false);
}
function hiddenErrorMsgNode() {
let errorMsgNode = document.getElementById("page:form:block:msgContent");
diff --git a/force-app/main/default/pages/NewAndEditOrder.page b/force-app/main/default/pages/NewAndEditOrder.page
index 04b7129..014cdb0 100644
--- a/force-app/main/default/pages/NewAndEditOrder.page
+++ b/force-app/main/default/pages/NewAndEditOrder.page
@@ -11,7 +11,7 @@
}
</style>
<script>
-
+ sforce.connection.sessionId = '{!GETSESSIONID()}';
var config = {};
config = {
SobjectName : "{!SobjectName}",
@@ -137,6 +137,19 @@
UpdatePIToAWS(sobjJson, 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");
+ }
+ }
var GetEleByClass = function(class_name){
let eles = document.getElementsByClassName(class_name);
@@ -248,7 +261,6 @@
function QuerySobjectFromAWS(EndUserLkid) {
if(EndUserLkid){
//query contact
- sforce.connection.sessionId = '{!GETSESSIONID()}';
let result = sforce.connection.query("SELECT AWS_Data_Id__c from Contact where id = '" + EndUserLkid + "'");
let records = result.getArray("records");
let awsDataId = records[0].AWS_Data_Id__c;
@@ -324,6 +336,7 @@
return blankRequiredFields;
}
function saveSobjectProcess(save_and_new) {
+ EditButton(true);
if(save_and_new){
config.SaveAndNew = true;
}
@@ -362,6 +375,7 @@
let errorMsgNode = document.getElementById("page:form:block:msgContent");
errorMsgNode.innerText = errorMsg;
errorMsgNode.className = 'pbError';
+ EditButton(false);
}
function hiddenErrorMsgNode() {
let errorMsgNode = document.getElementById("page:form:block:msgContent");
@@ -738,15 +752,26 @@
var EndUserLkid = '000000000000000';
if(document.querySelector("[data-id='EndUser__c']")){
EndUserLkid = document.getElementById(document.querySelector("[data-id='EndUser__c']").id + '_lkid').value;
+ if(EndUserLkid!='000000000000000'){
+ QuerySobjectFromAWS(EndUserLkid);
+ }
}
if (!{!isNewMode}) {
blockme();
- if(EndUserLkid!='000000000000000'){
- QuerySobjectFromAWS(EndUserLkid);
- }else{
- QuerySobjectFromAWS();
+ QuerySobjectFromAWS();
+ }
+
+ //瑙e瘑鏈�缁堢敤鎴�.
+ if(document.querySelector("[data-id='EndUserD__c']")){
+ EndUserDLkid = document.getElementById(document.querySelector("[data-id='EndUserD__c']").id + '_lkid').value;
+ //query contact
+ let result = sforce.connection.query("SELECT AWS_Data_Id__c from Contact where id = '" + EndUserDLkid + "'");
+ let records = result.getArray("records");
+ let awsDataId = records[0].AWS_Data_Id__c;
+ let queryContactBack = function(data){
+ document.querySelector("[data-id='EndUserD__c']").value = data.object.lastName;
}
-
+ AWSService.query(staticResourcesContact.queryUrl, awsDataId, queryContactBack, staticResources.token);
}
//Replace Vlookup Field
diff --git a/force-app/main/default/pages/NewAndEditUserFaultInfo.page b/force-app/main/default/pages/NewAndEditUserFaultInfo.page
index a49f57d..314fb6e 100644
--- a/force-app/main/default/pages/NewAndEditUserFaultInfo.page
+++ b/force-app/main/default/pages/NewAndEditUserFaultInfo.page
@@ -137,6 +137,19 @@
UpdatePIToAWS(sobjJson, 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");
+ }
+ }
var GetEleByClass = function(class_name){
let eles = document.getElementsByClassName(class_name);
@@ -310,6 +323,7 @@
}
function saveSobjectProcess(save_and_new) {
+ EditButton(true);
if(save_and_new){
config.SaveAndNew = true;
}
@@ -348,6 +362,7 @@
let errorMsgNode = document.getElementById("page:form:block:msgContent");
errorMsgNode.innerText = errorMsg;
errorMsgNode.className = 'pbError';
+ EditButton(false);
}
function hiddenErrorMsgNode() {
let errorMsgNode = document.getElementById("page:form:block:msgContent");
diff --git a/manifest/packagestPage.xml b/manifest/packagestPage.xml
new file mode 100644
index 0000000..0d5acae
--- /dev/null
+++ b/manifest/packagestPage.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Package xmlns="http://soap.sforce.com/2006/04/metadata">
+ <types>
+ <members>NewAndEditContact</members>
+ <members>NewAndEditOpportunity</members>
+ <members>NewAndEditOrder</members>
+ <members>NewAndEditLoanerApplication</members>
+ <members>NewAndEditUserFaultInfo</members>
+ <members>NewAndEditQuotes</members>
+ <members>NewAndEditLoanerUser</members>
+ <name>ApexPage</name>
+ </types>
+ <version>52.0</version>
+</Package>
\ No newline at end of file
--
Gitblit v1.9.1