• Vishnu Vaishnav
  • SMARTIE
  • 756 Points
  • Member since 2014
  • Salesforce Developer


  • Chatter
    Feed
  • 11
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 88
    Replies
Dear All,

   I am running the test class to see the code coverage i am getting "Unable to Process Request Concurrent requests limit exceeded"

please healp me to solve this problem.

thanks,
zabi.
I need full of code fot it or any step by step process link ?

Thanks 
I got this error when i use salesforce connect offline 2.0.
Hi,
I'm getting the below when i'm trying to update the record
System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []

Thanks in Advance

AT__c OOFRec =  new AT__c();
    public KB__c getOOFRec (){    
        List<AT__c> oofList = [select id, Details__c, Hide_Comments__c from KB__c where Context__c = 'IT Page' AND Title__c = 'Message2' limit 1];
        KB__c SupportOOF = new KB__c();
        if(oofList.size() > 0){ SupportOOF = oofList.get(0);
                   system.debug('tech supportOOF------'+techSupportOOF);}
        }
        return techSupportOOF;       
    }
    public void saveOOFRecord(){
            system.debug('tech supportOOF------'+OOFRecord);
            update OOFRecord;
    }
Hi All,

How to merge the Html td's dynamically based on the if condition in vf page .

Can anyone help me from this.

Thanks,
Sarvesh.

I am trying to execute callouts from my Triggers.

Ealier it was working fine.
Today I am seeing Callout in "Apex Job" as only Queued. Its not getting executed.

Can you please help me ?

Hi Experts,
Public void SendOrderEmail(){

        String Uname, ToAddress;
        String AccFirstName, AccLastName, ContFirstName, ContLastName; /* Added for UpperCase */        
        if(ConId==null && AId!=null){
            List<Account> acc = [SELECT First_Name__c, Last_Name__c, Email_Address__c  FROM Account WHERE Id = :AId limit 1];
            /* Added for UpperCase *******************************************Start*/
            AccFirstName = acc[0].First_Name__c;
            AccFirstName = AccFirstName.substring(0,1).toUpperCase() + AccFirstName.substring(1).toLowerCase();
            AccLastName = acc[0].Last_Name__c;
            AccLastName = AccLastName.substring(0,1).toUpperCase() + AccLastName.substring(1).toLowerCase();
            Uname = AccFirstName+' '+AccLastName;
            /* Added for UpperCase ********************************************End*/
           // Uname = acc[0].First_Name__c+' '+acc[0].Last_Name__c;
            ToAddress = acc[0].Email_Address__c; 
        }else{
          //  List<Contact> con = [SELECT Name, Email_Address__c  FROM Contact WHERE Id = :ConId limit 1];
          //  Uname = con[0].Name;
            /* Added for UpperCase *******************************************Start*/
            List<Contact> con = [SELECT FirstName, LastName, Email_Address__c  FROM Contact WHERE Id = :ConId limit 1];
            ContFirstName = con[0].FirstName;
            ContFirstName = ContFirstName.substring(0,1).toUpperCase() + ContFirstName.substring(1).toLowerCase();
            ContLastName = con[0].LastName;
            ContLastName = ContLastName.substring(0,1).toUpperCase() + ContLastName.substring(1).toLowerCase();
            Uname = ContFirstName+' '+ContLastName;
            /* Added for UpperCase ********************************************End*/
            ToAddress = con[0].Email_Address__c; 
        }
        
        String OrderAmt = String.valueOf(odr.TotalAmount);
        
        String EmailContent = '<table style="background: #E32237;color:#fff;">';
        EmailContent += '<tr><td colspan=2 style="padding-bottom:10px;font-weight:bold;">Cher '+Uname+',</td></tr>';
        EmailContent += '<tr><td colspan=2 style="padding-bottom:5px;">'+Label.Order_Summary_Page_Success_Message+'</td></tr>';
        EmailContent += '<tr><td style="font-weight:bold;">'+Label.Order_Summary_Order_Number+'</td><td>'+odr.OrderNumber+'</td></tr>';
      //  EmailContent += '<tr><td style="font-weight:bold;">'+Label.Order_Summary_Seasonal_Offers+'</td><td>'+odr.Seasonal_Offers__c+'</td></tr>';
      //  EmailContent += '<tr><td style="font-weight:bold;">'+Label.Order_Summary_Permanent_Offers+'</td><td>'+odr.Permanent_Offers__c+'</td></tr>';
        EmailContent += '<tr><td style="font-weight:bold;">'+Label.Order_Summary_Order_Amount+'</td><td>'+OrderAmt.replace('.',',')+'€</td></tr>';
        EmailContent += '<tr><td style="font-weight:bold;width: 35%;">'+Label.Order_Summary_Status+'</td><td style="width: 65%;">Commande reçue</td></tr>';
        EmailContent += '<tr><td colspan=2 style="padding:10px 0 3px;font-weight:bold;">'+Label.Order_Summary_Page_Order_Products+'</td></tr>';
        EmailContent += '<tr><td colspan=2 style="padding-bottom:10px;"><table style="color:#fff;border-collapse: collapse;border-spacing: 2px;" border=0>';
        EmailContent += '<tr style="font-weight:bold;background:#B50E20;"><td style="padding:5px">'+Label.Order_Summary_Page_Product+'</td><td style="padding:5px">'+Label.Order_Summary_Page_Product_Code+'</td><td style="padding:5px">'+Label.Order_Summary_Page_Quantity+'</td><td style="padding:5px">'+Label.Order_Summary_Page_Unit_Price+' (€)</td><td style="padding:5px">'+Label.Order_Summary_Page_Total_Price+' (€)</td></tr>';                
        for(OrderItemWrapperClass oi : OrderItemWrapperList){
            String Qty = String.valueOf(oi.Qty);
            String Prce = String.valueOf(oi.Prce);
            String Ttl = String.valueOf(oi.Ttl);
            EmailContent += '<tr style="color:#000;font-size:13px;background:#fff"><td style="padding:5px">'+oi.Prod+'</td><td style="padding:5px">'+oi.PCode+'</td><td style="padding:5px;text-align:right;">'+Qty.replace('.',',')+'</td><td style="padding:5px;text-align:right;">'+Prce.replace('.',',')+'</td><td style="padding:5px;text-align:right;">'+Ttl.replace('.',',')+'</td></tr>';                
       
        }
        String freeSeasonalProduct = String.valueOf(odr.Seasonal_Free_Product__c);
        String freePermanentProduct = String.valueOf(odr.Permanent_Free_Product__c);
        String freeSeasonalQuantity = String.valueOf(odr.Seasonal_Offers__c);
        String freePermanentQuantity = String.valueOf(odr.Permanent_Offers__c);
        
        if((freeSeasonalQuantity != null && Integer.valueOf(freeSeasonalQuantity) != 0) || (freePermanentQuantity != null && Integer.valueOf(freePermanentQuantity) !=0)){
            EmailContent += '</table><tr><td colspan=2 style="padding:10px 0 3px;font-weight:bold;">'+Label.Order_Summary_Page_Free_Products+'</td></tr>';
            EmailContent += '<tr><td colspan=2 style="padding-bottom:10px;"><table style="color:#fff;border-collapse: collapse;border-spacing: 2px;" border=0>';
            EmailContent += '<tr style="font-weight:bold;background:#B50E20;"><td style="padding:5px">'+Label.Order_Summary_Page_Product+'</td><td style="padding:5px">'+Label.Order_Summary_Page_Product_Category+'</td><td style="padding:5px">'+Label.Order_Summary_Page_Quantity+'</td></tr>';                                 
            
            if(freeSeasonalQuantity != null && Integer.valueOf(freeSeasonalQuantity) != 0){
            EmailContent += '<tr style="color:#000;font-size:13px;background:#fff"><td style="padding:5px">'+freeSeasonalProduct.replace('.',',')+'</td><td style="padding:5px">'+Label.Order_Summary_Seasonal_Offers+'</td><td style="padding:5px;text-align:left;">'+freeSeasonalQuantity.replace('.',',')+'</td></tr>';                
            }
            if(freePermanentQuantity != null && Integer.valueOf(freePermanentQuantity) !=0){
            EmailContent += '<tr style="color:#000;font-size:13px;background:#fff"><td style="padding:5px">'+freePermanentProduct.replace('.',',')+'</td><td style="padding:5px">'+Label.Order_Summary_Permanent_Offers+'</td><td style="padding:5px;text-align:left;">'+freePermanentQuantity.replace('.',',')+'</td></tr>';                
            }
        }      
        EmailContent += '</table><tr><td colspan=2 style="padding-bottom:10px;"><a style="color:#fff;" href="'+Label.Order_Page_Domain_Name+'/OrderCreation?id='+AId+'&cid='+ConId+'">'+Label.Order_Summary_Page_Click_Here+'</a> '+Label.Order_Summary_Page_Clickhere_Message+'</td></tr>';
        EmailContent += '<tr><td colspan=2 style="font-weight:bold;">'+Label.Order_Summary_Page_Thanks+',<br/>'+Label.Order_Summary_Page_Mars_Chocolate+' </td></tr>';
        
        EmailContent += '</table>';    
        
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
        email.setToAddresses(new String[] { ToAddress });
        email.setSubject(Label.Order_Summary_Subject); 
        email.setHTMLBody(EmailContent);
        
        Messaging.sendEmail(new Messaging.Email[] { email });
                
    }
In the output, I am getting an email in which I am unable to change the email displayed in From field.

For example:
From: Order Summary Site Guest User to you <xyz@gmail.com>
Date: Wed, Jan 28,2015 at 5.24 PM
Subject: Sandbox: Order Summary
Using setSenderDisplayName, setReplyTo, I am able to change "Order Summary Site Guest User to you" part, not "xyz@gmail.com". Is there any way to change the email address appearing by default.
 
Hi,

I have some customers that work in the same bussines category: insurance. I have a org (Professional edition) and I want to clone it many times because I don't want rewrite every time the changes.

What is the best way to solve this?
Hi,

So I'm creating a VF page. There is a coustom object called XYZ. Its has a picklist Field abc. I want to display abc as picklist value on my page. What will the code be in the class. Please help.
I am trying to add a Class to a Input Field in Visual Force but when the page is rendered it removes the styleClass Attribute. This inputField is a dependant Picklist.

Below is my VF Code
<apex:inputField value="{!configTaskToUpdate.Config_Category__c}" styleClass="form-control" id="thecategory"/>

i have tried adding the the code to a div tag around it but it comes out akward

I have also tried adding it to the the field by jQuery as below but that doesnt work either
$(document).ready(function() {
                    $(function() {
                        $("#{!$Component.theform.thecategory}").addClass("form-control");
                        console.log('added the form-control class');
                    });
                });

Anyone have this issue and or found a workaround or is SF working on it?
Hi, I am trying to write a trigger to call a btach class if a check box is true, otherwise call the future class. but IDK what is wrong with my code I can't save it. please advise. here is my code:

trigger ProjectSettings_ChartsTrigger on Project_Setting__c (After Insert,After Update){
    
    List<id> ProjectIds = new list<id>();
    List<Project_Setting__c > prj = [select Id, total_check__c from Project_Setting__c where Id In : ProjectIds];
    for(Project_Setting__c PS : Trigger.new){
    if (Project_Setting__c.total_check__c = true) {
      ProjectIds.add(PS.id);   
    }
    ProjectSettings_ChartsBatchClass pro = new ProjectSettings_ChartsBatchClass(); 
              database.executebatch(pro,2000);
} if (Project_Setting__c.total_check__c = false){
     projectSettingsChartClass.ProjectMethods(ProjectIds);
    }
    

Thanks
I'm trying to create a custom button that pre-populates an Opportunity with certain values.  I'd like to have the button go straight to the new opportunity screen, and bypass the Record Type selection screen.

I've poured through quite a few posts, and the advice is always add"&RecordType=RecordType.Id", but I already have that in the URL, and it doesn't seem to help.

URL I'm using:
/setup/ui/recordtypeselect.jsp?
ent=Opportunity
&RecordType=012A0000000r2ROIAY
&retURL=%2F{!Contact.Id}
&save_new_url=%2F006%2Fe%3Flookupcmpgn%3D1%26retURL%3D%252F{!Contact.Id}%26accid%3D{!Account.Id}%26conid%3D{!Contact.Id}
(...)

Where am I going wrong?

 

trigger posJobAppUpdate2 on Position__c(before update, before insert) {     
  if(className.firstTimeFlag == true) {     List<Job_Application__c> jobAppList = new List<Job_Application__c>();  
  if(Trigger.isUpdate)        jobAppList = [SELECT Id, position__c, status__c, stage__c FROM      Job_Application__c WHERE position__c IN :trigger.newMap.keySet()];     for(Position__c posRec : Trigger.new) {     
if(trigger.isUpdate) {     
    Position__c  oldPosRec = system.trigger.oldMap.get(posRec.Id);   
      if(oldPosRec.status__c == 'Open' && posRec.status__c == 'Closed') {         
    if(jobAppList != NULL && !jobAppList.isEmpty()) {            
     for(Job_Application__c jobApp: jobAppList) {              
       if(jobApp.position__c == posRec.Id) {                         jobApp.Status__c = 'Closed';                         jobApp.stage__c = 'Closed – Position Closed';            
         }       
             }
      
      }      
   }    
   }
}   
   system.debug('jobAppRecList after for loop--->' + jobAppList);     update jobAppList;          className.firstTimeFlag= false;     }      }
 
User-added image
In the above image i would like to add 3rd, 4th and so on upto 10 option on click of add option and implement reove link to remove perticular option(textarea) and if question type is descriptive i would like to hide all options
In my website I am querying more than 10 images from Attachments to show it in the page. Among these images, only one will be the main image and all others will be thumbnails. What I am doing right now is after querying the attachments, I have given specific size to the thumbnail and main image. This query generates more than 85% data of the site. Is there any way I can minimize the image size(by using code) or can I do anty modifications on the query so that I could reduce the site data. All suggestions are welcome.
hi All,
 I am working on test class every day, but by end of the day, i need to prepare xls sheet, like which class pass or failed, if pass what is code coverage like that,  so is there ant tool or easy methodalogy to get all class list with their code coverage and lines of covered .
please let me know if know any one, it's greate help to me.

Thanks. 
 

I'm using several hierarchy type custom settings in an application.  When upload the package in as UNMANAGED, all is fine.  However, when I try to install the package, I get an error.  I tried to install the contents of the same package using the Force.com IDE, it errors out.  I am able to trace the errors to references to the custom settings in the formulas.  These references show the namespace prefix from the source package.  I would presume once I convert this to a managed package, I will not get these errors.  However, I also need to install it an unmanaged.

Does anyone know how to remove references to the namespace prefixes for custom settings in a formula?  I have tried to edit the formula directly from the Force.com IDE.  When I save, the namespaces are automatically put back in.  I am beginning to believe that I will have to remove ALL the formulas and apply the changes manually.