title: Is there a way to pass multiple (and different) parameters to an Apex Controller class from JS in Lightning Web Components (LWC)?
body: <p>I'm currently stuck at a problem and was hoping someone here could help me. I also certainly hope this is the right place to ask it. </p>
  
  <p>I'm trying to create a custom Invoice record with its corresponding Invoice Line records upon firing an event. I already have some logic in place to gather ID of selected rows in the JS. </p>
  
  <p>I've gone so far as to be able to create the Invoice record (using LDS) and the Invoice Line records (using Apex), but can't seem to pass the Invoice ID for the Invoice Line records. I know I'm able to create the records because it works when I tested this with a hardcoded Invoice ID.</p>
  
  <p>Would it be possible to pass multiple parameters of List and String to an Apex method in LWC? </p>
  
  <p>I would appreciate any help. Thanks in advance!</p>
  
  <p><strong>JS</strong></p>
  
  <pre><code>    selectedRowsEvent(event) {
  
      ...some codes here...
  
      this.selectedRecords = Array.from(conIds);
      }
  
  
      handleSave() {
  
           **invId;**
  
           ...some codes here...
  
          createRecord(recordInput)
          .then(invoice =&gt; {
              **this.invId = invoice.Id;**  
              **createInvLines({ lstConIds : this.selectedRecords, invoiceId : this.invId})**
          }).catch(error =&gt; {
  
            ...some codes here...
  
            });
      }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>@AuraEnabled
      public static void createInvLines(list&lt;Id&gt; lstConIds, string invoiceId){
          if(lstConIds.size() &gt; 0){
              List&lt;OpportunityLine__c&gt; oppLst = new List&lt;OpportunityLine__c&gt;([SELECT Id, Description__c FROM OpportunityLine__c WHERE Id = :lstConIds]);
              try {
                  List&lt;InvoiceLine__c&gt; lstInvLinesToInsert = new List&lt;InvoiceLine__c&gt;();
                  for(OpportunityLine__c idCon : oppLst) {
                      lstInvLinesToInsert.add(new InvoiceLine__c(**InvoiceId__c = invoiceId**, Description__c = idCon.Description__c));
                  }
                  if(!lstInvLinesToInsert.isEmpty()) {
                      insert lstInvLinesToInsert;
                  }
              }
              catch(Exception ex) {
                  throw new AuraHandledException(ex.getMessage());
              }
          }
      }  
  </code></pre>