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
Arpita NayakArpita Nayak 

insert/update

Hi Guys,

I am creating a Student/Teacher/Class App.There are some requirement which i am writing below.Kindly please give some idea how to create all these.Is there any need of trigger here??
  1. User should not be able to insert/update if that teacher is not active.
  2. User should not be able to delete a class if there is any student in it.
  3. Don’t allow user to add student to a class which already reached the max limit of students.
  4. Maintain the number of student for each class.
Pankaj_GanwaniPankaj_Ganwani
Hi Arpita,

Please find the below mentioned points for the aforementioned questions:

1. Can you please elaborate a little bit more on this?
2. You can achieve this using validation rule if there is MD relationship between class and student.
3. This can also be achieved using validation rule.
4. You can simply create one field on class which signifies the number of allowed students and one roll up summary field on Class(counts to students). Then, apply validation rule on students, if roll up summary field value is greater than the value of specified students.

Thanks,
Pankaj