5 Replies Latest reply on Feb 4, 2015 3:28 PM by philmodjunk

    data not copying from one table to another



      data not copying from one table to another


      I have a field in Customers called client_hours_in_day which auto enters 8 (this is usual working day for us, but one client put 7 in his contract so had to change loads of calculations in last database). I have a field in Lines called hours_in_day this autofills with the calculation hours_in_day = customers::client_hours_in_day but for some reason this is temperamental. I did a test line item and it didn't copy it across, Then I did loads of stuff and it did. I then thought i had fixed it (don't know how because everything was put back to how it was). I then created a  new line item with a different client and the same thing happens it doesn't copy the field???

        • 1. Re: data not copying from one table to another

          Better look at the relationship on which this 'look up' is based. (I'd use the looked up value option myself, but then I'm "old school"--having used this option before the calculation option was available.)

          • 2. Re: data not copying from one table to another

            I tried the lookup method, no change. it's really weird because what ever I've done has corrected the test invoices I have but when I create a new invoice the same thing happens. I have attached my relationships.

            just to summarise I create a new invoice, I can then add line items via a portal, the line item gets the project from projects and the hourly rate from clients, it is then supposed to work out the cost but it's not, its not bringing across the "day rate" or the "hours in day" values that I need to calculate cost

            • 3. Re: data not copying from one table to another

              What are the specific auto-enter options that you have specified for this?

              Is it possible that the problem line items were created before you selected a client for the invoice?

              Is it possible that you selected a client, then starting entering line items immediately and nothing was looked up?

              (I am assuming here that you create a new invoice and then select your client from a value list or similar selection method.) Try this experiment: Select a client for your invoice. Click the layout back ground to commit records. Then create the new line item record in the portal. Does that work reliably?

              If that solves the problem, you can use a script trigger to commit records each time you select a client for your invoice.

              PS: And beware of this scenario: Create invoice; Select Client; Add Line Items; OOPS! wrong client, better select the right one....  Note that this can leave you with line items with the incorrect rate as they won't automatically update if you make such a correction after the line item has been added to the portal.

              • 4. Re: data not copying from one table to another

                that seams to work thank you, I'll create a scripted trigger. would I do it on keystroke or object modify? i've done modify and it seams to work


                • 5. Re: data not copying from one table to another

                  I wouldn't use keystroke, but I might use Save. It depends on the precise method you use to select a customer. OnObjectModify is my first choice for popup menus, radio buttons and check boxes. OnObjectSave may be the better choice for drop down lists where the user is allowed to also type info into the field. (OnObjectModify can be tripped with each keystroke in such case...)

                  But I also would use a much more sophisticated method for finding and selecting a customer than using a simple value list in the first place so the method I used might already have a script where I could add the needed commit step.