function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Robert SzymczakRobert Szymczak 

force:recordData record is not creatable

Hello, 

I am trying to create a form that adds records to the Campaign object. I am quite new to salesforce and have been struggling with figuring out how to make this work and where my gaps in understanding are.

Here is my code so far:
component1component2component3controller1controller2

The helper function is set to always return true.
When I look at this form on the home page "Record is not Createable" appears below the form, and when I click the submit button I get the error message:
"Uncaught Action failed: c:RecordFormCampaign$controller$handleSaveCampaign [Cannot read property 'recordId' of null]"

Shouldn't the added record be assigned a unique id when created? I'm not sure where to look for the specific information I need. The examples in the documentation have not helped me get past this.

Any help would be much appreciated. Thank you.

 
Nayana KNayana K
Hi Robert,
I have not gone through whole code. But, definitely you are missing an interface => force:hasRecordId. Please add it to RecordFormCampaign component.