I need to make the Name
field required on the lightning:recordEditForm
. So I tried its onload
event and recordUi
parameter. But it didn't work. So I am wondering if it's even possible with recordUi
?
component.cmp
<lightning:recordEditForm objectApiName="myObject__c" onload="{! c.handleOnload }" >
<lightning:inputField aura:id="field" fieldName="Name" />
</lightning:recordEditForm>
controller.js
handleOnload: function(component, event, helper) {
console.log("handleOnload");
const recordUi = event.getParam("recordUi");
recordUi.objectInfos["myObject__c"].fields.Name.required = true;
recordUi.objectInfo.fields.Name.required = true;
}