Skip to main content
public class Messaginghelper

{

    public static void createLeadrecords()

    {

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

        // first lead record

        Lead ld = new Lead();

        ld.firstname='mahesh';

        ld.LastName='Dharmarapu';

        ld.Email='maheshdharmarapu@gmail.com';

        ld.Rating='Hot';

        ld.Industry='Technology';

        ld.AnnualRevenue=50000000;

        ld.Company='Auto desk inc';

        ld.status='Open-Not contacted';

        ld.phone='9900990099';

        ld.Fax='9900887766';

        ld.City='Hyderabad';

        ld.State='Telangana';

        ld.Country='India';

        ld.PostalCode='50038';

        lstleadrecords.add(ld);

        

        //second lead record

        Lead ld1 = new Lead();

        ld1.firstname='maheshwari';

        ld1.LastName='Dharmarapu';

        ld1.Email='maheshwaridharmarapu@gmail.com';

        ld1.Rating='Warm';

        ld1.Industry='Technology';

        ld1.AnnualRevenue=60000000;

        ld1.Company='Auto desk inc';

        ld1.status='Open-Not contacted';

        ld1.phone='9900990099';

        ld1.Fax='9900887766';

        ld1.City='Hyderabad';

        ld1.State='Telangana';

        ld1.Country='India';

        ld1.PostalCode='500039';

        lstleadrecords.add(ld1);

        //Third Lead record

        Lead ld2 = new Lead();

        ld2.firstname='Dinesh';

        ld2.LastName='Dharmarapu';

        ld2.Email='dineshdharmarapu@gmail.com';

        ld2.Rating='Hot';

        ld2.Industry='Technology';

        ld2.AnnualRevenue=50000000;

        ld2.Company='Auto desk inc';

        ld2.status='Open-Not contacted';

        ld2.phone='9900990099';

        ld2.Fax='9900887766';

        ld2.City='Hyderabad';

        ld2.State='Telangana';

        ld2.Country='India';

        ld2.PostalCode='50038';

        lstleadrecords.add(ld2);

        if(!lstleadrecords.isempty())

        {

            insert lstleadrecords;

            system.debug('Inserted lead records..:'+ld.id);

        }

        

      }

}

this is my apex class code 
4 respuestas
  1. 10 mar 2022, 5:34

    if my class name DMLhelper can u tell me execution code for this apex class code

    Thank you

0/9000