• Adnan
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 11
    Replies

Hi,

 

I have this class and am trying to deploy but getting error "Average test coverage across all Apex Classes and Triggers is 70%, at least 75% test coverage is required".

Below I am pasting my code. Any assistance is helpful

 

 

public class MigrationExtension {

    private final Lead migrationlead;

    public MigrationExtension(ApexPages.StandardController
                                stdController) {
       migrationlead = (Lead)stdController.getRecord();
    }

     public PageReference saveLead() {
       try {
       insert(migrationlead);
       }
       catch(System.DMLException e) {
           ApexPages.addMessages(e);
           return null;
       }
       PageReference p = Page.ThankMigration;
       p.setRedirect(true);
       return p;
     }

  • September 14, 2011
  • Like
  • 0

Hi I have a scontrol and I am trying to map fields from Lead to Custom Object. However, when it comes to Address with special character (#) it is cutting off anything after the # for example (123 Main St # 203). so anything after Main St is blank when mapped.

 

I thinking of using the substitute formula or any advised.

 

Much appreciated.

  • August 16, 2011
  • Like
  • 0

Hi,

 

I have a Force site form which creates lead on submit. I also have a assignment rule, but the issue I am facing is when a leads comes in it is not going through the assignment rule. Instead it is being assigned to the created by user (Guest user License). I have spoken to SF and they also do not have the answer. I would like to know if there is a way to force the class to go through the assignment rule? I am not a coder :(

 

Below is my class. Any assistance is appreciated.

 

 

public class myWeb2LeadExtension {

    private final Lead weblead;
    
    public myWeb2LeadExtension(ApexPages.StandardController stdController) {
       weblead = (Lead)stdController.getRecord();
    }
    
     public PageReference saveLead() {
       try {
       insert(weblead);
       }
       catch(System.DMLException e) {
           ApexPages.addMessages(e);
           return null;
           
           

       }
       PageReference p = Page.Thankweb2lead;
       p.setRedirect(true);
       return p;
     } 
}

 

 

Thanks

Adnan

 

  • March 29, 2011
  • Like
  • 0

Hi,

 

I am trying to make the default picklist value of LeadSource to "WEB". Can I be assisted?

 

Below is the code.

 

<apex:pageBlockSection title="" collapsible="false" columns="1" >
    <br /><br />
    
    


   
         <apex:inputField value="{!Lead.LeadSource}" />  <----picklist value default to "WEB"              
         
         
         
         <apex:inputfield value="{!Lead.Industry}" required="true"/>     
         <apex:inputField value="{!Lead.Title}"/>
         <apex:inputField value="{!Lead.Salutation}"/>
         <apex:inputField value="{!Lead.FirstName}" required="true"/>
         <apex:inputField value="{!Lead.LastName}"/>         
         <apex:inputField value="{!Lead.Company}"/>
         <apex:inputField value="{!Lead.Street}" required="true"/>
         <apex:inputField value="{!Lead.City}" required="true"/>
         <apex:inputField value="{!Lead.State}" required="true"/>
         <apex:inputField value="{!Lead.PostalCode}" required="true"/>
         <apex:inputField value="{!Lead.Email}" required="true"/>
         <apex:inputField value="{!Lead.Phone}" required="true"/> 
            
       <br /><br />
              </apex:pageBlockSection>

 

  • March 17, 2011
  • Like
  • 0

I was wondering if I can get some assistance a validation rule. I have 4 custom picklist consisting of numbers (1-10). I want to create a validation rule where A+ B+C+D must = E. E will already be populated but the 4 picklist fields number must also equal to E.

 

Hope I was clear.

 

Thanks

Adnan

  • June 16, 2010
  • Like
  • 0

Hi,

 

I have this class and am trying to deploy but getting error "Average test coverage across all Apex Classes and Triggers is 70%, at least 75% test coverage is required".

Below I am pasting my code. Any assistance is helpful

 

 

public class MigrationExtension {

    private final Lead migrationlead;

    public MigrationExtension(ApexPages.StandardController
                                stdController) {
       migrationlead = (Lead)stdController.getRecord();
    }

     public PageReference saveLead() {
       try {
       insert(migrationlead);
       }
       catch(System.DMLException e) {
           ApexPages.addMessages(e);
           return null;
       }
       PageReference p = Page.ThankMigration;
       p.setRedirect(true);
       return p;
     }

  • September 14, 2011
  • Like
  • 0

Hi,

 

I have a Force site form which creates lead on submit. I also have a assignment rule, but the issue I am facing is when a leads comes in it is not going through the assignment rule. Instead it is being assigned to the created by user (Guest user License). I have spoken to SF and they also do not have the answer. I would like to know if there is a way to force the class to go through the assignment rule? I am not a coder :(

 

Below is my class. Any assistance is appreciated.

 

 

public class myWeb2LeadExtension {

    private final Lead weblead;
    
    public myWeb2LeadExtension(ApexPages.StandardController stdController) {
       weblead = (Lead)stdController.getRecord();
    }
    
     public PageReference saveLead() {
       try {
       insert(weblead);
       }
       catch(System.DMLException e) {
           ApexPages.addMessages(e);
           return null;
           
           

       }
       PageReference p = Page.Thankweb2lead;
       p.setRedirect(true);
       return p;
     } 
}

 

 

Thanks

Adnan

 

  • March 29, 2011
  • Like
  • 0

Hi,

 

I want to fire  Assignment rule when a case is created via Web Service in Salesforce.

I tried using DML Options but getting the following error:

 

"Execution of AfterInsert caused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old:"

 

I am using an after insert trigger..

Please help me.. Its urgent

  • March 26, 2011
  • Like
  • 0

Hi,

 

I am trying to make the default picklist value of LeadSource to "WEB". Can I be assisted?

 

Below is the code.

 

<apex:pageBlockSection title="" collapsible="false" columns="1" >
    <br /><br />
    
    


   
         <apex:inputField value="{!Lead.LeadSource}" />  <----picklist value default to "WEB"              
         
         
         
         <apex:inputfield value="{!Lead.Industry}" required="true"/>     
         <apex:inputField value="{!Lead.Title}"/>
         <apex:inputField value="{!Lead.Salutation}"/>
         <apex:inputField value="{!Lead.FirstName}" required="true"/>
         <apex:inputField value="{!Lead.LastName}"/>         
         <apex:inputField value="{!Lead.Company}"/>
         <apex:inputField value="{!Lead.Street}" required="true"/>
         <apex:inputField value="{!Lead.City}" required="true"/>
         <apex:inputField value="{!Lead.State}" required="true"/>
         <apex:inputField value="{!Lead.PostalCode}" required="true"/>
         <apex:inputField value="{!Lead.Email}" required="true"/>
         <apex:inputField value="{!Lead.Phone}" required="true"/> 
            
       <br /><br />
              </apex:pageBlockSection>

 

  • March 17, 2011
  • Like
  • 0

I was wondering if I can get some assistance a validation rule. I have 4 custom picklist consisting of numbers (1-10). I want to create a validation rule where A+ B+C+D must = E. E will already be populated but the 4 picklist fields number must also equal to E.

 

Hope I was clear.

 

Thanks

Adnan

  • June 16, 2010
  • Like
  • 0