You need to sign in to do that
Don't have an account?
Kevyn Herbet 10
lightning:inputField as picklist. How to remove options without removing from record type?
Hi,
I'm trying to remove options in lightning:inputField but I didn't know how to do it.
This TVN1Result__c returns Active, Cancelled, Draft, Completed. I would like to remove Active and Completed.
TVN1Result__c is a controlling field of TVN2Result__c dependent picklist field used in RecordEditForm.
I can't remove the options on record type because another page will use all the options.
STYLE:
.THIS lightning-base-combobox-item[data-value="Active "] {
display:none!important;
}
.THIS lightning-base-combobox-item[data-value="Completed"] {
display:none!important;
}
All Answers
STYLE:
.THIS lightning-base-combobox-item[data-value="Active "] {
display:none!important;
}
.THIS lightning-base-combobox-item[data-value="Completed"] {
display:none!important;
}
It is not possible to do it using lightning:inputField you must replace the field with a lightning:select and assign the value of the picklist in the controller.
component :
controller.js
If this helps, Please mark it as best answer.
Thanks!!
Hi,
Have you been able to resolve this please ?
I'm also using a picklist in a lightning-input-field, and I would like to remove the option "Non défini" (value API name : C0).
I have tried to do the same as Alain :
But I'm still getting the option "Non défini" :
Thanks for you help.