You need to sign in to do that
Don't have an account?
Tejas Wadke 5
Need bulk insert trigger for the following code
Code
+++++++++++++++++++
trigger ICADCPASort on icad__CPA__c (after insert)
{
List<CPA__c> CPAIds = new List<CPA__c>();
List<Test__c > TestIds = new List<Test__c>();
for(CPA__c np: Trigger.new)
{
CPAIds.add(np);
}
for(CPA__c np: CPAIds)
{
Test__c st = new Test__c();
Id devRecordTypeId = Schema.SObjectType.Test__c.getRecordTypeInfosByName().get('CPA').getRecordTypeId();
st.CPA__C = np.Id;
st.Test_Name__c = 'CPA';
st.icad__Student_Name__c = np.icad__Name_of_the_Candidate__c;
st.icad__Email__c = np.icad__Student_Email_id__c;
TestIds.add(st);
}
insert TestIds;
Student_Details__c sd =new Student_Details__c();
sd.CPA__c = np.Id;
sd.Student_Name__c = np.Name_of_the_Candidate__c;
sd.Birth_Date__c = np.Birth_Date__c;
sd.Cast_Category__c = np.Cast_Category__c;
sd.Name_of_School__c = np.Name_Of_School__c;
sd.Residential_Add__c = np.Residential_Add_del__c;
sd.Dist__c = np.City__c;
sd.Pin__c = np.Pin__c;
sd.Landline__c = np.Home_Phone_No__c;
sd.Parents_Mob__c = np.Parents_Mob__c;
sd.Students_Mob__c = np.Student_Phone_No__c;
sd.Parent_s_Email__c = np.Parent_Email_id__c;
sd.Student_s_Email__c = np.Student_Email_id__c;
sd.Candidate_s_Photo__c = np.Candidate_s_Photo__c;
sd.icad__Test__c=st.id;
insert sd;
}
+++++++++++++++++++
trigger ICADCPASort on icad__CPA__c (after insert)
{
List<CPA__c> CPAIds = new List<CPA__c>();
List<Test__c > TestIds = new List<Test__c>();
for(CPA__c np: Trigger.new)
{
CPAIds.add(np);
}
for(CPA__c np: CPAIds)
{
Test__c st = new Test__c();
Id devRecordTypeId = Schema.SObjectType.Test__c.getRecordTypeInfosByName().get('CPA').getRecordTypeId();
st.CPA__C = np.Id;
st.Test_Name__c = 'CPA';
st.icad__Student_Name__c = np.icad__Name_of_the_Candidate__c;
st.icad__Email__c = np.icad__Student_Email_id__c;
TestIds.add(st);
}
insert TestIds;
Student_Details__c sd =new Student_Details__c();
sd.CPA__c = np.Id;
sd.Student_Name__c = np.Name_of_the_Candidate__c;
sd.Birth_Date__c = np.Birth_Date__c;
sd.Cast_Category__c = np.Cast_Category__c;
sd.Name_of_School__c = np.Name_Of_School__c;
sd.Residential_Add__c = np.Residential_Add_del__c;
sd.Dist__c = np.City__c;
sd.Pin__c = np.Pin__c;
sd.Landline__c = np.Home_Phone_No__c;
sd.Parents_Mob__c = np.Parents_Mob__c;
sd.Students_Mob__c = np.Student_Phone_No__c;
sd.Parent_s_Email__c = np.Parent_Email_id__c;
sd.Student_s_Email__c = np.Student_Email_id__c;
sd.Candidate_s_Photo__c = np.Candidate_s_Photo__c;
sd.icad__Test__c=st.id;
insert sd;
}
Amit Chaudhary 8
Please try below code.
Let us know if this will help you