• Ashish Verma
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 10
    Replies
Can anyone tell me what is my error in this code to delete accounts details in salesforce. I am getting DMLexception error when I execute. 

global class deleteaccount implements Database.Batchable<sobject> {
    global final string Query;
    
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        string query = 'select Id, name from Account';
        return Database.getQueryLocator(query);
    }
    
    global void execute(Database.BatchableContext BC, list<Account> scope)
   {
    List<Account> lstAccount = new list<Account>();
    for(Sobject s : scope){
     Account a = (Account)s;
    lstAccount.add(a);
    }
    Delete lstAccount;
   } 
        
    global void finish(Database.BatchableContext BC)
    {
        Messaging.singleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'sudhansindhuja@gmail.com'};
            mail.setToAddresses(toAddresses);
        mail.setSubject('job done');
        mail.setPlainTextBody('batch class over');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});
    }
}
Hi , I added a few methods in an already present trigger helper class. Now when I ran the test class for it, i am getting Too many SOQL queries error. Any ideas how can I resolve this issue?
Iam using Amazon toolkit to integrate SF with Amazon S3.

I want to render the content(image) of files in a bucket when bucket is selected from a selectlist. Like ListBucket, I am calling a method 'getObject' which in turn calls the webservice operation 'GetObject' from S3 class. I can see the request and response(200) in my developer console but there is an exception

ERROR: Web service callout failed: Unable to parse callout response. Apex type not found for element Status.User-added image
Can anyone tell me what is my error in this code to delete accounts details in salesforce. I am getting DMLexception error when I execute. 

global class deleteaccount implements Database.Batchable<sobject> {
    global final string Query;
    
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        string query = 'select Id, name from Account';
        return Database.getQueryLocator(query);
    }
    
    global void execute(Database.BatchableContext BC, list<Account> scope)
   {
    List<Account> lstAccount = new list<Account>();
    for(Sobject s : scope){
     Account a = (Account)s;
    lstAccount.add(a);
    }
    Delete lstAccount;
   } 
        
    global void finish(Database.BatchableContext BC)
    {
        Messaging.singleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'sudhansindhuja@gmail.com'};
            mail.setToAddresses(toAddresses);
        mail.setSubject('job done');
        mail.setPlainTextBody('batch class over');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});
    }
}
Hi Developer Forum,
I am trying to understand why some records in our Salesforce Sales instance are changed automatically each night. I have set up User Trace Flags in the Debug Logs, I see  'Batch APEX' all over the logs, don't know what that means, I am not a developer.
I would appreciate your support as the Salesforce support team says this is not part of their responsibility.
Thanks in advance!

How do I set up breadcrumbs to work in Community? I have a number of pages that I want to arrange hierarchically so that they can be displayed in a Breadcrumbs component as a path. The documentation on this is very poor.  When I drag Breadcrumbs component to a page it says "We can't load the Breadcrumbs component because it's not supported by any data. Once you add data, reload Community Builder to see your component."
How to add that data? I have tried to add relative links to pages under Administration > Pages > Site.com Studio > Sitemap, but that didn't seem to affect the Breadcrumbs component. (also, what are the relative links: /s/pageurl or /pageurl ?)

Hi Friends,

Does anyone have sample test class for apex class which has soql query for External Objects? Kindly share.

Thanks,
Loges
  • February 25, 2015
  • Like
  • 0
Iam using Amazon toolkit to integrate SF with Amazon S3.

I want to render the content(image) of files in a bucket when bucket is selected from a selectlist. Like ListBucket, I am calling a method 'getObject' which in turn calls the webservice operation 'GetObject' from S3 class. I can see the request and response(200) in my developer console but there is an exception

ERROR: Web service callout failed: Unable to parse callout response. Apex type not found for element Status.User-added image

I successfully integrated the Amazon toolkit.

 

  1. staff can login into salesforce to upload a photo to amazon and create a salesforce S3 Object record too. The S3 Object record allows me to connect the S3 Object to the external users' accounts in salesforce.
  2. My external force site users can upload their photo as well, no record created, just a file lands in a S3 bucket.

I am trying to decide between the 2 options.

 

If I use option 1, how should I get the photos from external users to my staff to perform the upload and approval? Email is possible, but kinda crude??

 

If I use option 2, I need a way to approve or disapprove the photo before it becomes public?

 

I guess the biggest issue is properly tying the photo back to the record if I let external users upload photos. Also, Should I just download the images from the bucket and let staff re-upload into salesforce?

Hi,

 

I need to change Users Email address using apex without user having to confirm the new Email Address, is there a way i can achieve it.

 

Thanks!

I have been using Force for AWS (http://wiki.developerforce.com/index.php/Installing_Force_for_Amazon_Web_Services)

 

But it seems most of the methods are not fully finished. Has any one completed the sections in S3.cls that are commented out. Inparticular getObject?

If you have it would be greatly appreciated if you could post your soultion.

Message Edited by dke01 on 12-07-2009 10:20 PM
  • December 08, 2009
  • Like
  • 0