split record in 3 text_field

Hi to all,
I’m italian and sorry for my english.
I use servoy from many days and i wrote in this forum for the first time.

I have two tables (products and prices)
product(
product_id
description

)

prices(
price_id
product_id
price
)

I have two forms (master and detail) one for product and one for prices, for any product i have from one to three different prices . In the master form is placed a tabpanel with a detail form. I have a method in the OnRecordSelection event of the master form. Every time i swtich to the next record (or previous) i want to split the three prices in three different text_field. There is a way to do this?

I think that i write a function for the event onRecordSelection of the master form (products).

Thanks in advance.

Poyel,

Welcome to the forum! Your English is fine…no need to apologize.

Create a relationship between the product and price tables and name it ‘product_to_prices’ or something similar. Then, reference each of the 3 prices as follows:

product_to_prices.field_1
product_to_prices.field_2
product_to_prices.field_3

Once you create the relation, it will show up in the dataprovider pick list. Add a price field to the form, from the pick list select the relation, and under the relation, select the field. Do this for each field you want to add to the form.

I hope this helps!

Hi kwpsd, thansk for the answer.

You wrote,

Create a relationship between the product and price tables and name it ‘product_to_prices’ or something similar. Then, reference each of the 3 prices as follows:

product_to_prices.field_1
product_to_prices.field_2
product_to_prices.field_3

This is about the idea that i had, but i don’t know how to do this. I created the relation products_to_prices from product_id(products) to product_id(prices), but how can i reference each of the 3 prices separately?

Thanks