You need to sign in to do that
Don't have an account?
d
I am getting this error for following code: LocationTrigger: execution of Beforeinsert caused by System StringException: Invalid id: COEP Trigger LocationTngger: line 6
trigger LocationTrigger on Student c (before insert) 2 List<College_cs col [SELECT Name, state c from College_c];
for (Student c stu:Trigger.new) {
for (College c coll:col){ if(coll.state_cstu.state__c){
stu.college_name_c=col1.Name:
}
}
}
}
for (Student c stu:Trigger.new) {
for (College c coll:col){ if(coll.state_cstu.state__c){
stu.college_name_c=col1.Name:
}
}
}
}
Can you try below trigger.
Thanks,
All Answers
Can you confirm what you are trying to achieve using this trigger so can modify this and share you.
Thanks,
Just can you confirm the below.
While creating Student record you select the college(Lookup field) so the state on student record shoule populated from State on that college record?
Thanks,
Can you try the below trigger on Student object.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
If there are mutiple colleges with same state can we consider any college?
Thanks,
Can you try below trigger.
Thanks,
Is the code working as expected?
Thanks,