Last active
February 17, 2019 22:33
-
-
Save choudharymanish8585/4f32da34710ee3ced2ebb19631eab0d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
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); | |
} | |
helper.getCarType(component, helper); | |
}, | |
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; | |
console.log('carType--'+carTypeId); | |
debugger; | |
//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(); | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment