Salesforce LWC + Loop.loopMessage not working on Apex

  • 20 August 2021
  • 2 replies
  • 123 views

Hi,

I am trying to call 

Loop.loopMessage  request from LWC  Apex controller.  There are no error or exception .. but document is not generating.  
The same method when I will call from VFpage+Apex Controller is working fine.  Is it a Known issue .. any workaround please ?
Please help .. I appreciates.  
 
Below is My Code which is not working on LWC apex Controller class .
@AuraEnabled
    public static void attachCaseSheetWithContact(String intakeSelectedId) {
       system.debug('::intakeSelectedId::'+intakeSelectedId);
       Loop.loopMessage lm = new Loop.loopMessage();
       lm.requests.add(new Loop.loopMessage.loopMessageRequest(
                                   intakeSelectedId,
                                   'a0U1N000007DGdq',
                                   new Map<string, string>{ 'deploy' => 'a0T1N000005S2Ty'}
       ));
  
       system.debug('::lm::::'+lm);
  
       if(lm != null && lm.requests != null && !lm.requests.isEmpty()){
           try{
             system.debug('::Request Sent :::'+lm);
             if(!test.isRunningTest()){
                lm.sendAllRequests();
             }
           }catch(Exception ex){
               system.debug('::Exception Found showCaseSheetPreview::: ');
               system.debug(ex);
              // ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error, ex.getMessage()));
           }
        }
       
    }
 

2 replies

Hi Community members.. Everything is working fine for you using   LWC ..?  


 


I am getting response as below ..


<?xml version='1.0' encoding='utf-8'?> <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>


<soap:Body>


 <notificationsResponse xmlns='http://soap.sforce.com/2005/09/outbound'>


  <Ack>false</Ack>


</notificationsResponse>


</soap:Body> </soap:Envelope>

Badge +1

Hi @Virendra - Did you happen to get a response for this issue ?  I’m working on a similar solution where LWC is invoking the loopMessage from Partner Community and seems like everything works fine but there is no file generated or attached. 

Do respond if you get this.

Reply