3 Replies Latest reply on Jul 2, 2016 7:28 AM by bigtom

    linking two records same table

    lukeingram

      Hi,

       

      I have a workflow solution I am working on.

       

      I have a table "tasks" and would like to choose a "related task" from the same table, so that my staff know not to proceed with the second step until the first is done.


      Any advice on how to achieve this?

       

      Thanks


      Luke

        • 1. Re: linking two records same table
          keywords

          You would achieve this by setting up a self-join relationship. If there is only ever going to be one related task per task then the following would work:

          1.     Create a relatedTaskID field, which you would use as a foreign key in the join.

          2.     In your relationship graph create a new TO based on the Tasks table, but call it RelatedTask.

          3.     Make the join Tasks::TaskID = RelatedTask::relatedTaskID.

          4.     On each record where it is needed, enter the appropriate TaskID (from the LHS of the join) into the foreign key field of the relevant task you want to be the related one.

           

          If there could be a series of related tasks, then you have a many-to-many situation, which you would need to resolve by creating a join table. You would still need the RelatedTask TO as above, but not the foreign key field. In the join table you would just need two ID fields. Then you can join any task to any other task, simply be adding the two relevant IDs on a join record.

          1 of 1 people found this helpful
          • 2. Re: linking two records same table
            lukeingram

            Thank you! Worked perfect

            • 3. Re: linking two records same table
              bigtom

              lukeingram wrote:

               

              Thank you! Worked perfect

               

              Then please mark the reply from keywords as the correct answer.