1

Is it possible to call the standard create record modal without invoking a page redirect. After reading this thread I learned that you can call the create record event using lightning navigation mixin.

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

this works fantastic except for the fact that it redirects the page to the newly created record. Is there currently any way to call the create new record modal without immediately after navigating to the newly created record's page?

1

Yes, you can use lightning-record-form in LWC to get the full layout without page redirect or without calling any apex method.

Below is the code example:

<lightning-record-form  object-api-name="Account" layout-type="Full" columns="2" mode="edit">
                </lightning-record-form>

You can read more about lightning-record-form here

2
  • Thank you this was just what I was looking for May 27 at 19:33
  • Always happy to help :) May 28 at 5:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.