locked
Creating Entities and Relationships RRS feed

  • Question

  • I am new to Microsoft Dynamics CRM and am trying to complete the following task.

    I need to create three custom entities: Contractor, Project, and Time. The Time entity stores information about the time that was spent working on a Project by a Contractor. For example:

    18/08/09 0900 - 18/08/09 1600: Total 7 hours on Project A
    18/08/09 1900 - 18/08/09 2130: Total 2 hours 30 mins on Project A

    The way I think about the relationships is as follows:

    A Contractor can work on multiple Projects
    A Project can be worked on by multiple Contractors

    Hence, the relationship between Contractor and Project is N:N.

    A Project can be associated with multiple Times.

    What I need to be able to do is create a new Contractor record and press save. From within this record, I should be able to see "Projects" in the Contractor forms navigation pane, so I can click this and view all Projects that this Contractor is working on.

    Similarly, if I create a new Project record and press save, I should be able to see "Contractors" in the Project forms navigation pane, so I can click this and view all Contractors that are working on this particular Project.

    Also, if I create a new Time record, I should be able to know which Project this Time record is associated with, as well as the Contractor that spent this "Time" working on the project.

    If someone can help me derive the correct relationship, that would be greatly appreciated.

    Thanks,
    Roshan
    Tuesday, August 18, 2009 4:41 AM

Answers

  • Hi Roshan

    As  you said you have to create a N:N relationship between contractor and project.
    Once you create this relatinoship both of these entities will be available in each other navigation pane. So you can see project all contractors and contractor all projects.

    For Time you create a 1:N relationship between Project and Time. This will add the lookup entity to the Time, so the time can only be associated to one project at one time where as one project can  have multiple times on it.

    Also create a 1:N relationship between Contractor and Time. This will add the lookup entity to the Time again so the time can be associated to one contractor only. where as contractor can have multiple times


    I hope it can resolve your confusion.

    Tuesday, August 18, 2009 5:44 AM

All replies

  • Hi Roshan

    As  you said you have to create a N:N relationship between contractor and project.
    Once you create this relatinoship both of these entities will be available in each other navigation pane. So you can see project all contractors and contractor all projects.

    For Time you create a 1:N relationship between Project and Time. This will add the lookup entity to the Time, so the time can only be associated to one project at one time where as one project can  have multiple times on it.

    Also create a 1:N relationship between Contractor and Time. This will add the lookup entity to the Time again so the time can be associated to one contractor only. where as contractor can have multiple times


    I hope it can resolve your confusion.

    Tuesday, August 18, 2009 5:44 AM
  • Hi Muhammad,

    Thank you for your answer. I had just figured it out before I received your reply, but I'm glad to know that I was on the right track.
    Tuesday, August 18, 2009 8:36 PM
  • Hi Muhammad and Donna, I am working on a similar situation.  In addition to project, i created another entiy 'project task' that will store individual project line items for each project.  say, for a software development project, I have scope document as a project task with estimated start and date as well as estimated work hours.  for. e.g.

    Project A --> Project Task1...TaskN; Team --> User A & User B

    User A will work on Project task 1; 5/22/2011 - 5/23/2011; 6 hrs;

    User B will work on Project taks 1; 5/23/2011-5/24/2011; 2 hrs;

    Project task 1: est total hrs-8hrs; 5/22/11-5/24/11

    Note: I am using service activity to book resource for the project task. I beleive thats the only way to do that.

    What is the best way for me to keep track of Project task1 % complete? Could I create a crm task and assign to resources A & B. Once completed (or as it gets completed), a workflow can update the status of the project task1. or Is there a better approach? 

    How to keep track of time by resource A & B? in a seperate "Time" Entity.  Project Task to Time as 1:N but Project to Time as 1:N or N:N?

    (Project to Project Task 1:N) | Project to team is it 1:N? | Project to User N:N

    Appreciate your thoughts.



    Monday, May 23, 2011 9:19 PM