I just completed the Aura Components Basics - Connect to Salesforce with Server-Side Controllers. Wrote the code and passed the text. But upon testing it in the App Preview, I get insert errors. The nature of this insert error is unclear. The apex code:
public with sharing class CampingListController {
@AuraEnabled
public static List<Camping_Item__c> getItems() {
return [SELECT id,name,price__c,Quantity__c,Packed__c
FROM Camping_Item__c];
}
@AuraEnabled
public static Camping_Item__c saveItem (Camping_Item__c item) {
upsert item;
return item;
}
}
And the corresponding error:
14:33:41:004 FATAL_ERROR System.DmlException: Upsert failed. First exception on row 0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, un12331__Camping_Item__c: bad field names on insert/update call: Price__c, Packed__c, Quantity__c: [Price__c, Packed__c, Quantity__c]
I have the Camping_Item defined in the Object Manager.