Subform script not working correctly

Subform script not working correctly

Hello!

We are having some difficulties with the subforms script in some of our apps. The subforms have 2 or 3 lookup or dropdown fields. Sometimes they work correctly, but if we add some code in the other subforms fields (on user input) they stop working correctly, even if they are very simple tasks.
E.g.:
"Products" form contains all the products available with prices and category.

In the "Order" form, there's a "Order Details" subform.

Subform fields are:
Category (We tried dropdown and lookup fields)
Product Name (We tried dropdown and lookup fields)
Price (Decimal)
Quantity (Decimal)
Total  (Decimal)

  1.  Category >> On user input:
  2. clear row.Product_Name;
  3. for each item in Products  [Category == row.Category]
  4. {
  5.     row.Product:ui.append(item.Product_name);
  6. }


So far, everything works perfect. If I select any category, the "Product Name" field display the right products.

But if I add the next code:

  1. Quantity >> On user input
  2. row.Total = 100; //This number is just a test.
  3. I also tried:
  4. Quantity >> On user input
  5. alert "The total is 100";

It doesn't display anything in the Total field or the alert message doesn't show up. Even the round arrows don't show up, like the app it's not processing anything. But if I delete the "Category >> On user input:" code, then this part works and It displays the "100" when you enter any value in the quantity field!!!

This is just and example. In general, all tasks work, but if you add extra code in other subform fields, they stop working.
Is there any bug when programming subforms? Any kind of limit?

Thanks