0

In my LWC I'd like to open a standard "new record" dialog with predefined values. I know I can use:

this[NavigationMixin.Navigate]({
    type: 'standard__objectPage',
    attributes: {
        objectApiName: 'Account',
        actionName: 'new'
    },
});

But how can I specify values for the fields on that dialog?

0

1 Answer 1

1

Currently, You can not set predefined values for it. I have raised the idea on Idea Exchange, you can upvote it.

You can use force:createRecord as a workaround. Here is the idea description :-

Aura component use the force:createRecordevent to display an prepopulated new record page. As we are migrating to Lightning web component, we do not have that ability.

Reference:- Allow setting pre-default values in record form by navigation service in LWC

Also, I have raised issue for it on Github, and as reply i get to know it is being planed for upcoming release.

https://github.com/trailheadapps/lwc-recipes/issues/66

1

Not the answer you're looking for? Browse other questions tagged .