/*
|
* @Description:
|
* @version:
|
* @Author: chen jing wu
|
* @Date: 2023-09-12 15:25:16
|
* @LastEditors: chen jing wu
|
* @LastEditTime: 2023-09-12 15:40:46
|
*/
|
import { LightningElement,api,wire } from 'lwc';
|
import { CloseActionScreenEvent } from "lightning/actions";
|
import { CurrentPageReference } from "lightning/navigation";
|
import Sample_Inventory_Report from "@salesforce/label/c.Sample_Inventory_Report";
|
import init from '@salesforce/apex/lexAccountController.init';
|
|
export default class LexSampleInventoryReport extends LightningElement {
|
@api recordId;
|
name;
|
@wire(CurrentPageReference)
|
getStateParameters(currentPageReference) {
|
if (currentPageReference) {
|
this.url = currentPageReference.state.backgroundContext;
|
const urlValue = currentPageReference.state.recordId;
|
if (urlValue) {
|
let str = `${urlValue}`;
|
this.recordId = str;
|
}
|
}
|
}
|
|
connectedCallback() {
|
init({
|
recordId: this.recordId
|
}).then(result=>{
|
this.name = result.name;
|
window.open('/lightning/r/Report/' + Sample_Inventory_Report + '/view?fv0=' + this.name,'_blank');
|
this.closeAction();
|
});
|
|
}
|
|
closeAction() {
|
this.dispatchEvent(new CloseActionScreenEvent());
|
return;
|
}
|
}
|