import { LightningElement, track, wire,api } from 'lwc'; import {CurrentPageReference,NavigationMixin} from 'lightning/navigation'; import { CloseActionScreenEvent } from 'lightning/actions'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import transferApplyPDF from '@salesforce/apex/TransferApplyController.transferApplyPDF'; export default class lexTransferApplyPDF extends LightningElement { @api recordId; transferApplyPDFRes; IsLoading=true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(currentPageReference); if(currentPageReference) { const urlValue = currentPageReference.state.recordId; if(urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback() { console.log('this.transferApplyId:' + this.recordId); transferApplyPDF({ transferApplyId : this.recordId }).then(result => { console.log(result); this.transferApplyPDFRes = result; this.cancelSubmit().then(res=>{ this.IsLoading=false; this.dispatchEvent(new CloseActionScreenEvent()); }); }).catch( error =>{ console.log(error); }); } async cancelSubmit(){ let records = new Array(); records = this.transferApplyPDFRes; var size =records.length; if(size>0){ var length = size%10 ==0? size/10 : parseInt(size/10) +1; for(var i =0;iApprovalDetails__c 20210805 ljh SFDC-C56D3K 已下架->已批准 var sqlResult = sforce.connection.query(sql); var records = sqlResult.getArray("records"); var size =records.length; if(size>0){ var length = size%10 ==0? size/10 : parseInt(size/10) +1; for(var i =0;i