May 23, 201213 yr Ive created my database a few years ago now with two tables: tb_customers and tb_jobinfo. The customers jobs layout displays the customers details and a portal displaying the relevant jobs carried out for that customer over the years. To create a new job, I scroll down the portal to click an empty field and fill in. I would like to replace this layout showing the customers info as above but then a 2x tab control, first tab displaying 'Current job', in other words the last job entered for that customer. The second tab labeled 'History' which will use a portal to display all previous work. Because I'm using fields from the tb_jobinfo table in the 'Current Job' tab as a posed to a portal, I dont know how to add a new record. I would like it to work so as when the 'New Job' button is clicked, the fields on the 'Current Job' tab clear ready to enter a new job for the relevant customer. I dont know whether this is the right way or anybody else can advise on a different way.
May 23, 201213 yr Well if you have the relationship sorted descending. Then the most current job should be the first record. When you hit the button for a new job, you can have your script create a new record in the jobinfo table, which would make the newest displayed record blank for you to fill out.
May 23, 201213 yr Author Well if you have the relationship sorted descending. Then the most current job should be the first record. When you hit the button for a new job, you can have your script create a new record in the jobinfo table, which would make the newest displayed record blank for you to fill out. Thanks for that, I understand what you are saying, but Im not sure on the script steps to create a new record in the tb_jobinfo using the current customer. When I set the 'New Job' button too new record, it creates a new record in the tb_customers table.
May 23, 201213 yr Something like: Set Variable [ $customerID; tb_customers::ID ] Go to Layout [ tb_jobinfo ] New Record Set Field [ tb_jobinfo::fk_customerID; $ID ] Go to Layout [ original ]
May 23, 201213 yr Author Thats great, just tried it out and it worked. Didn't appreciate having to go to the jobinfo layout and return to original, makes sense now. Cheers
Create an account or sign in to comment