SHARE
TWEET

Untitled

a guest Jul 19th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. showCreateRecordModal : function(component, recordTypeId, entityApiName) {
  2. debugger;
  3. var objectType = component.get("v.quickActionName");
  4. var createRecordEvent = $A.get("e.force:createRecord");
  5.  console.log('QA name is TYPE IS: ' + JSON.stringify(quickActionName));
  6. if(createRecordEvent){
  7.     if(recordTypeId){
  8.         //using switch if sobject type needs to be expanded (it's a cleaner way than if/else)
  9.         switch (quickActionName) {
  10.             case "Create_International_Opp":
  11.                     createRecordEvent.setParams({
  12.                         "entityApiName": entityApiName,
  13.                         "recordTypeId": <record type y>,
  14.                         "defaultFieldValues": {
  15.  
  16.                           data to be passed,
  17.                         }
  18.  
  19.                     });
  20.                     createRecordEvent.fire();
  21.                     break;
  22.             case "Create_domestic_Opp":
  23.                 createRecordEvent.setParams({
  24.                     "entityApiName": entityApiName,
  25.                     "recordTypeId": <record type x>,
  26.                     "defaultFieldValues": {
  27.  
  28.                         data to be passed,
  29.  
  30.                     }
  31.                 });
  32.                 createRecordEvent.fire();
  33.                 break;
  34.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top