Gismo12 Posted November 27, 2018 Posted November 27, 2018 Hi All, I have 2 related table. when in layout 1, i need to go to related record in layout 2 When I write the script, I select layout 1, but table 2 is not in the list when selecting show record using layout. any suggestions?
Steve Martino Posted November 27, 2018 Posted November 27, 2018 Are the two TO's related on the relationship graph? Can you show a screenshot of your graph and the GTRR dialog?
Gismo12 Posted November 28, 2018 Author Posted November 28, 2018 Hi Steve, Here is the attached as requested. I refer to the Customer_Aircraft TBL and the Balance Sheet TBL. Balance Sheet is not in the list to select as "Show record using layout"
Steve Martino Posted November 28, 2018 Posted November 28, 2018 Shouldn't you select Balance Sheet table occurrence on your 'Get related record from:' drop down dialog?
bcooney Posted November 28, 2018 Posted November 28, 2018 Agreed, you shoukd select balance sheet. What I don't follow is the keys you're using to relate your tables. I would have expected customer to relate to aircraft by customer Id. What is the value in registration and why is it a key?
Gismo12 Posted November 29, 2018 Author Posted November 29, 2018 (edited) Hi, Most of my tables relate to a registration number which must be a text field. I did not select the ID if the aircraft to be my key throughout the DB. and on the layout side, when using the balance sheet as related record, I dont have Customer_Aircraft in the list either. Maybe, my relationship table will give clarity for my reason to Registration as a key. Could this be part of my problem i am having? Edited November 29, 2018 by Gismo12
bcooney Posted November 29, 2018 Posted November 29, 2018 You should not use registration as a key if it's a value that you have no control over and if it is not unique. I see many relationships in your system that are questionable: You're relating Kit>KitItems by Description! Should be by KitId ATAChapter? Is that a field you control? You didn't answer where Registration is created. By your system? What is it? (auto-enter serial?). Why do you have a PrimaryKey field if you don't use it for relationships? Also, before you go much further, I would strongly suggest adopting a convention for the Relationship Graph. I prefer Anchor-Buoy, but you need to do something. This will not scale well. 2
Gismo12 Posted November 30, 2018 Author Posted November 30, 2018 Hi, I am changing all my relationships to a unique key. The registration is a manual field created by the user, not a auto number. it is a text field. But after changing all my tables to relate to a primary key, will i be able to see the table when I select in the list for show record using layout?
bcooney Posted November 30, 2018 Posted November 30, 2018 Quote The registration is a manual field created by the user, not a auto number. it is a text field. Never use this type of value as a relationship key! Let's see your new relationship graph after you refactor the relationships. Also, why do you name the Aircraft table Customer_Aircraft? I find that confusing. It sounds like a join table, storing data about the many aircraft a customer owns and attributes of that ownership. I'd change that table to simply, Aircraft. Please study up on Anchor-Buoy! 1
Gismo12 Posted December 11, 2018 Author Posted December 11, 2018 Hi, I used the name Customer_Aircraft as I already have a Customer Tbls and an aircraft Tbl which stores specific Aircraft detail. In the Customer_Aircraft TBL I Can Select the Customer and the Aircraft detail so yes you are correct, this is a it is pretty much a join table storing all the aircraft secondary detail per customer. Below is my new relationship with ID's I still can not see my Customer_Aicraft tbl in Show current record using layout when I select Balance sheet as get related record from.
bcooney Posted December 11, 2018 Posted December 11, 2018 So, a customer can have many Aircraft? If Customer>Customer_AirCraft<Aircraft Spec is true, then you should have two foreign keys in Customer_Aircraft: the CustomerId and the AircraftId. What is the primary key in the Aircraft_Spec table? That should be what relates from Aircraft_Spec>Customer_AirCraft.
Gismo12 Posted December 12, 2018 Author Posted December 12, 2018 Hi, The 2 layouts in question here is the Balance Sheet layout and the Customer_Aircraft layout. Not referring to the aircraft spec or the customer layout. I need to open the balance sheet from the Customer_Aircraft Layout Customer_Aircraft Layout has 2 primary keys, Customer ID which record the customer and the Customer_Aircraft ID which refers to the Aircraft ID. So when I write the script to open the Balance sheet and show records from the Customer_Aircraft layout, this layout is not available in the list to select. It only gives me the option of Balance sheet and balance sheet Re
Gismo12 Posted January 7, 2019 Author Posted January 7, 2019 On 12/12/2018 at 9:27 AM, Gismo12 said: Hi, The 2 layouts in question here is the Balance Sheet layout and the Customer_Aircraft layout. Not referring to the aircraft spec or the customer layout. I need to open the balance sheet from the Customer_Aircraft Layout Customer_Aircraft Layout has 2 primary keys, Customer ID which record the customer and the Customer_Aircraft ID which refers to the Aircraft ID. So when I write the script to open the Balance sheet and show records from the Customer_Aircraft layout, this layout is not available in the list to select. It only gives me the option of Balance sheet and balance sheet Re Hi All, Any proposals for above request? would really appreciate it as I just dont know which way to go from here. My Customer_Aircraft layout is not available when usen the Balance sheet as related record
comment Posted January 7, 2019 Posted January 7, 2019 16 minutes ago, Gismo12 said: My Customer_Aircraft layout is not available when usen the Balance sheet as related record The Customer_Aircraft layout is not available because it is not a layout of the same base table as Balance sheet. Every layout is defined to show records from a specific table occurrence on your relationships graph. And every table occurrence on your relationships graph belongs to one of the base tables defined in your file under the Tables tab. When you want to go to related record from a specific table occurrence, only layouts belonging to table occurrences of the same base table are available. 1
Gismo12 Posted January 7, 2019 Author Posted January 7, 2019 Oh okay now I understand. So when I am on a certain layout and I want to open a different layout but go to the same customer, how do I accomplish this? Ah, sorry guys, found the solution. I was trying to open a layout from different tables references
Recommended Posts
This topic is 2147 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