/* * @Description: 新建调拨重写 No. 默认* * @Author: [lijinhuan] * @Date: 2023-07-03 15:55:28 * @LastEditors: [lijinhuan] * @LastEditTime: 2023-07-06 18:05:15 */ import { LightningElement,wire } from 'lwc'; import { CurrentPageReference,NavigationMixin } from 'lightning/navigation'; import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; export default class LexTransferApplyNew extends NavigationMixin(LightningElement) { recordTypeId; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { const urlValue = currentPageReference.state.recordTypeId; if (urlValue) { let str = `${urlValue}`; this.recordTypeId = str; let defaultFieldValues = {}; defaultFieldValues['Name'] = '*'; this[NavigationMixin.Navigate]({ type: 'standard__objectPage', attributes: { objectApiName: 'TransferApply__c', actionName: 'new' }, state: { nooverride: '1', defaultFieldValues: encodeDefaultFieldValues(defaultFieldValues), recordTypeId: this.recordTypeId, useRecordTypeCheck: 1, navigationLocation: 'LIST_VIEW', backgroundContext: '/lightning/o/TransferApply__c/list?filterName=Recent&0.source=alohaHeader' } }); } } } }