function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PAWAN THOSARPAWAN THOSAR 

Write an apex program, to Insert 200 Hiring Manager Records inside the Object.

Best Answer chosen by PAWAN THOSAR
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Pawan,

Can you try the below code.
 
public class InsertHiringManager {
    
    public void insertHManager(){
        List< Hiring_Manager__c > hm= new List<Hiring_Manager__c> ();
        For( Integer I=0; I<200;i++){
        Hiring_Manager__c  ls= new Hiring_Manager__c ();
       Ls.name='sample'+i;
       hm.add(ls);
        }
        insert hm;
        
    }

}

You can execute the below code in anonomous window so records get inserted.
InsertHiringManager IL= new InsertHiringManager();
IL.insertHManager();

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

Can you confirm if Hiring Manager is a custom object . Also can you confirm if there are any mandatory fields in it.

Thanks,
 
PAWAN THOSARPAWAN THOSAR
yes, hiring manager is custom object and there is no any mandatory field 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Pawan,

Can you try the below code.
 
public class InsertHiringManager {
    
    public void insertHManager(){
        List< Hiring_Manager__c > hm= new List<Hiring_Manager__c> ();
        For( Integer I=0; I<200;i++){
        Hiring_Manager__c  ls= new Hiring_Manager__c ();
       Ls.name='sample'+i;
       hm.add(ls);
        }
        insert hm;
        
    }

}

You can execute the below code in anonomous window so records get inserted.
InsertHiringManager IL= new InsertHiringManager();
IL.insertHManager();

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
This was selected as the best answer
PAWAN THOSARPAWAN THOSAR
Line: 1, Column: 1
Invalid type: InsertHiringManager
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Pawan,

Is the apex class saved succesfully? Can you confirm the API name of the object ?

Thanks,
 
PAWAN THOSARPAWAN THOSAR
sir can u give me ur number so i can easly communicate to slove my assiment 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi pawan,

I am available to communicate always on Developer Forum. Fell free to post any doubts .

Thanks,
 
PAWAN THOSARPAWAN THOSAR
its admin project doubt that why i am asking