0

Using ui:inputCheckbox with LDS for a new contact is giving me error if I don't select checkbox.

If I select the checkbox and then unselect it, it works, else it is giving an error

INVALID_TYPE_ON_FIELD_IN_RECORD

value not of required type


<ui:inputCheckbox value="{!v.object.selected__c}" />

What am I missing? If I want to pass false to the field, I have to select and then unselect it.

Edit

from the comments: I had tried lightning:input typed checkbox as well, but I faced setting it value properly; that's why I went for ui:inputCheckbox.

4
  • 4
    Any reason why you're not using base lightning components from the lightning namespace? Commented Dec 8, 2018 at 18:31
  • Which component do you suggest?
    – Mahmood
    Commented Dec 8, 2018 at 18:43
  • Which tag are you using? lightning:recordForm or force:recordData? Commented Dec 8, 2018 at 18:53
  • LDS is force:recordData.
    – Mahmood
    Commented Dec 8, 2018 at 19:23

1 Answer 1

1

The recommended option for UI components is to use a base Lightning component.

https://developer.salesforce.com/docs/component-library/bundle/lightning:input/example#lightningcomponentdemo:exampleInputCheckbox

They eventually supersede any component from the ui namespace.

You must log in to answer this question.

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