import { LightningElement, track, wire, api } from 'lwc';
|
import {CurrentPageReference,NavigationMixin} from 'lightning/navigation';
|
import { CloseActionScreenEvent } from 'lightning/actions';
|
|
import init from '@salesforce/apex/rentalApplyEquipmentRentalPDFController.initJumptoPDFButton';
|
|
export default class rentalApplyEquipmentRentalPDF extends LightningElement {
|
@api recordId;
|
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.recordId' + this.recordId);
|
init({
|
recordId : this.recordId
|
}).then(result => {
|
if(result != null) {
|
this.IsLoading = false;
|
let num = result.pageLength;
|
console.log("======"+this.recordId + ' ' +num);
|
console.log("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/FixtureRentalPDF?raid=" + this.recordId + "&page=" + num)
|
window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/apex/FixtureRentalPDF?raid=" + this.recordId + "&page=" + num);
|
}
|
})
|
.catch( error =>{
|
console.log(error);
|
})
|
}
|
|
}
|