I have a component with a
lightning:recordEditForm that I build using an
aura:iteration over fields from a field set for Order Products. I've added a custom submit method in my controller that makes sure that all required fields have values:
var fields = evt.getParam("fields"); fields.OrderId = cmp.get("v.recordId"); fields.PricebookEntryId = cmp.get("v.currentFs").pbeId; fields.Product2Id = cmp.get("v.currentFs").prodId; fields.Quantity = 1.00; fields.UnitPrice = 0.00;
When I fill out the form and submit in my component, though, it gives me an error that when I log it to the console says I have a field integrity exception on
UnitPrice because "Order Products must have a unit price."
I just moved this component from a scratch org into a company sandbox, and I didn't have this issue in the scratch org. I've tested to make sure my value actually gets saved to the
fields variable, and I don't know where else to check for what's wrong.
What else might be a factor in this?