Hi,
The following js code snippet helps to auto-populate values when the New button is overridden.
Code Snippet:
const defaultValues = encodeDefaultFieldValues({
Name: 'Salesforce Techbook Foundation',
});
this[NavigationMixin.Navigate]({
type: 'standard__objectPage',
attributes: {
objectApiName: 'Account',
actionName: 'new'
},
state: {
nooverride: '1',
recordTypeId: this.recordtypId,
defaultFieldValues: defaultValues
}
});
eval("$A.get('e.force:refreshView').fire();");
Reference :
https://developer.salesforce.com/docs/component-library/overview/components
No comments:
Post a Comment