• shankar anand
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 6
    Replies
I'm trying to use the following in my controller class in the developer edition. It throws a compilation error saying "Method doesn't exist or incorrect signature"

Map<String, Schema.SObjectType> globalObjMap = Schema.getGlobalDescribe();

I've seen the descibe call being used in many examples on the web and even in the salesforce documentation. How come it's throwing an error for me. Kindly help.
Hi,

I was following the latest Data Loader Guide (https://help.salesforce.com/help/pdfs/en/salesforce_data_loader.pdf) and tried to run the Apex Data Loader from the command line in Windows. 

I'm getting the following exceptions on executing the final command: process.bat "C:\DLTest\Command Line\Config" accountInsert
java.net.UnknownHostException: login.salesforce.com
 com.sforce.ws.ConnectionException: Failed to send request to https://login.salesforce.com/services/Soap/u/30.0

After searching in google I found explanations related to proxy settings which I didn't understand. Kindly help me resolve this.
 
I'm learning Apex programming. WHile going through the guides I found this code. I'm confused that 'account' being a Final variable, how come it was successfully used in the update statement in the save() method?

public class MyCustomController {

    private final Account account;

    public MyCustomController() {
        account = [SELECT Id, Name, Site FROM Account 
                   WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    }

    public Account getAccount() {
        return account;
    }

    public PageReference save() {
        update account;
        return (new ApexPages.StandardController(account)).view();
    }
}
Hi,

I wanted to hide the standard 'Name' column from the related list of parent object. But after doing so I cannot navigate to the child detail page from the related list as the 'Name' field contains the link for navigation and when it's hidden, navigation is also gone.
Can we put the link on another column or any other workaround? Kindly help
Hi,

I have a simple requirement. I'm loading data into some of my objects in salesforce from an external system. I want to send an email when the bulk insert gets completed on the last of these objects. The email should contain the following information:

1. A guarantee that the insert is complete and no more records are remaining to be inserted.
2. The count of records that were inserted type wise. e.g count of Type A records inserted, count of Type B records inserted, etc

The information available with me is following:

1. The start time of the insert job at external system.e.g Type A records are inserted at one particular day and time, Type B records are inserted at another time on same day.
2. Full access to the salesforce object on which data is being inserted.

What is the most elegant and scalable solution for this requirement? Please help me figure this out.
Hi,

I have a simple requirement. I'm loading data into one of my objects in salesforce from an external system. I want to send an email when the bulk insert gets completed. The email should contain the following information:

1. A guarantee that the insert is complete and no more records are remaining to be inserted.
2. The count of records that were inserted type wise. e.g count of Type A records inserted, count of Type B records inserted, etc

The information available with me is following:

1. The start time of the insert job at external system.
2. Full access to the salesforce object on which data is being inserted.

What is the most elegant and scalable solution for this requirement? Please help me figure this out. 
I'm using Database.update method in my batch class. When I run the batch job I intentionally make some error to occur to see how my code handles it. The job completes successfully but the 'finish' method from my batch class is not invoked. Why is this?I'm trying to copy an inactive Account Owner to the Contact Owner field which generates an internal Salesforce Error but the job completes successfully as I'm using Database class method instead of DML statement. I'm unable to see the debug statement of my Finish method in the log. Piece of my code

global void execute(Database.BatchableContext context, List<sObject> scope){
...............................some code
List<Contact> contacts = new List<Contact>();
        contacts.addAll(list_contacts);
        updateResult = Database.update(contacts ,false);
 for (Database.SaveResult ir : updateResult ) {  
        //Operation failed, so get all errors                       
          for(Database.Error err : ir.getErrors()){                                
          System.debug('The following error has occurred -------------'+ err.getStatusCode() + ': ' + err.getMessage());
          System.debug('Task fields that affected this error: ' + err.getFields());
           Error = 'Failed Store --'+ '  ' + ir.getId() + '    ' +err.getStatusCode() ;
           updateErrors.add(Error);             
            }
    }
}

 //Finish Method 
    global void finish(Database.BatchableContext context){
    
    List<String> listOfEmails = new List<String>();
    // Get the AsyncApexJob that represents the Batch job using the Id from the BatchableContext  
       AsyncApexJob a = [Select Id, Status, NumberOfErrors, JobItemsProcessed,TotalJobItems, CreatedBy.Email, ExtendedStatus from AsyncApexJob where Id = :context.getJobId()];  
          
System.debug('********Inside Finish***updateErrors.size()-------'+updateErrors.size());            
                // Email the Batch Job's submitter that the Job is finished.  
                if(updateErrors.size()>0){
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();    
                mail.setSubject('Account Sync batch Status: ' + a.Status);  
                String msg = 'The batch Apex job failed to update and Address for'+'   '+updateErrors.size()+ ' '+ 'Contacts' + '  ' + Error;
                mail.setPlainTextBody(msg);  
                List<Email_List__c> receivers = Email_List__c.getall().values();
                for(Email_List__c e:receivers){
                    String s = e.Email_Id__c;
                    listOfEmails.add(s);           
                }
                mail.setToAddresses(listOfEmails);
                Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });      
                }
  
    }

 
I was going through the following code:


<apex:page standardController="Account" recordSetVar="accounts">
<apex:form>
<apex:selectList value="{!filterid}" size="1">
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
<apex:commandButton value="Go" action="{!list}"/>
</apex:form>
</apex:page>

Can someone tell me how I can see the Filter IDs for the Custom Views I create on the List View page? Also is there a way to see the ListViewOptions? Are they also IDs or plain Strings?

 
Hi,

I have a simple requirement. I'm loading data into one of my objects in salesforce from an external system. I want to send an email when the bulk insert gets completed. The email should contain the following information:

1. A guarantee that the insert is complete and no more records are remaining to be inserted.
2. The count of records that were inserted type wise. e.g count of Type A records inserted, count of Type B records inserted, etc

The information available with me is following:

1. The start time of the insert job at external system.
2. Full access to the salesforce object on which data is being inserted.

What is the most elegant and scalable solution for this requirement? Please help me figure this out. 
I'm trying to use the following in my controller class in the developer edition. It throws a compilation error saying "Method doesn't exist or incorrect signature"

Map<String, Schema.SObjectType> globalObjMap = Schema.getGlobalDescribe();

I've seen the descibe call being used in many examples on the web and even in the salesforce documentation. How come it's throwing an error for me. Kindly help.
I'm learning Apex programming. WHile going through the guides I found this code. I'm confused that 'account' being a Final variable, how come it was successfully used in the update statement in the save() method?

public class MyCustomController {

    private final Account account;

    public MyCustomController() {
        account = [SELECT Id, Name, Site FROM Account 
                   WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    }

    public Account getAccount() {
        return account;
    }

    public PageReference save() {
        update account;
        return (new ApexPages.StandardController(account)).view();
    }
}
Hi,

I wanted to hide the standard 'Name' column from the related list of parent object. But after doing so I cannot navigate to the child detail page from the related list as the 'Name' field contains the link for navigation and when it's hidden, navigation is also gone.
Can we put the link on another column or any other workaround? Kindly help
I'm using Database.update method in my batch class. When I run the batch job I intentionally make some error to occur to see how my code handles it. The job completes successfully but the 'finish' method from my batch class is not invoked. Why is this?I'm trying to copy an inactive Account Owner to the Contact Owner field which generates an internal Salesforce Error but the job completes successfully as I'm using Database class method instead of DML statement. I'm unable to see the debug statement of my Finish method in the log. Piece of my code

global void execute(Database.BatchableContext context, List<sObject> scope){
...............................some code
List<Contact> contacts = new List<Contact>();
        contacts.addAll(list_contacts);
        updateResult = Database.update(contacts ,false);
 for (Database.SaveResult ir : updateResult ) {  
        //Operation failed, so get all errors                       
          for(Database.Error err : ir.getErrors()){                                
          System.debug('The following error has occurred -------------'+ err.getStatusCode() + ': ' + err.getMessage());
          System.debug('Task fields that affected this error: ' + err.getFields());
           Error = 'Failed Store --'+ '  ' + ir.getId() + '    ' +err.getStatusCode() ;
           updateErrors.add(Error);             
            }
    }
}

 //Finish Method 
    global void finish(Database.BatchableContext context){
    
    List<String> listOfEmails = new List<String>();
    // Get the AsyncApexJob that represents the Batch job using the Id from the BatchableContext  
       AsyncApexJob a = [Select Id, Status, NumberOfErrors, JobItemsProcessed,TotalJobItems, CreatedBy.Email, ExtendedStatus from AsyncApexJob where Id = :context.getJobId()];  
          
System.debug('********Inside Finish***updateErrors.size()-------'+updateErrors.size());            
                // Email the Batch Job's submitter that the Job is finished.  
                if(updateErrors.size()>0){
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();    
                mail.setSubject('Account Sync batch Status: ' + a.Status);  
                String msg = 'The batch Apex job failed to update and Address for'+'   '+updateErrors.size()+ ' '+ 'Contacts' + '  ' + Error;
                mail.setPlainTextBody(msg);  
                List<Email_List__c> receivers = Email_List__c.getall().values();
                for(Email_List__c e:receivers){
                    String s = e.Email_Id__c;
                    listOfEmails.add(s);           
                }
                mail.setToAddresses(listOfEmails);
                Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });      
                }
  
    }

 
I was going through the following code:


<apex:page standardController="Account" recordSetVar="accounts">
<apex:form>
<apex:selectList value="{!filterid}" size="1">
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
<apex:commandButton value="Go" action="{!list}"/>
</apex:form>
</apex:page>

Can someone tell me how I can see the Filter IDs for the Custom Views I create on the List View page? Also is there a way to see the ListViewOptions? Are they also IDs or plain Strings?