• Henry Akpala
  • NEWBIE
  • 145 Points
  • Member since 2011
  • Vida Consulting

  • Chatter
    Feed
  • 5
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 57
    Replies
Hello,

I have the following code in an Apex Batch Apex Class.

try{
            return Database.getQueryLocator(query);
        }catch(Exception ex){
            return null;
        }

However I cannot seem to catch an exception if an invalid query is provided. I receive the following error
System.UnexpectedException: Start did not return a valid iterable object..

If I try to catch the System.UnexpectedException I still receive an error.

Should a try/catch not work in this scenario?

Thanks in advance for any help.

Hi 

 

  I have written batch process everything is fine only the problem is I would like to send the Failure information in the email but it is sending as a null will to you in Detail.

 

 

       I have two objects 1.Site (location 1 and location 2)   2. Inventory(child Object)  location 1 inventory and location 2 inventory.

 

I have another object  Stock Transfer. Now I want to transfer the quantity from location 1 to Location 2. I will select location 1 and location 2 then another Object Stock Transfer line from this I can transfer any no items with the Quantity from location1 to location 2.

 

    If stock is available in Location 1 then quantity is transferred to Location 2. If Quantity is not available then  I want to send the information in email what lines are not transferred from Location 1 to Location 2.

 

 

global class StockTransferLineSitetoSite implements Database.Batchable<sObject>
  {
    global final String query;
    public date today1;
    String notTsl{set;get;}
    integer failures{get;set;}

    //Constroctor
    global StockTransferLineSitetoSite (String q)
      {
        query=q;
        failures=0;
      }
  
    global Database.QueryLocator start(Database.BatchableContext BC)
      {
        return Database.getQueryLocator(query);
      }
    
    global void execute(Database.BatchableContext BC, List<Stock_Transfer_Line__c> scope)
      {
        if(scope!=null)
          {
            /* this.today1=System.today();
            Stock_Transfer__c[] inventoryList = [select id,Name from Stock_Transfer__c];
            for(Stock_Transfer__c i : inventoryList)
              {    
                Stock_Transfer_Line__c [] stl=[select Stock_Transfer__r.Source_Location__c,
                                                    Stock_Transfer__r.Destination_location__c,
                                                      Item__c,
                                                       Qty_Transferred__c,
                                                         Request_Date__c
                                                           from Stock_Transfer_Line__c 
                                                           where
                                                              Request_date__c=t AND Stock_Transfer__c =:i.id];*/  
                               
            for(Stock_Transfer_Line__c j : scope) 
              {
                if(j.Posted_To_Inventory__c==false)
                  {
                    Inventory__c[] sinv=[select id,
                                                  name,
                                                    Quantity__c from Inventory__c
                                                      where id=:j.Inventory_No__c];
                    if(sinv[0].Quantity__c>=j.Qty_Transferred__c)
                      {
                        sinv[0].Quantity__c-=j.Qty_Transferred__c;
                        List<Inventory__c> dinv;
                     
                        if(j.Lot_ID__c!=null)
                          {
                            dinv=[select id,
                                           name, 
                                             Quantity__c from Inventory__c 
                                               where Site__c=:j.Stock_Transfer__r.Destination_Location__c AND 
                                                 Item__c=:j.Item__c AND 
                                                   Lot_ID__c=:j.Lot_ID__c];
       
                            if(dinv.size()!=0)
                              {
                                dinv[0].Quantity__c+=j.Qty_Transferred__c;
                                j.Posted_To_Inventory__c=true;
                                update dinv[0];
                                update sinv[0];
                                update j;
                              }
                            else
                              {
                                Item__c item=[select id,name from Item__c where id=:j.Item__c];
                                Inventory__c inv=new Inventory__c(Name=item.Name,
                                                                    Item__c=j.Item__c,
                                                                      Lot_ID__c=j.Lot_ID__c,
                                                                        Quantity__c=j.Qty_Transferred__c,
                                                                          Site__c=j.Stock_Transfer__r.Destination_Location__c);
                                update sinv[0];   
                                insert inv; 
                                j.Posted_To_Inventory__c=true;
                                update j;
                              }
                          }
                    
                        else if(j.Serial_ID__c!=null)
                          {
                            Item__c item=[select id,name from Item__c where id=:j.Item__c];
                            Inventory__c inv=new Inventory__c(Name=item.Name,
                                                                Item__c=j.Item__c,
                                                                  Serial_ID__c=j.Serial_ID__c,
                                                                    Quantity__c=j.Qty_Transferred__c,
                                                                      Site__c=j.Stock_Transfer__r.Destination_Location__c);
                          
                        
                            j.Posted_To_Inventory__c=true;
                            update j;
                            insert inv; 
                            delete sinv[0]; 
                          }
                        
                        else
                          {
                            dinv=[select id,
                                           Name, 
                                             Quantity__c from Inventory__c 
                                               where Site__c=:j.Stock_Transfer__r.Destination_Location__c AND 
                                                 Item__c=:j.Item__c AND 
                                                   Lot_ID__c=null AND Serial_ID__c=null];
       
        
                            if(dinv.size()!=0)
                              {
                                dinv[0].Quantity__c+=j.Qty_Transferred__c;
                                j.Posted_To_Inventory__c=true;
                                update dinv[0];
                                update sinv[0];
                                update j;
                              }
                            else
                              {
                                Item__c item=[select id,name from Item__c where id=:j.Item__c];
                                Inventory__c inv=new Inventory__c(Name=item.Name,
                                                                    Item__c=j.Item__c,
                                                                      Serial_ID__c=j.Serial_ID__c,
                                                                        Lot_ID__c=j.Lot_ID__c,
                                                                          Quantity__c=j.Qty_Transferred__c,
                                                                            Site__c=j.Stock_Transfer__r.Destination_Location__c);
         
                                insert inv;
                                j.Posted_To_Inventory__c=true; 
                                update sinv[0];
                                update j;
                              } 
                          }
                      }
                    else
                      {
                        notTsl=':'+j.Name +':'+j.Stock_Transfer__c;
                        failures++;
                        j.Additional_Information__c=notTsl; (in comments it is showing the Stock Transfer Line name and Stock Transfer ID )
                        update j;
                      }
                  }
              }  
          }
          notTsl='Hello World';
        }
      
      
    global void finish(Database.BatchableContext BC)
      {
        AsyncApexJob a = [SELECT id, ApexClassId,
                       JobItemsProcessed, TotalJobItems,
                       NumberOfErrors, CreatedBy.Email
                       FROM AsyncApexJob
                       WHERE id = :BC.getJobId()];

        // Get the ID of the AsyncApexJob representing this batch job  
        // from Database.BatchableContext.    
        // Query the AsyncApexJob object to retrieve the current job's information.  
        /*
        AsyncApexJob a = [Select Id, Status, NumberOfErrors, JobItemsProcessed,
        TotalJobItems, CreatedBy.Email
        from AsyncApexJob where Id =:BC.getJobId()];
        */
        // Send an email to the Apex job's submitter notifying of job completion.  
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'mahendar@field-connect.com'};
        mail.setToAddresses(toAddresses);
        mail.setSubject('Apex Schedule Exection mail');
        String s='hello these are not transfred lines'+notTsl;
        mail.setPlainTextBody('Not Transfered lines are '+s);(But in email it is sending as null)
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
      }
     

  } 

 

  Any help is Appreciated.

  • July 31, 2012
  • Like
  • 0

Hi

 

I am new to salesforce and i need some help in writing a trigger

 

Object A and Object B . Object B has a look up for Object A

 

when ever record is inserted in to object A i need to create records in object B( Condition is: I have a start date and end date on object A . Number  of records need to be created are Start Date - End Date +1 on object B with each record having a date.ex: Stat Date- 3/12, End Date - 7/12 then i need to create 5 records on object B. with Date field populated.

  • April 13, 2012
  • Like
  • 0

caused by: System.QueryException: unexpected token: '('


 

Public MD_Sales_Group_Initials__c getMSGI(List<ID> SalesRepName){
   
   String MSGIQuery = '';
   
   List<MD_Sales_Group_Initials__c> lstMSGI = New List<MD_Sales_Group_Initials__c> ();
   MD_Sales_Group_Initials__c MSGI = New MD_Sales_Group_Initials__c ();
   
   MSGIQuery = 'Select id,Name,Code__c From MD_Sales_Group_Initials__c Where ID In (' + SalesRepName + ')';

            
            
            List<sObject> Qmsgi = Database.Query(MSGIQuery);

            if(Qmsgi != null && Qmsgi.size()>0){
                for(sObject s: Qmsgi){
                    lstMSGI.add((MD_Sales_Group_Initials__c)s);
                }
            }
   
           if(lstMSGI != null && lstMSGI.size() > 0){ MSGI = lstMSGI[0]; }
   
   Return MSGI;
   }

 MSGIQuery = 'Select id,Name,Code__c From MD_Sales_Group_Initials__c Where ID In (' + SalesRepName + ')';

 

Thank you.

I am using Apex REST to call Amazon S3.  I am trying to get the list of the content of a specific folder in a bucket.  The GET request returns all the content of the bucket but I would like to get just the content of a specific bucket.  I think I need to pass a Delimiter and/or a Prefix but not sure how to do this.  I tried this below but doesn't seem to have any effect.
     
       req.setHeader('Prefix','VHUB/INBOX/') ;       
       req.setHeader('Delimiter','/');                        
 
public AWS_Keys__c awsKeySet;
public String bucketname1 = BUCKETNAME; 
public String key1=KEY;
public String secret1=SECRET;
          
// public void readGetFromVirtualS3(){   
         //this is needed for the PUT operation and the generation of the signature.  I use my local time zone.        
        String formattedDateString1 = Datetime.now().format('EEE, dd MMM yyyy HH:mm:ss z','America/Los_Angeles');   
        
        String method1 = 'GET';
        HttpRequest req = new HttpRequest();
        Http http = new Http();
        String filename1 =''; //'500/' ; 
        //String filename = 'VHUB/INBOX/' ;

        req.setEndpoint('https://'+ bucketname1 +'.s3.amazonaws.com' +'/'+ filename1);   
     /********   req.setHeader('Prefix','VHUB/INBOX/') ;		********/
   /********	req.setHeader('Content-Type', ''); 			
  	 		req.setHeader('Delimiter','/');				********/

        req.setMethod(method1);
        req.setHeader('Date', formattedDateString1);
        req.setHeader('Authorization',createAuthHeader(method1,filename1,formattedDateString1,bucketname1,key1,secret1));
         //Execute web service call
            try {
                HTTPResponse res = http.send(req);
                System.debug('MYDEBUG: ' + ' RESPONSE STRING: ' + res.toString());
                System.debug('MYDEBUG: ' + ' RESPONSE STATUS: '+ res.getStatus());
                System.debug('MYDEBUG: ' + ' STATUS_CODE:'+ res.getStatusCode());
                System.debug('MYDEBUG: ' + ' GET_BODY:'+ res.getBody());
                XmlStreamReader reader = res.getXmlStreamReader();
                System.debug(reader.getLocalName());
                
            } catch(System.CalloutException e) {
                system.debug('MYDEBUG: AWS Service Callout Exception on ' + 'ERROR: ' + e.getMessage());
            }
 //   }

  	 //create authorization header for Amazon S3 REST API
    public string createAuthHeader(String method,String filename,String formattedDateString,String bucket,String key,String secret){
        string auth;
        String stringToSign = method+'\n\n\n'+formattedDateString+'\n/'+bucket +'/'+filename;
        Blob mac = Crypto.generateMac('HMACSHA1', blob.valueof(stringToSign),blob.valueof(secret));
        String sig = EncodingUtil.base64Encode(mac);
        auth = 'AWS' + ' ' + key + ':' + sig;
        return auth;
    }

The code returns all the folders and files in the bucket but I need to pass a parameter to only return the content of one folder.


 

I am urgently looking for an experience developer for a short term project to assist with the development of a salesforce1 mobile app.  Candidate should be strong in javascript, html, apex and visualforce.  The app will be primarily a mobile app based on data in standard or custom objects in salesfoce.  Candidate will work remotely but MUST be able to meet the deadline.

Project duration: 4-6weeks with potential for extension.

Please contact
hakpala@vidaconsultingllc.com
Regards
-Henry Akpala

Please I am trying to figure out how to create a VFP that shows the "Action" (Checkbox) field that is normally visible on a list page.

 

 

I have an issue with the v25.0 .  I am trying to test one of the new functionality that was release in v25.0. " KbManagement.PublishingService.publishArticle(KnowledgeArticleId, true)"

This is suppose to allow you programmatically publish an  KnowledgeArticle that is in draft status.  I wrote a simple class to test this functionality and it worked fine but I have about 120000 records to process to I figure I write a batchable class(seen below). 

 

// 

// (c) 2012 Appirio, Inc.

//

// Description: This class implements the batchable interface and is used to publish  KnowledgeArticles in draft Status  

//               

//

global with sharing class  PublishKnowledgeArticlesBatchClass implements Database.Batchable <sObject>{

 

  global Database.QueryLocator start(Database.BatchableContext BC){

    //String should be modifed depending on the number of records that the Publish Service can support

      String query = 'SELECT Title, Id, KnowledgeArticleId, PublishStatus, VersionNumber '

              + ' FROM KnowledgeArticleVersion ' 

                  +  ' WHERE PublishStatus =\'Draft\' '

                    + '  AND language =\'en_US\' AND LastModifiedDate =TODAY LIMIT 5';                    

        return Database.getQueryLocator(query);

      

    }

 

    global void execute(Database.BatchableContext BC, List<KnowledgeArticleVersion> scope){

       //Call the PublishService with the id of each KnowledgeArticleId

        for(KnowledgeArticleVersion s : scope){

            KbManagement.PublishingService.publishArticle(s.KnowledgeArticleId, true);

        }      

       

    }

 

    global void finish(Database.BatchableContext BC){

  

    }

}

 

However when i run the batch process, this is the response I get in the log.  

 

25.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO

09:50:00.144 (144586000)|EXECUTION_STARTED

09:50:00.144(144629000)|CODE_UNIT_STARTED[EXTERNAL]|01pQ00000001y9b|PublishKnowledgeArticlesBatchClass

09:50:00.164 (164988000)|FATAL_ERROR|Internal Salesforce.com Error

09:50:00.096 (165018000)|CUMULATIVE_LIMIT_USAGE

09:50:00.096|CUMULATIVE_LIMIT_USAGE_END

09:50:00.169 (169593000)|CODE_UNIT_FINISHED|PublishKnowledgeArticlesBatchClass

09:50:00.169 (169604000)|EXECUTION_FINISHED

 

Please any assistance will be greatly appreciated.

Regards

-H

I am testing a service with for a project and did the normal setup for the http by registering the url and all that is fine.  But I get a timeout error each time from salesforce...

Http http = new Http();

HttpRequest req = new HttpRequest();

req.setHeader('content-length''120000') ;

req.setTimeout(120000); 

req.setEndpoint('http://jdrf.synegen.com/JDRF/webresources/delete/'+EncodingUtil.urlEncode(strContact, 'UTF-8'));

 

//this is the actual message after decoding

//req.setEndpoint('http://jdrf.synegen.com/JDRF/webresources/delete/%5B%7B%22sfdc%22%3A%22003J0000005NDcsIAG%22%7D%5D');

 

req.setMethod('POST');

HttpResponse res;

System.debug('response:'+ res);

the response that i get is callout timeout

 

System.CalloutException: Read timed out

 



Not sure why i can't get through to the url from salesforce.  I am using a sandbox org. 

I tried the same url from a browser and I get a response back...
"Members were deleted."
Any input will be greatly appreciated

Hi All,

I am trying to write a test class for apex Rest class like the one below.  However I am having problem creating the test class because I don't see any documentation on how to create a variable for "RestRequest" object.  How do you create a values that can be passed to "RestRequest req"?

I tried creating a string of JSON message and passed it to the class but it didn't work.

 

//@HttpGet

global static String doGet (RestRequest req, RestResponse res){

 

 

//generate SOQL from request message dynamically 

String strQueryString =  req.requestURI.substring(req.requestURI.lastIndexOf('/')+1) + ': '

if (strQueryString.contains('doGet')){

strQueryString += '   '+ 'doGet1   ';

}

else if (strQueryString.contains('query')){

strQueryString += '   '+ 'query1   ';

}

for (String key : req.params.keySet()) {

strQueryString += '[ ] '+ key+ ' '+ req.params.get(key); 

}

 return strQueryString;

}

 

Any help will be greatly appreciated.

Regards

HenryAG

I am using Apex REST to call Amazon S3.  I am trying to get the list of the content of a specific folder in a bucket.  The GET request returns all the content of the bucket but I would like to get just the content of a specific bucket.  I think I need to pass a Delimiter and/or a Prefix but not sure how to do this.  I tried this below but doesn't seem to have any effect.
     
       req.setHeader('Prefix','VHUB/INBOX/') ;       
       req.setHeader('Delimiter','/');                        
 
public AWS_Keys__c awsKeySet;
public String bucketname1 = BUCKETNAME; 
public String key1=KEY;
public String secret1=SECRET;
          
// public void readGetFromVirtualS3(){   
         //this is needed for the PUT operation and the generation of the signature.  I use my local time zone.        
        String formattedDateString1 = Datetime.now().format('EEE, dd MMM yyyy HH:mm:ss z','America/Los_Angeles');   
        
        String method1 = 'GET';
        HttpRequest req = new HttpRequest();
        Http http = new Http();
        String filename1 =''; //'500/' ; 
        //String filename = 'VHUB/INBOX/' ;

        req.setEndpoint('https://'+ bucketname1 +'.s3.amazonaws.com' +'/'+ filename1);   
     /********   req.setHeader('Prefix','VHUB/INBOX/') ;		********/
   /********	req.setHeader('Content-Type', ''); 			
  	 		req.setHeader('Delimiter','/');				********/

        req.setMethod(method1);
        req.setHeader('Date', formattedDateString1);
        req.setHeader('Authorization',createAuthHeader(method1,filename1,formattedDateString1,bucketname1,key1,secret1));
         //Execute web service call
            try {
                HTTPResponse res = http.send(req);
                System.debug('MYDEBUG: ' + ' RESPONSE STRING: ' + res.toString());
                System.debug('MYDEBUG: ' + ' RESPONSE STATUS: '+ res.getStatus());
                System.debug('MYDEBUG: ' + ' STATUS_CODE:'+ res.getStatusCode());
                System.debug('MYDEBUG: ' + ' GET_BODY:'+ res.getBody());
                XmlStreamReader reader = res.getXmlStreamReader();
                System.debug(reader.getLocalName());
                
            } catch(System.CalloutException e) {
                system.debug('MYDEBUG: AWS Service Callout Exception on ' + 'ERROR: ' + e.getMessage());
            }
 //   }

  	 //create authorization header for Amazon S3 REST API
    public string createAuthHeader(String method,String filename,String formattedDateString,String bucket,String key,String secret){
        string auth;
        String stringToSign = method+'\n\n\n'+formattedDateString+'\n/'+bucket +'/'+filename;
        Blob mac = Crypto.generateMac('HMACSHA1', blob.valueof(stringToSign),blob.valueof(secret));
        String sig = EncodingUtil.base64Encode(mac);
        auth = 'AWS' + ' ' + key + ':' + sig;
        return auth;
    }

The code returns all the folders and files in the bucket but I need to pass a parameter to only return the content of one folder.


 

I am urgently looking for an experience developer for a short term project to assist with the development of a salesforce1 mobile app.  Candidate should be strong in javascript, html, apex and visualforce.  The app will be primarily a mobile app based on data in standard or custom objects in salesfoce.  Candidate will work remotely but MUST be able to meet the deadline.

Project duration: 4-6weeks with potential for extension.

Please contact
hakpala@vidaconsultingllc.com
Regards
-Henry Akpala
I am using Apex REST to call Amazon S3.  I am trying to get the list of the content of a specific folder in a bucket.  The GET request returns all the content of the bucket but I would like to get just the content of a specific bucket.  I think I need to pass a Delimiter and/or a Prefix but not sure how to do this.  I tried this below but doesn't seem to have any effect.
     
       req.setHeader('Prefix','VHUB/INBOX/') ;       
       req.setHeader('Delimiter','/');                        
 
public AWS_Keys__c awsKeySet;
public String bucketname1 = BUCKETNAME; 
public String key1=KEY;
public String secret1=SECRET;
          
// public void readGetFromVirtualS3(){   
         //this is needed for the PUT operation and the generation of the signature.  I use my local time zone.        
        String formattedDateString1 = Datetime.now().format('EEE, dd MMM yyyy HH:mm:ss z','America/Los_Angeles');   
        
        String method1 = 'GET';
        HttpRequest req = new HttpRequest();
        Http http = new Http();
        String filename1 =''; //'500/' ; 
        //String filename = 'VHUB/INBOX/' ;

        req.setEndpoint('https://'+ bucketname1 +'.s3.amazonaws.com' +'/'+ filename1);   
     /********   req.setHeader('Prefix','VHUB/INBOX/') ;		********/
   /********	req.setHeader('Content-Type', ''); 			
  	 		req.setHeader('Delimiter','/');				********/

        req.setMethod(method1);
        req.setHeader('Date', formattedDateString1);
        req.setHeader('Authorization',createAuthHeader(method1,filename1,formattedDateString1,bucketname1,key1,secret1));
         //Execute web service call
            try {
                HTTPResponse res = http.send(req);
                System.debug('MYDEBUG: ' + ' RESPONSE STRING: ' + res.toString());
                System.debug('MYDEBUG: ' + ' RESPONSE STATUS: '+ res.getStatus());
                System.debug('MYDEBUG: ' + ' STATUS_CODE:'+ res.getStatusCode());
                System.debug('MYDEBUG: ' + ' GET_BODY:'+ res.getBody());
                XmlStreamReader reader = res.getXmlStreamReader();
                System.debug(reader.getLocalName());
                
            } catch(System.CalloutException e) {
                system.debug('MYDEBUG: AWS Service Callout Exception on ' + 'ERROR: ' + e.getMessage());
            }
 //   }

  	 //create authorization header for Amazon S3 REST API
    public string createAuthHeader(String method,String filename,String formattedDateString,String bucket,String key,String secret){
        string auth;
        String stringToSign = method+'\n\n\n'+formattedDateString+'\n/'+bucket +'/'+filename;
        Blob mac = Crypto.generateMac('HMACSHA1', blob.valueof(stringToSign),blob.valueof(secret));
        String sig = EncodingUtil.base64Encode(mac);
        auth = 'AWS' + ' ' + key + ':' + sig;
        return auth;
    }

The code returns all the folders and files in the bucket but I need to pass a parameter to only return the content of one folder.


 

I am urgently looking for an experience developer for a short term project to assist with the development of a salesforce1 mobile app.  Candidate should be strong in javascript, html, apex and visualforce.  The app will be primarily a mobile app based on data in standard or custom objects in salesfoce.  Candidate will work remotely but MUST be able to meet the deadline.

Project duration: 4-6weeks with potential for extension.

Please contact
hakpala@vidaconsultingllc.com
Regards
-Henry Akpala
Hello.

I'm trying to understand what happened with daily email limit on Developer Edition. About a year ago our team worked on the specific feature which generates hundreds of emails and sends them to internal SF users using SingleEmailMessage and its setTargetObjectId method. I remember that everything worked perfectly on Developer Edition, Sandbox and PRD (we even were able to send some thousands of emails without any problems and limits).

As of now, we're working on another feature which should generate and send many emails too. But we found that SF can't send hundreds of emails now on our Developer Edition.

I've tried to analyze the problem, but didn't find the reason:
- there are no any exceptions in logs;
- when I look at a log it says: "EMAIL_QUEUE" (email is queued);
- I even tried to reserve email capacity using the code like this Messaging.reserveSingleEmailCapacity(numberOfEmails);, but didn't get any exceptions (limit is still free).
Everything works correctly, but emails are not sent to SF users.

So, my questions:
1) is there a specific limit for emails on Developer Edition? If it's true, then what is the daily limit?
2) did I miss something in the SF documentation? I considered this description:
If you use SingleEmailMessage to email your organization’s internal users, specifying the user’s ID in setTargetObjectId means the email doesn’t count toward the daily limit. However, specifying internal users’ email addresseses in setToAddresses means the email does count toward the limit.


I'm providing a test code for those who want to check it on his Developer Edition:
//1) generate and send emails
List<Messaging.SingleEmailMessage> messages = new List<Messaging.SingleEmailMessage>();
final Integer NUMBER_OF_EMAILS = 300;
for (Integer index = 0; index < NUMBER_OF_EMAILS; index++)
{
    Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
    email.setTargetObjectId(UserInfo.getUserId());
    email.setSubject('Test : ' + index);
    email.setPlainTextBody('test');
    email.saveAsActivity = false;
    messages.add(email);
}
Messaging.SendEmailResult[] results = Messaging.sendEmail(messages, false);

//2) print the results
for (Messaging.SendEmailResult result : results)
{
    System.debug(result);
}
Hi,

How to Query all the fields in your Salesforce Object using Enterprise WSDL?

I need to retrieve all fields in Account object using Query operation\method in enterprise wsdl.I tired the query "select * from Account",this query with "select *" is not working.it throws error Saying "malformed query and unexpected *" in query.

Please let me know what should be the query to seelct all fields from salesforce account object for enterprise wsdl.

also pl help me in understanding what is the difference between Query and QueryAll method in enterprise wsdl?

Thanks in Advance!!
We have used outbound messaging to a standard server no problem. We are now trying to message from SF using Outbound Messaging ang getting the infamous 

javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

We are using ssl, 8443 and have a public CA SSL cert for the Websphere side.

We are rally hitting the brick wall on this one....anyone have some RECENT solutions to this...especially with Websphere?

Thanks
Hello,

I have the following code in an Apex Batch Apex Class.

try{
            return Database.getQueryLocator(query);
        }catch(Exception ex){
            return null;
        }

However I cannot seem to catch an exception if an invalid query is provided. I receive the following error
System.UnexpectedException: Start did not return a valid iterable object..

If I try to catch the System.UnexpectedException I still receive an error.

Should a try/catch not work in this scenario?

Thanks in advance for any help.

Our company is just beginning implementation of SFDC, and will need a consultant to come into our Los Angeles office to help with initial setup for a couple of days. We are in the west Los Angeles Area near LAX Airport. (Hawthorne/90250). Initially, we will need help with setup of custom fields, as well as importing customer and Item data. Longer term, we'll need to make sure salesforce1 is setup and operating correctly.  Please contact me James at  jkiehle@fulham.com if interested & available.  Consultant needed ASAP, please reply with qualifications and rates.

We are a startup in the process of deploying Salesforce and need a developer to customize a few things. It will be contract work for now, but as we grow, there may be an opportunity to come on board full time. Please e-mail billy@opentrade.net and let's chat. Need this ASAP.

Please I am trying to figure out how to create a VFP that shows the "Action" (Checkbox) field that is normally visible on a list page.

 

 

Hi,

 

I want to get the WSDL files from salesforce. I have username, password and security token. I can download them by logging into salesforce. But I want to get them by provideing URL, Username, Password, Security token.

Is there a way to do this?

 

Thanks,

Vinay Kumar.

I am getting error : System.LimitException: DML currently not allowed 

 

Class.heatclass.getStore: line 9, column 1

 

my code is:

public String getStore() {
for(integer ac=0;ac<mapstr.size();ac++)
{
try{

auditcount__c e=new auditcount__c(Name='hello',count__c=5);
insert e;
}
catch(System.DMLException ex)
{
ApexPages.addMessages(ex);
}
}
return null;
}

 

Any of you guys are aware of the plans of Salesforce to launch an updated version of Eclipse plugin or the Force.com IDE bundle for version 26.0 - Winter'13?