Getting data from subforms

Getting data from subforms

Bonjour,

I have a Product form that has a subform with 2 fields : Unit (Kg, boxes...) and Price.

In an Order form, I select an item from Product, and I already managed to input the Unit choices in a dropdown field with the following script:

RefProduit = Produits[ID = input.Produit_OFFRE];
RefUnite = List();
for each  Record in RefProduit.Unite_prix
{
    RefUnite.add(Record.Unite);
}
input.Unite_OFFRE:ui.add(RefUnite);

My problem is now to input the product price in another Order field, based on the selected Unit. Of course I would be using "On user input of the unit field".

I tried various things but can't get it.

Any idea ?

Sylvain