Microsoft Dynamics CRM 4 supports the following relationships:
1:N relationships (one to many)
N:1 relationships (many to one)
N:N relationships (many to many)
Let’s take two entity Doctor and Patient for estabilshing the above relationships.
Goto Settings –>Customization –> Select the Doctor entity and the then double click it.There you can find option to create 1:N,N:1,N:N relationships.
1:N relationship
This implies that one doctor can have many patients.Steps for estabilshing the relationship are as follows.
1. Create a new 1:N relationships .
2. The primary entity for this relationships is Doctor by default and it can’t be changed.
3. Select the related entity say Patient.
4. Give it name ,say “doctor_patients”, save it and publish it.
5. Then open the Patient entity.
6. There you can see a new attribute called “doctor_patients” has already been created as a lookup type.
7. Add the field to the Pateint form ,save and publish it.
When you will open the Doctor entity you can see the Patient entity inside it and there you can select one or many patients for one doctor.
N:1 relationship
This implies that many doctors can have one patient.Steps for estabilshing the relationship are as follows.
1. Create a new N:1 relationships .
2. The related entity for this relationships is Doctor by default and it can’t be changed.
3. Select the primary entity say Patient.
4. Give it name ,say “doctors_patient”, save it and publish it.
5. Then open the Doctor entity.
6. There you can see a new attribute called “doctors_patient” has already been created as a lookup type.
7. Add the field to the Doctor form ,save and publish it.
When you will open Patient entity you can see the Doctor entity inside it and there you can select one or many doctors for one patient or you can select the patient from the doctor enity through the “doctors_patient” lookup field.
N:N relationship
This implies that one doctors can have many patients and viceversa.Steps for estabilshing the relationship are as follows.
1. Create a new N:N relationships .
2. The current entity for this relationships is Doctor by default and it can’t be changed and select the display option as “Use Plural Name”.
3. Select the other entity say Patient and select the display option as “Use Plural Name”.
4. Save it and publish it.
When you will open Doctor entity you can see the Patient entity inside it and there you can select one or many patients and vice versa.