You need to sign in to do that
Don't have an account?
lakshya agrawal
how to set field type is equal to number for lightning record edit form in lwc for some field??
<lightning-record-edit-form object-api-name="Criteria__c" record-id={criteriaId} onsuccess={onSuccessCriteria}>
<lightning-messages data-id='formerror'></lightning-messages>
<lightning-input-field field-name="Name" required="true">
</lightning-input-field>
<lightning-input-field field-name="Valuation_Index__c">
</lightning-input-field>
<lightning-input-field field-name="Criteria_Item_Logic__c">
</lightning-input-field>
<lightning-input-field field-name="Criteria_Unique_ID__c">
</lightning-input-field>
</lightning-record-edit-form>
for the field - name ="Name"??/
<lightning-messages data-id='formerror'></lightning-messages>
<lightning-input-field field-name="Name" required="true">
</lightning-input-field>
<lightning-input-field field-name="Valuation_Index__c">
</lightning-input-field>
<lightning-input-field field-name="Criteria_Item_Logic__c">
</lightning-input-field>
<lightning-input-field field-name="Criteria_Unique_ID__c">
</lightning-input-field>
</lightning-record-edit-form>
for the field - name ="Name"??/
Using lightning-input-field inside of the component is enough - Salesforce will handle the rest and show the appropriate UI based on the type of the field. For example, a combo box for a picklist, an input[type="text"] for text, and a textarea for long text.
That said, there isn't any way in the lightning-record-edit-form component to tell what type a field is. All of the logic is handled internally by the component.
Reference:https://salesforce.stackexchange.com/questions/327085/determine-field-type-lightning-record-edit-form
See related: https://salesforce.stackexchange.com/questions/252323/how-do-you-change-the-value-of-a-lightning-input-field-in-javascript
If this information helps, please mark the answer as best. Thank you