Guest User

Untitled

a guest
Feb 17th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. ({
  2.  
  3. doInit : function(component, event, helper) {
  4. var createBoatRecord = $A.get("e.force:createRecord");
  5. if(createBoatRecord){ //check if this event is available or not
  6. component.set("v.showNew", true);
  7. } else{
  8. component.set("v.showNew", false);
  9. }
  10. },
  11.  
  12. createRecord : function(component, event, helper) {
  13. var createCarRecord = $A.get("e.force:createRecord");
  14.  
  15. //getting selected picklist value
  16. var carTypeId = component.find("carType").get("v.value");
  17. carTypeId = carTypeId.length != 0?carTypeId:null;
  18. //This line sets parameter value to system event
  19. createCarRecord.setParams({
  20. "entityApiName": "Car__c",
  21. "defaultFieldValues": {
  22. "Car_Type__c" : carTypeId
  23. }
  24. });
  25. //This line fires system event
  26. createCarRecord.fire();
  27. },
  28. })
Add Comment
Please, Sign In to add comment