0

I have the exact same code in production and sandbox. Things look as expected in sandbox, but in production I can see different css being applied. In Production the lightning input field is being rendered with a class of slds-form-element_horizontal. That class isn't applied in Sanboxes though.

<template>
    <lightning-record-edit-form record-id={contactId} object-api-name="Contact">

        <div class="slds-grid">
            <div class="slds-col slds-size_2-of-12"></div>

            <div class="slds-col slds-size_3-of-12">
                <lightning-input-field disabled field-name="FirstName">
                </lightning-input-field>
            </div>
            <div class="slds-col slds-size_3-of-12">
                <lightning-input-field disabled field-name="LastName">
                </lightning-input-field>
            </div>
            <div class="slds-col slds-size_4-of-12">
            </div>
        </div>


    </lightning-record-edit-form>
</template>
  • is your sandbox on the same version as your production? Are your APEX Classes set up to use the most recent API version? – gNerb Nov 15 at 21:25
  • where is yout lightning web component being used? – Glen De Marcos Nov 15 at 21:48
  • is this communities? – Pranay Jaiswal Nov 19 at 17:30
  • API version 47.0 on production and sandboxes. No Apex involved. I made a simple test with this as a record detail. – gneek Nov 19 at 17:31
  • @gneek where is this being used?Are you adding this component in another parent lightning component? – devforce Nov 19 at 17:32
0

Figured it out! I had to adjust my Display Density setting to Comfy. And now I see I can override that in code.
density=comfy on lightning-record-edit-form.

<lightning-record-edit-form density="comfy" record-id={contactId} object-api-name="Contact">

https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.data_display_density

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.