If using "create" mode with the getRecordUI wire adapter - how does the record type for the user get set?

Also, because recordIds is a required param should a key prefix or something be passed for "create" mode? Trying to understand the usage. Thanks!


It does not select a record type. Data for all record types are returned as part of the metadata. The create mode simply has the effect of excluding formula fields from page layouts and setting the "editable" flag appropriately for each field (some fields can be set on create, but not on edit). There is metadata that includes all the page layouts, and all the record types, and how they're mapped to the user. Your code will need to decipher this information to render the correct UI.

Edit: Based on your edit. It's not clear how to use create mode with recordIds. Providing an empty ID (e.g. 001000000000000AAA for accounts) should be sufficient, but I can't seem to find any concrete documentation. I'll have to test this and come back, or maybe you'll get another answer in the interim.

  • 1
    I opened an issue on the LWC github repo about the Create mode and recordIds. I'll comment on this when they reply Aug 12 at 0:51
  • @TemporaryFix Thanks!
    – sfdcfox
    Aug 12 at 1:08
  • I still have the issue open but according to the link below, if you use Create as the mode then you should really be using the getRecordCreateDefaults wire adapter which takes an objectApiName parameter instead of recordIds rajvakatidotcom.wordpress.com/2019/01/28/… Aug 12 at 1:51

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.