1 Reply Latest reply on Dec 13, 2010 8:07 AM by philmodjunk

    Working with related tables - Auto entering data into related table

    raykennedy

      Title

      Working with related tables - Auto entering data into related table

      Post

      I have two tables that are related...

      1. Transacation

      2. Price Adjustment

      There two fields in Transaction, Original List Price & Current Price

      I have it set up so when a user changes price in the Price Adjustment through a portal it automatically updates Transaction::Current Price  = Price Adjustment::New Price. This is done through a simple calculation within the table/field setup under Transaction::Current Price.

      The problem is that I have to tab over to the Price Adjustment portal and manually add a price adjustment to create an entry so it forces a current price on the Transaction.

      Is there a way I could automatically enter a new entry into Price Adjustment that will add a value to Price Adjustment:: Current Price & Price Adjustment::New Price equal to Transaction::Original List Price. I would like to do this upon entry of the Original List Price.

      I know you can use script triggers upon exiting the object. I am just not sure how to create a new related record without going to the layout.

      Any other suggestions, I am open to them.

      Thanks.

        • 1. Re: Working with related tables - Auto entering data into related table
          philmodjunk

          I am just not sure how to create a new related record without going to the layout.

          While you can write a script to interact with your portal to create the related record, going to the layout for that table is simpler and more flexible. You can use freeze window to freeze the window, go to the layout for Price Adjustment, create the record and then return to the original layout. The user just sees the new data appear. What ever value you are using to link Transaction to Price Adjustment gets stored in a variable so that you can assign it to the appropriate field in the new record that you create on the other layout.