import { LightningElement,wire,track,api} from 'lwc';
|
import { CurrentPageReference,NavigationMixin } from "lightning/navigation";
|
import selectQuoteById from '@salesforce/apex/LexQuoteSelectbottonController.selectQuoteById';
|
import SIopprecordTypeId from '@salesforce/label/c.SIopprecordTypeId';
|
|
export default class LexQuoteEntryEditBottonLwc extends NavigationMixin(LightningElement){
|
@api recordId;
|
@wire(CurrentPageReference)
|
getStateParameters(currentPageReference) {
|
console.log(currentPageReference);
|
if (currentPageReference) {
|
const urlValue = currentPageReference.state.recordId;
|
if (urlValue) {
|
let str = `${urlValue}`;
|
console.warn("str");
|
console.warn(str);
|
this.recordId = str;
|
}
|
}
|
}
|
connectedCallback(){
|
console.warn('recordId'+this.recordId);
|
debugger
|
selectQuoteById({recordId:this.recordId}).then(result=>{
|
var RecordTypeid = result.Opportunity.RecordTypeId;
|
if(RecordTypeid.substr(0, 15) == SIopprecordTypeId){
|
// window.open('/apex/SI_NewQuoteEntry?Id={!URLENCODE(Quote.Id)}');
|
window.open('/lightning/n/lexSINewQuoteEntry#Id='+result.Id,'_self');
|
}else{
|
window.open('/lightning/n/lexNewQuoteEntry#Id='+result.Id,'_self');
|
// window.open('/apex/NewQuoteEntry?Id={!URLENCODE(Quote.Id)}');
|
}
|
});
|
}
|
}
|