| | |
| | | <apex:page standardController="Inspection_Report__c" extensions="NewAndEditInspectionReportController" id="page"> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | |
| | | updateMethod:"NewAndEditInspectionReportController.saveInspectionReport", |
| | | insertMethod:"NewAndEditInspectionReportController.saveInspectionReport" |
| | | } |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | var staticResourcesV2 = JSON.parse('{!staticResourceV2}'); |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | var requiredFieldAPIList = JSON.parse('{!requiredFieldAPIListStr}'); |
| | | var fieldAPIToLabelMap = JSON.parse('{!fieldAPIToLabelMapStr}'); |
| | | console.log('{!staticResource}'); |
| | |
| | | function ProcessPI(sobjJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(sobjJson, payloadForNewPI) |
| | | NewPIToAWS(sobjJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(sobjJson, payloadForNewPI) |
| | | } |
| | |
| | | } |
| | | return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1; |
| | | } |
| | | |
| | | function IsFormElement(e){ |
| | | |
| | | function IsFormElement(e){ |
| | | return IsFormTag(e.tagName); |
| | | } |
| | | |
| | |
| | | |
| | | return error_msg; |
| | | } |
| | | function getCKEinstance(api_name){ |
| | | function getCKEinstance(api_name){ |
| | | let t = jQuery("label[for$='textAreaDelegate_"+api_name+"']").parent().next().find("textarea")[0]; |
| | | if(t && t.id){ |
| | | return CKEDITOR.instances[t.id] |
| | |
| | | let obj = JSON.parse(payloadForNewPI); |
| | | obj[0].dataId = '{!AWSDataId}'; |
| | | let payloadForNewPIJson = JSON.stringify(obj); |
| | | AWSService.update(staticResources.updateUrl, sobjJson, payloadForNewPIJson, controllerSaveMethod, staticResources.token, staticResources.transactionUrl, false, insertOrUpdateBack,redirectCallBack); |
| | | |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | //AWSService.update(staticResources.updateUrl, sobjJson, payloadForNewPIJson, controllerSaveMethod, staticResources.token, staticResources.transactionUrl, false, insertOrUpdateBack,redirectCallBack); |
| | | AWSService.update(staticResourcesV2.updateUrl, sobjJson, payloadForNewPIJson, controllerSaveMethod, staticResourcesV2.token, staticResources.transactionUrl, false, insertOrUpdateBack,redirectCallBack); |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | } |
| | | |
| | | function NewPIToAWS(sobjJson, payloadForNewPI) { |
| | | let controllerSaveMethod = config.insertMethod; |
| | | AWSService.insert(staticResources.newUrl, sobjJson, payloadForNewPI, controllerSaveMethod, staticResources.token, staticResources.transactionUrl, true, insertOrUpdateBack,redirectCallBack); |
| | | |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | //AWSService.insert(staticResources.newUrl, sobjJson, payloadForNewPI, controllerSaveMethod, staticResources.token, staticResources.transactionUrl, true, insertOrUpdateBack,redirectCallBack); |
| | | AWSService.insert(staticResourcesV2.newUrl, sobjJson, payloadForNewPI, controllerSaveMethod, staticResourcesV2.token, staticResources.transactionUrl, true, insertOrUpdateBack,redirectCallBack); |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | } |
| | | |
| | | |
| | | 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 == ''){ |