From 4420517bbbffea48cabe7a7dcdf2e1c4b440fc85 Mon Sep 17 00:00:00 2001
From: GWY <guweiyi@prec-tech.com>
Date: 星期一, 30 五月 2022 16:15:26 +0800
Subject: [PATCH] 两个LS特殊条件在说明的增减
---
force-app/main/default/pages/NewAndEditOrder.page | 40 ++++++++++++++++++++++++++++++++++------
1 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/force-app/main/default/pages/NewAndEditOrder.page b/force-app/main/default/pages/NewAndEditOrder.page
index 04b7129..672905c 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);
@@ -220,9 +233,9 @@
v = ele.value;
}
- if(v && v != "000000000000000"){
+ //if(v && v != "000000000000000"){
result[field_api_name] = v;
- }
+ //}
}
} else if (ele.type == 'checkbox') {
@@ -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;
@@ -310,7 +322,9 @@
function checkRequiredFieldMsg(formData) {
let blankRequiredFields = '';
for(i = 0;i<requiredFieldAPIList.length;i++){
- if(formData[requiredFieldAPIList[i]]){
+ if(formData[requiredFieldAPIList[i]] && (VLookUpFields.indexOf(requiredFieldAPIList[i]) == -1)){
+ continue;
+ }else if((VLookUpFields.indexOf(requiredFieldAPIList[i]) != -1) && formData[requiredFieldAPIList[i]] != '000000000000000'){
continue;
}else{
if(blankRequiredFields == ''){
@@ -324,6 +338,7 @@
return blankRequiredFields;
}
function saveSobjectProcess(save_and_new) {
+ EditButton(true);
if(save_and_new){
config.SaveAndNew = true;
}
@@ -362,6 +377,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");
@@ -746,7 +762,19 @@
}else{
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
--
Gitblit v1.9.1