Jump to content

Searching a value entered by a user


spand

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

Recommended Posts

Hi,

Im trying to solve something like this. User is fillin up a form. When hi enteres a value to a field with product serial number I want next to this filed print out matching name of this product. The name is stored in a diffrent table. Please suggest something. 

Link to comment
Share on other sites

Create a relationship between your form table and product table: form::formProductNumberField = product::PruductNumber. 

If you already have a relationship between the two, create a new Table Occurrence (TO) of the product table and create the new relationship between it and the form table.

Place  the product::product name field on the form. 

As soon as the product number on the form matches the product number in the product table, the product name will instantly appear on the form.

Link to comment
Share on other sites

Yeap, that helped. Thanks.

Another question. Now, when I have a portal made of fileds of 2 tables I noticed one thing. Fileds of the jointed table are inavtice till I enter something in a field from the main table.

Link to comment
Share on other sites

I'm not quite sure what you are asking, but it's true that until there is a valid relationship (the primary key is complete and matches the foreign key in the portal table), the portal will be empty.

Can you describe your problem in greater detail? 

Link to comment
Share on other sites

It's impossible to determine what is happening without context. Can you attach your file, or a clone with a few dummy records? Also please describe the desired behavior.

Link to comment
Share on other sites

The reason that the field does cannot be accessed is that there is not a valid relationship to the line items table yet (until a field is populated). 

One way to work around this is to turn off the "allow creation of new records..." option in the relationship dialog and script the creation of a new line item instead. A "New Item"  button executes the script.

Please refer to the modified copy of your file attached.

 

erp_prohan_dh.fmp12

Link to comment
Share on other sites

Hi doughemi,

 

I've just noticed one thing in file you have provided. When I want to add new products to new "zamowienie", products are added table "zamowienia_pozycje" (what is correct) but also to table Produkt. 

Link to comment
Share on other sites

Yes, that would require additional steps in the script. Actually, I would consider creation of new products to be a separate operation, instead of being part of the invoice process. But I have no knowledge of your work flow.

Link to comment
Share on other sites

Doug,

hmm, ok, I will try to rework that adding new producta. However, could you add those steps to avoid adding products within this script. It’d be very helpful for me to learn.

Link to comment
Share on other sites

I'm afraid I don't understand how one invoices a product one doesn't have. This has gone well beyond a standard invoice solution. It would require a much fuller understanding of the actual workflow than I have.

Link to comment
Share on other sites

Doug,

I think Im making you confused and I dont want to waste your time :) If you dont mind I'd like to reset this conversation with a diffrent example (attached). I simply want to understand how to use database relationships without using "allow creation of new records." Workflow in the example is as follow:

  • I have 3 tabels -> orders, products, order_deatils
  • I want to create within an order its details. 

I want to learn how to access and use date from products table (product name, product price) when user in on Order details layout. That's my problem from the early beginning.

example1.fmp12

Link to comment
Share on other sites

This topic is 2230 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.