0

I am trying to add a custom LWC to a phone record page however getting the below error message. Could anyone help me out how to make the component mobile view-able.

enter image description here

1

From the documentation of Form Factors,

If you don’t define , the component supports the form factors that the page type supports. However, we recommend defining for each page type.

App pages support the Large and Small form factors. Record and Home pages support only the Large form factor.

Components on app pages can render on both phone and desktop because the app page supports both phone and desktop. Components on record and Home pages can render only on desktop because these page types support only desktop.

However, record and home pages are supported from Winter'20 - October 14, 2019 to be precise - you can refer to Customize Lightning Record Pages for the Phone Form Factor and Unlock Mobile Configuration Options in the Lightning App Builder

You can configure for phone as below: (Form Factors documentation)

<targetConfigs>
    <targetConfig targets="lightning__AppPage">
        <property name="prop2" type="Boolean" />
        <supportedFormFactors>
            <supportedFormFactor type="Small" />
        </supportedFormFactors>
    </targetConfig>
    <targetConfig targets="lightning__RecordPage">
        <property name="prop1" type="String" />
        <supportedFormFactors>
            <supportedFormFactor type="Large" />
        </supportedFormFactors>
    </targetConfig>
    <targetConfig targets="lightning_HomePage">
        <property name="prop3" type="Integer" />
        <supportedFormFactors>
            <supportedFormFactor type="Large" />
        </supportedFormFactors>
    </targetConfig>
</targetConfigs>
  • Thanks a lot for the information. I have a better understanding now. – Shravan Kumar R. Sep 11 at 6:59

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.