Skip to content

Instantly share code, notes, and snippets.

@choudharymanish8585
Created February 21, 2019 19:33
Show Gist options
  • Save choudharymanish8585/3303b1f2331692ef4a9b17066ada8084 to your computer and use it in GitHub Desktop.
Save choudharymanish8585/3303b1f2331692ef4a9b17066ada8084 to your computer and use it in GitHub Desktop.
({
onInit : function(component,event,helper) {
component.find("service").getNewRecord(
"Car_Experience__c", // sObject type (entityAPIName)
null, // recordTypeId
false, // skip cache?
$A.getCallback(function() {
var rec = component.get("v.carExperience");
var error = component.get("v.recordError");
var car=component.get("v.car");
if(error || (rec === null)) {
console.log("Error initializing record template: " + error);
}
else {
component.set("v.carExperience.Car__c",car.Id);
}
})
);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment