jdenver Posted May 23, 2012 Posted May 23, 2012 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.
mr_vodka Posted May 23, 2012 Posted May 23, 2012 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.
jdenver Posted May 23, 2012 Author Posted May 23, 2012 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.
mr_vodka Posted May 23, 2012 Posted May 23, 2012 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 ]
jdenver Posted May 23, 2012 Author Posted May 23, 2012 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
Recommended Posts
This topic is 4566 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now