Jed69 Posted February 10, 2008 Posted February 10, 2008 I have two tables which are related. The Child table had the ID number of the parent table to link it. I would like to create a button the parent tables layout that would check to see if there was a related record and if there was to open it and if there was not to create one and then open it. At this point there will be only one record related. I have created this a a separate table because it is also related to another parent table. Can anyone help me with the script I might use on a button to do this?
jstaphse Posted February 10, 2008 Posted February 10, 2008 Go to Related Record [ From table: “child”; Using layout: “child” (child) ] [ Show only related records ] If [ Get ( LastError ) = "101" ] Set Variable [ $Parent; Value:parent::id ] Go to Layout [ “child” (child) ] New Record/Request Set Field [ child::parentid; $Parent ] Go to Layout [ original layout ] Go to Related Record [ From table: “child”; Using layout: “child” (child) ] [ Show only related records ] End If
Akak Posted February 14, 2008 Posted February 14, 2008 I have a similar question. I made a report layout on a db to track inventory. As it is now, I create my POs/invoices, then separately create a record in the inventory table for any kind of inventory that isn't already in there. For example, if I write up an invoice for Converse - Men's shoes (converse being in the field SHOE and men's being in the field TYPE) and there is a record in the inventory table that has Converse - Men's, it will perfectly track that inventory. On the other hand if I would then create a purchase order for Converse - Children's, and there is no Converse - Children's record in the Inventory table, I would have to create it to track those shoes. What I would like to do is have that record in inventory be created automatically if, and only if, it doesn't already exist. I have included the relationships I set up so far. Thanks.
Recommended Posts
This topic is 6128 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