import init from '@salesforce/apex/lexLastbuyProductController.initForCBLBPNew'; import { api, wire,LightningElement } from 'lwc'; export default class LexCBLBPNew extends LightningElement { @api recordId; name; IsLoading = true; connectedCallback(){ init({ recordId: this.recordId }).then(result=>{ this.name = result.name; this.CBLBPNew(); }); } CBLBPNew(){ var url = '/apex/StandardFieldDefaults?'; var product = this.recordId; if (product != undefined && product != '') { url = url + 'SObjId=' + this.recordId + '&SObjName=' + this.name + '&linkId=00N10000009HD8q' + '&Pagefrom=Product'; } url = url + '&Pageto=LastbuyProduct'; window.open(url); this.closeAction(); } closeAction(){ window.open("/"+this.recordId,'_self'); } }