Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ({
- doInit : function(component, event, helper) {
- var createBoatRecord = $A.get("e.force:createRecord");
- if(createBoatRecord){ //check if this event is available or not
- component.set("v.showNew", true);
- } else{
- component.set("v.showNew", false);
- }
- },
- createRecord : function(component, event, helper) {
- var createCarRecord = $A.get("e.force:createRecord");
- //getting selected picklist value
- var carTypeId = component.find("carType").get("v.value");
- carTypeId = carTypeId.length != 0?carTypeId:null;
- //This line sets parameter value to system event
- createCarRecord.setParams({
- "entityApiName": "Car__c",
- "defaultFieldValues": {
- "Car_Type__c" : carTypeId
- }
- });
- //This line fires system event
- createCarRecord.fire();
- },
- })
Add Comment
Please, Sign In to add comment