October 29, 200421 yr Hi Guys, I've got the following problem: When I make a new Record in my Related Layout "Invoices", it doesn't enter my ID in its ID-Field from the "Customer" Layout, so that it's related. How can I do such a thing? Thanks for you're reply! Ron
October 30, 200421 yr If I understand you correctly you have 2 tables (not just layouts right?). Create a second copy of your table "invoices" and create a relationship between this table and the "customer" table, set the relationship to "X" between the fields (instead of =). then create a script looking like go to layout (invoices) new record set field (invoices::ID; customerX::ID) ...or else you could create a global field in your "customer" table. Then I don't think you need the extra table copy, you could just write your script: set field (customer::global_ID;customer::ID) go to layout (invoices) new record set field (invoices::ID; customer::global_ID) I hope this helps....
October 30, 200421 yr Put an invoice portal in the customer layout; when you create an invoice there, the customer ID will automatically be entered for the invoice. You do have the primary key and the foreign key connected in the Relationships Graph, don't you?
October 30, 200421 yr Didn't know that worked, is there other ways to link records from different tables if you don't want a portal on your layout?
October 30, 200421 yr You can, of course, manually connect a new record in the related table or file, by using a pop-up field based on a value list from the primary table or file. Use the Relationships Graph to make sure the two tables or files are linked. Then in a script you can GTRR (Go To Related Record).
October 30, 200421 yr You can put related fields on your layout (not the key field) and enter data. The relationship will be auto-linked and a new related record created. This requires 'Allow creation of related records' to be selected in the relationship's definition.
November 1, 200421 yr Author Hi David Holmberg, hey could you make me a Tutorial File? Thanks in advance!
November 9, 200421 yr Author Hi David, thanks for you're kind Reply and Help! After a long, long time this is what I came to! It seams a very quick and safe way to do the exact same thing. Check it out!!! Many appreciations and regards. R.T. Copy.with.ScriptParameter.zip
November 9, 200421 yr Nice work with the scriptparameter! Just one thing The go to Layout step in the GoToRelatedRecord script are not doing any good, it's the other way around.... This script will show all records, not only the related ones. It will also take you to the table 2 layout even if there are no related records. Remove that step and the script will work fine.
November 9, 200421 yr For Number::calc, you can use Right( "000" & number; 4 ) if you always want to have a 4-digit number. You might also want to make this a text result due to the leading zeroes that a number field will ignore.
November 10, 200421 yr Author Yea, I always do it like that! It seams a very nice and clean way, you're right! Thanks anyway!
Create an account or sign in to comment