Virendra
Novice

Salesforce LWC + Loop.loopMessage not working on Apex

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<stringstring>{ '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()));
           }
        }
       
    }
 
Labels: (1)
0 Kudos
Reply
1 Reply
Virendra
Novice

Re: Salesforce LWC + Loop.loopMessage not working on Apex

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>

0 Kudos
Reply