I'm using lightning:recordForm with recordTYpeId for showing the user a new blank form when they need to input data. This works great since the page layout is controlled by the administrator for the user and record type. However, when I gave that form the record id to let them edit that data, only the Id field is being displayed. I've tried to break up the creation of the attributes in case i need to give the only the record id and not the record type id, but that didnt help. heres what I got
showEditRecordForm : function(component, row_id){
var component_attributes = {
"objectApiName" : "Applicant_History__c",
"layoutType" : "Compact",
"recordId" : row_id,
"recordTypeId" : component.get("v.applicant.recordTypeId"),
"columns" : component.get("v.NewRecordColumns"),
"mode" : "edit",
"oncancel" : component.getReference("c.handleCancel"),
"onload" : component.getReference("c.handleOnLoad"),
"onsuccess" : component.getReference("c.handleSuccess"),
"aura:id" : "newForm"
};
this.displayModalRecordForm(component, component_attributes);
},
showNewRecordForm : function(component, row_id){
var component_attributes = {
"objectApiName" : "Applicant_History__c",
"layoutType" : "Compact",
"recordId" : row_id,
"recordTypeId" : component.get("v.applicant.recordTypeId"),
"columns" : component.get("v.NewRecordColumns"),
"mode" : "edit",
"oncancel" : component.getReference("c.handleCancel"),
"onload" : component.getReference("c.handleOnLoad"),
"onsuccess" : component.getReference("c.handleSuccess"),
"aura:id" : "newForm"
};
this.displayModalRecordForm(component, component_attributes);
},
displayModalRecordForm : function(component, attributes){
var modalBody;
$A.createComponent(
"lightning:recordForm",
attributes,
function(content, status) {
if (status === "SUCCESS") {
modalBody = content;
var modalPromise = component.find('overlayLib').showCustomModal({
header: component.get("v.RelatedListLabel"),
body: modalBody,
showCloseButton: true,
cssClass: "mymodal",
closeCallback: function() {
console.log('You closed the modal!');
helper.loadData(component);
//helper.getData(component);
}
});
component.set("v.modalPromise", modalPromise);
}
});
}