4 Replies Latest reply on Aug 1, 2015 1:16 PM by leonhart1981_1

    Question about related field

    leonhart1981_1

      Title

      Question about related field

      Post

      I have a database with three tables: employee detail, offer package, payroll

      Employee detail table contains detailed information about each employees; offer package table contains offering letter for each employee; payroll table is the table that I use to calculate employee's payroll for each period

      **Relationship diagram are attached. 

      Now, I am at payroll table try to calculate my employees' payroll, and there is a related filed called "base salary" that I borrowed from offer package table. For some reasons, I need to change the value in the "base salary" field for payroll table, but I want to keep the field's value in offer package table unchanged. Am I able to do that? Please help~~~

       

      Relationship_3.png

        • 1. Re: Question about related field
          philmodjunk

          Is there one and only one record in Offer Package for each employee? What you show implies that you might have more than one.

          If, for some unusual reason, you have more than one Offer Package linked to the same Employee Detail record, you will need to change your relationships to be sure to match the correct offer package.

          But assuming only one for one here, you can define a field for BaseSalary in Payroll and set it up with an auto-enter field option such as "looked up value" or a calculation that copies the value of BaseSalary from Offer Package to PayRoll. Since this is a copy of the data in Payroll, you can edit this value and the original value in Offer Package will not change.

          Please note that existing records will not automatically get a value from Offer Package. Once you've set this up, you'll need to use Replace Field Contents to copy over the value for your existing Payroll records.

          • 2. Re: Question about related field
            leonhart1981_1

            Hi, Phil, 

            Now you mentioned it. I just realized that I can simply delete the offer package table and transfer all the information to employee detail table since one record of offer package is for each employee. 

            Then, I can follow your instruction by defining a filed for BaseSalary in Payroll and set it up with an auto-enter field "looked-up value" option. 

            My concept is correct in this way right? 

            • 3. Re: Question about related field
              philmodjunk

              Yes, but what I suggested will also work from your current data model.