• Elisa Fields
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hi,
I am trying to import one salesforce report from excel by following the below steps.
Open MS Excel, go to Data -> Get Data -> From online service-->From salesforce reports then its navigating to login and then to navigator

There i can only see salesforce report count as 10k and when i search my report it is not dispalying in that list.

I tried to right click on salesforce report and click on load it imported the names of the reports in that i found my report count at 12k. Could you please help me how to import my Salesforce report.
I have a triiger that, upon update or insert makes a number of callouts to an external API.  

So the trigger calls a method from a helper class that is defined as @future (callout=true) .

That all works great until I try to send an email as part of this sequence.  Then any callouts that occur after the email is generated give the error "System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out".

I first tried sending this email through another method marked as @future, but was told that future methods can't call future methods.

So I changed it to a queable:
 
public class TribeSendEmail implements Queueable {
    
    String HTMLBody = '';  
    String recipientEmail = '';
    
    public TribeSendEmail(String HTMLBody, String recipientEmail) {  
  
        this.HTMLBody = HTMLBody;  
        this.recipientEmail = recipientEmail;  
    }  
  
    public void execute(QueueableContext qc) {  
        Messaging.reserveSingleEmailCapacity(1);
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        String[] toAddresses = new String[] {recipientEmail}; 
        String[] ccAddresses = new String[] {foo@bar.org'};
        
        mail.setToAddresses(toAddresses);
        mail.setCcAddresses(ccAddresses);
        mail.setSubject('This is the subject');
        mail.setBccSender(false);        
        mail.setHtmlBody(HTMLBody);        
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });    
    } 
}
Which I call as follows from the @future method:
System.enqueueJob( new TribeSendEmail( emailBody, recipient ) );
but it still gives me the errors on any subsequent callouts.

Note that there are no DML actions in any of these classes aside from the sending of the email, and if I comment out the "enqueJob" statement, it all works fine.

Can anyone suggest a way to send an email from within this context or advise if I am doing something wrong?

Thanks!



 
Hi,this function takes as input a value (Quantity) this value must be subtracted from the value of the Available Quantity field contained in the "prodList" list filtered by the id, with the result of the subtraction "rquantity" must be inserted (update) in the list " v.prodList "passing the id. How can it be done?

Controller:
yesBtn : function(component,event,helper){
        var qty=component.find("prova").get("v.value");
        var name=component.get("v.Name");
        var cr=component.get("v.id");
        var aquantity=component.get("v.AQuantity");
        console.log("id book "+component.get("v.id"));
        if(qty>aquantity){
            var toastEvent = $A.get("e.force:showToast");
            toastEvent.setParams({
                title : 'Error',
                message: 'the quantity you want exceeds that available',
                duration:' 5000',
                key: 'info_alt',
                type: 'Error',
                mode: 'pester'
            });
            toastEvent.fire();
        }
        else{
            var rquantity=aquantity-qty;
            console.log("Available quantity - quantity = " +rquantity);
           
            
          
         
        }

 
When users log in inside the Salesforce mobile application, they use an Okta integration we have set up but, once they try to open a link to an external page which requires the same SSO login (it is a SAP Fiori application integrated with Okta), the page requires again the SSO info to log the user in.
Is there a way to avoid the second login by passing the SSO information from the Salesforce application to the external link?