You need to sign in to do that
Don't have an account?

Master Details relationship
Class is in a Master Detail relation with student
Which is master object and which one is detail here?
You need to sign in to do that
Don't have an account?
Class is in a Master Detail relation with student
Which is master object and which one is detail here?
Hi Vivek,
As per point 3 - Student can take multiple classes, i would suggest you to go for a Lookup relation instead of Master Detail.
You may consider creating a Junction Object for Attendance which has 2 parents Student and Class to track the attendance.
See the link for junction object: https://help.salesforce.com/apex/HTViewHelpDoc?id=relationships_manytomany.htm&language=en
In the VF page you can customize is as per your requirement - either you have multiple look up fields or create new Student button to create or add a student to the class.
Regards,
Ashish
All Answers
So if you created a Master detail relationship field from the Student, then master would be the Class(parent). If you created the field in the Class that master details to the student then Student would be the master (parent) Look into this:
http://www.salesforce.com/us/developer/docs/api/Content/relationships_among_objects.htm
Hi Vivek,
Class and Student can be a look up as well in the actual sence - There can be number of classes and there can be number of students - which means a Student has to look up his class and a class can look up and add as many students possible.
The classic example would be a Case and the Related Call tasks - where case is the Master and Tasks(Calls) are child - If a Case is deleted then there is no use of the Calls made - which means when a Case is deleted so will be the Child Records.
In case of Student and Class - Students and Class can be deleted without deleting each other.
We can make a Class a Master Object and Students Child object but the child will have no value outside the parent.
Reply back if there is anything specific you are looking for,
Regards,
Ashish
Reason: One class can have many students but one student cannot be a part of many classes.
Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.
Parent would be Class
Child would be Student
Because without class we wont have a student.
so class would be parent and student would be child.
One depends on another, when you apply master-detail relationship if parent record is deleted the child record would be deleted. so if you delete a class record then student record would be deleted.
ex: you have java for a class and if they delete a class called java then we wont have any students going to that class
Ashish,
This is my requirement
1- Create custom objects , Class and Student.
2- Class is in a Master Detail relation with student
3- Student can take multiple classes
4- Student has a status (Attending, Dropped) for each class
5- Create a single visual force page to create a new Class record.
6- In the same page, create a section on which a user can add students to the
class via the Add button.
7- Only partial refresh in the VF page to reflect student records added.
8- Top Save button save the class and students records in the section.
9- Save button in the bottom section only saves students records
10- New button creates a new class
11- Add button adds a single student attendance record on the page, on which
the user can fill in the required values (Student, status)
12- To delete an attendance, user should select at least one record.
13- User can select multiple records to delete
If you look at #9 - save student records alone - This can be achieved only if student is a master and class is in detail side.
Let me know your thoughts.
Hi Vivek,
As per point 3 - Student can take multiple classes, i would suggest you to go for a Lookup relation instead of Master Detail.
You may consider creating a Junction Object for Attendance which has 2 parents Student and Class to track the attendance.
See the link for junction object: https://help.salesforce.com/apex/HTViewHelpDoc?id=relationships_manytomany.htm&language=en
In the VF page you can customize is as per your requirement - either you have multiple look up fields or create new Student button to create or add a student to the class.
Regards,
Ashish
Thanks Ashish. I was thinking on the same lines too. Here is the page i developed using attendance as junction box