+ Start a Discussion
Shravan SazawalShravan Sazawal 

Lightning component - Custom Action on a Custom object- Create new Case record

I have a custom button/action of Action Type lightning component on a custom object that, when clicked, automatically creates a new case record of a certain Record Type, if it isn't linked to an existing case. The requirement is- to avoid automatically creating a case record, and instead give the user an option to manually choose the record type from a pop-up, similar to creating a new case from the Case object itself and then chossing a record type. I'm not too familiar with Lightning dev and would highly appreciate any assistance.

Below is the JS controller code:
      CreateCase : function(component, event, helper) {
        var caseNumberAdd3 = component.get("c.CasenumberShopp");
       var caseDetails=[];
          var caseid;
            "shoppingactivityID" :component.get("v.recordId")
           caseNumberAdd3.setCallback(this, function(response){
                   document.getElementById('loader1').style.display = 'none';
                        document.getElementById('mainDiv44').style.display = 'block';
                           $.each(caseDetails, function(key, value){
                        var urlEvent = $A.get("e.force:navigateToURL");
                "url": '/'+ value
    },close:function(component, event, helper) {
        document.getElementById("successMsg").style.display = 'none';
Anil SomasundaranAnil Somasundaran
Hi Shravan Sazawal,

Do you still have this requirement ?
Shravan SazawalShravan Sazawal
I ended up going a different route to solve this and would like to delete this post, but apparently I can't delete my own post(not particularly a fan of such a feature)