+ Start a Discussion
Carla Coordinator 13Carla Coordinator 13 

Lightnign:recordEditForm

Hi SF Coder,

     I have a custom Object named Tracker which has a master detail relationship with Case Object. I am trying to insert the deatil record using Lightnign:recordEditForm, but getting an unknown error: 
An error occurred while trying to update the record. Please try again.

Code Snippet:
Note: No field on tracker Object is mandatory. Also this issue is observed only in case of master detail. Once I change the field type to lookup it inserts the record.
Getting following JS error :

TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.remoteFunction (<anonymous>:2:14)


<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
    <lightning:recordEditForm objectApiName="Tracker__c">
        <lightning:messages />
        <lightning:inputField fieldName="Episode__c" />   /* Case is renamed to Episode */
        <lightning:button class="slds-m-top_small" variant="brand" type="submit" name="update" label="Update" />
    </lightning:recordEditForm>
</aura:component>

Thanks,
Ankita
arpit vijayvergiyaarpit vijayvergiya
Hi Ankita,

You need to pass id of record which you want to update. Use following recordId attribute to pass id. 
Also, you can see the complete article on the following URL.

https://ibirdstechshare.blogspot.com/2018/04/apex-less-lightning-component-By-ArpitVijayvergiya.html

Thanks,
Arpit vijayvergiya
Carla Coordinator 13Carla Coordinator 13
Hi Arpit,
  I am creating a new detail record here. In that case I shouldnt need to pass the record ID right?

Thanks,
Ankita
arpit vijayvergiyaarpit vijayvergiya
Hi Ankita,
Yes, you are right at the time of record creation we do not need the id of record. Right now are you testing your component in developer console preview? If yes then please add it inside SFDC and then test. It may solve your issue.

Thanks,