Simple for loop

Apex Class




Simple for loop



public class insert100
{
    public void m1()
    {
        List<Testing__c> lstTesting = new List<Testing__c>();
        Testing__c objTest;
      
        for(Integer i=6;i<=100;i++)
        {

            objTest=new Testing__c(name='Testing'+string.valueof(i),city__c='City'+string.valueof(i));
            lstTesting.add(objTest);
        }
       
        insert lstTesting;
       
    }
}
Simple for loop Simple for loop Reviewed by dasfrogpractice on 22:53 Rating: 5

No comments:

Theme images by mariusFM77. Powered by Blogger.
Youtube Channel Image
Dasfrog Subscribe To watch more Salesforce Training
Subscribe