• donsu04
  • 0 Points
  • Member since 2013

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
  • 7

Hello there.


I am looking for some help getting code coverage to visual force page.  My first page :) , So any help will be much appreciated.







Apex Class :


public class SubmitLeadController {
    public Lead L { get; set; }
    public SubmitLeadController() {
        L = new Lead();
        L.Company = 'Not Available';
        L.IsRAALead__c = true;
      public Attachment A1 {
  get {
      if (A1 == null)
        A1 = new Attachment();
      return A1;
    public Attachment A2 {
  get {
      if (A2 == null)
        A2 = new Attachment();
      return A2;
    public PageReference submitLead() {
            try {

                INSERT L;
            IF (A1.Body!=null)
                  A1.OwnerId = UserInfo.getUserId();
                  A1.IsPrivate = true;
                  A1.ParentId = L.id;
                  insert A1;
            IF   (A2.Body!=null)
                   A2.OwnerId = UserInfo.getUserId();
                  A2.IsPrivate = true;
                  A2.ParentId = L.id;
                  insert A2;
                return new PageReference('/RAASubConf');
            } catch (Exception e) {
                return null;


Visual Force page :


<apex:page standardstylesheets="false" showheader="false" sidebar="false" controller="SubmitLeadController"> <font face="verdana"> <h3>Web To Lead With Attachments </h3> <apex:form > <apex:pageMessages /> <table> <tr></tr> <tr> <th>First Name:</th> <td><apex:inputText required="true" value="{!L.Firstname}"/></td> </tr> <tr> <th>Last Name:</th> <td><apex:inputText required="true" value="{!L.Lastname}"/></td> </tr> <tr> <th>Email:</th> <td><apex:inputText required="true" value="{!L.Email}"/></td> </tr> <tr> <th>Phone: </th> <td><apex:inputText required="true" value="{!L.Phone}"/></td> </tr> <tr> <th>Lead Source Notes:</th> <td><apex:inputTextArea rows="6" value="{!L.Lead_Source_Details__c}"/></td> </tr> <tr> <th>Attachment 1:</th> <td><apex:inputFile value="{!A1.body}" filename="{!A1.name}"/></td> </tr> <tr> <th>Attachment 2:</th> <td><apex:inputFile value="{!A2.body}" filename="{!A2.name}"/></td> </tr> <tr> <td><apex:commandButton value="Submit Lead" action="{!submitLead}"/></td> </tr> </table> </apex:form> </font> </apex:page>

Hi - I am relatively new to APEX and i have just created my first apex trigger. Now the problem is i do not know how to write an apex class trigger to test the new lead created. Can anyone please share their thoughts. 


Any help will be really really appreciated






Here is the trigger i wrote



trigger CreateRefLead on Lead (after insert) {

List<Lead> leads = new List<Lead> ();

for(Lead l:Trigger.new)

if(l.Referred_Email_1__c!=null && l.Referred_First_Name_1__c!=null && l.Referred_Last_Name_1__c!=null )
Lead l1 = new Lead();
l1.lastName = l.Referred_Last_Name_1__c;
l1.Referrer_Lead__c = l.id;
l1.FirstName = l.Referred_First_Name_1__c;
l1.Email = l.Referred_Email_1__c;
l1.Company = l.Company;

if(l.Referred_Email_2__c!=null && l.Referred_First_Name_2__c!=null && l.Referred_Last_Name_2__c!=null )
Lead l2 = new Lead();
l2.lastName = l.Referred_Last_Name_2__c;
l2.Referrer_Lead__c = l.id;
l2.FirstName = l.Referred_First_Name_2__c;
l2.Email = l.Referred_Email_2__c;
l2.Company = l.Company;

if(l.Referred_Email_3__c!=null && l.Referred_First_Name_3__c!=null && l.Referred_Last_Name_3__c!=null )
Lead l3 = new Lead();
l3.lastName = l.Referred_Last_Name_3__c;
l3.Referrer_Lead__c = l.id;
l3.FirstName = l.Referred_First_Name_3__c;
l3.Email = l.Referred_Email_3__c;
l3.Company = l.Company;

if(l.Referred_Email_4__c!=null && l.Referred_First_Name_4__c!=null && l.Referred_Last_Name_4__c!=null )
Lead l4 = new Lead();
l4.lastName = l.Referred_Last_Name_4__c;
l4.Referrer_Lead__c = l.id;
l4.FirstName = l.Referred_First_Name_4__c;
l4.Email = l.Referred_Email_4__c;
l4.Company = l.Company;

if(l.Referred_Email_5__c!=null && l.Referred_First_Name_5__c!=null && l.Referred_Last_Name_5__c!=null )
Lead l5 = new Lead();
l5.lastName = l.Referred_Last_Name_5__c;
l5.Referrer_Lead__c = l.id;
l5.FirstName = l.Referred_First_Name_5__c;
l5.Email = l.Referred_Email_5__c;
l5.Company = l.Company;

if(l.Referred_Email_6__c!=null && l.Referred_First_Name_6__c!=null && l.Referred_Last_Name_6__c!=null )
Lead l6 = new Lead();
l6.lastName = l.Referred_Last_Name_6__c;
l6.Referrer_Lead__c = l.id;
l6.FirstName = l.Referred_First_Name_6__c;
l6.Email = l.Referred_Email_6__c;
l6.Company = l.Company;

} insert leads;


I need to create a form for a refer-a-friend email campaign which captures 6 names and email addresses and converts them to leads. The six new leads also need to be linked to the person who referred them. My concern is how can I use one web to form to capture multiple leads.


Any help will be really really appreciated




Just looking to see what the average salary is for a 1-2 year experienced SFDC administrator. We're looking to see if a full time or contract employee is the better option.


I am not looking for consultants to contact me with your services. I already have a consultant. I just want to know the other option cost.


Thank you.

Require ReCaptcha (have key already) and javascript for required fields to enhance web to lead form already on our website (Wild Apricot Template).

Belly, a Chicago based digital loyalty company, is currently seeking a Salesforce Developer to build and manage our Salesforce platform.  This person will work closely with Sales and Engineering to develop custom solutions to enhance our internal tools.


If interested click here to apply!




Working at Belly is not a job.  


It’s a career game changer.  


We want you.  


But who are you?  


You have a passion for Salesforce and Engineering. You enjoy developing and owning the internal tools that our team depends on for their success. You understand how systems and software support and improve real world actions. Unlike a lot of Engineers you can handle working around and in the noise and chaos of a Sales organization.


What you’ll do:

  • Manage the custom development lifecycle of Salesforce using the Force.com platform, Apex and VisualForce
  • Develop and teach analysts in Salesforce to empower independence
  • Build custom reports, dashboards, fields, objects and workflow rules
  • Understand customer requests (internal and external) to develop unique solutions to daily sales and account management needs
  • Work directly with our Engineering team to maintain compatibility of data and systems.

What you’ll need:

  • BA/BS degree in Computer Science or related degree
  • 5+ years of development experience with Java, .NET, Python, or Ruby
  • 2+ years Salesforce development experience utilizing Apex and VisualForce
  • Experience working with Sales Teams and Management
  • Salesforce.com Developer Certification

We are a small business who utilizes Salesforce extensively to track all customer, lead, and prospect data.

We've done some customization and we need to improve our workflow, reports, and dashboards to support better business success.   We also need to begin using our data to better market.  As part of the effort to improve our marketing I'd implement an autoresponder system, whether that is native to Salesforce or integrated with a third party. 

We are looking for strategic planning recommendations as well as implementation. 

I'm not exactly sure how long it will take to implement our needs. We may do this in stages, depending on recommendations.

We have the Enterprise version of Salesforce.


Although, this project is short term to move us forward, I'd like to build a relationship with a log-term "go-to" person. 





We need a Web entity (servlet) to be called when a new lead or account has been created in Salesforce (manually within salesforce or through a web form) and the lead or account id to be passed over.

The Apex code from this project simply needs to request an URL like this: http://myhost.com/processnewlead/lead-or-account-ID upon creation of a new lead or account.


We are looking for a developer that can implement this for us within the next few days. Please post how long it would take you and how much it would cost us.


Thanks and best regards


  • February 04, 2013
  • Like
  • 0

I am a sys administrator with a company of importan projects going on concurrently. 


I have a need to contract out some small pieces of these projects, does anybody have any reccomendations on where I can find someone to do the work.   I need to find a solution very soon.


At this point, the scope of the project looks to be the following:


- A couple of visualforce pages so that end-users can create records from multiple objects off of one screen (example: contract, opportunity, quote)

- a couple of triggers to create new records during certain critera.


This doesn't seem to be too complex.  I haven't done this type of work before and don't have time to teach myself.  You can email me at tdavies@rals.com and I can send you the requirements I've drawn up.  Thanks.