Jump to content

Automatic enter ID ? Need Help with Design!


This topic is 7104 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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! wink.gif

Ron

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 7104 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.