"Add to cart" like action

Hi all,
I am building an order capture app.
I have a table “Products”, “Suppliers”, “Suppliers_Orders”,“Suppliers_Orders_Items”.
Suppliers_Orders_Items => ID product/ID Order/Qte

What I want to do is: from a Product, add the product to a pending order.
It means, from the product:

  • open a form autofilled with
    – the Id product selected,
    – ID order must be prefilled with the list of Suppliers_Orders in a State=“Doing” and only from the Supplier of the Product selected (it should be only one order)
    – qty must be prefilled with a formula (product.minimum qty + product.current stock for example)

Any help to achieve this?

Check out the documentation on LINKTOFORM(), it does exactly what you’re wanting.

1 Like

Hi @Cyril_L33 Just in case you didnt know , there is a sample “Order Capture” App that may be useful to you.

1 Like

Thanks, it works, but then, I am wondering how to reduce the Dropdown list to only the items possible.
I mean I did this :
LINKTOFORM(“Fournisseur_Commande_Detail_Form”,“SKU Produit”,[SKU],“Qte”,[Seuil bas]*2-[Current Stock],“ID Commande”,FILTER(Fournisseur_Commande,AND([Etat]=“A commander”,[ID Fournisseur]=[Fournisseur])))

So now, the order selected is ok, but if I click on it, I can select something else, from an other supplier

yes, thanks

Le mer. 4 sept. 2019 à 23:39, Lynn via AppSheet Creator Community appsheet@discoursemail.com a écrit :

Cyril_L33:

So now, the order selected is ok, but if I click on it, I can select something else, from an other supplier

You could use a contextual formula to hide that field inside the form, this way people can’t see/change it while entering data but you will elsewhere.

CONTEXT(“ViewType”) <> “Form”

You can find more about context() here:

1 Like

Ok, good to know, but my point was to restrict choices, there can be 2 orders at the same time :s

1 Like

You’ll have to create a valid if expression to restrict the values.

https://help.appsheet.com/en/?q=dependent+dropdown

1 Like