Reset Subform Items when re-selecting Parent Form

Reset Subform Items when re-selecting Parent Form

Hi,

Currently my current form for RECEIVE part of Inventory Management has the following structure:
      Suppliers (Lookup)
      Items (Subform)
            - Product
            - Quantity
      [Default = 0 rows]

Now, the Product dynamically populated from Suppliers with the following code in "Item --> On Add Row"
  1. prodlist  =  Add_New_Product  [Suppliers == input.Supplier];
  2. clear row.Product;
  3. row.Product:ui.append(prodlist.ID.getall());
which works fine.

My question is
1. Is there anyway to populate the product when I set to Default = 1 Row? (Save 1 click from users)
2. If I decided to change the supplier, I have to manually reload the webpage or delete all the row in order for the form to populate the correct info again. Is there any way to fix this?


Thank you so much,