Using Conditions for submitting Forms in Universal App

  • SeaTable Cloud

I want to use conditions for submitting forms in universal app. My base is a warehouse. I have got warehouse stock entries as one table and stock withdrawals in another table that reduce stock in the linked table. With a webform in a universal app i want to make it possible to create new stock entries and in another webform i want to create stock withdrawals.

A new stock withdrawal isn’t allowed to create a negative stock. I already have a column to check for stock amount that outs out true/false, but i can’t imagine how to use that in the form. Even if i use automation rules i can only send notifications to the app-user, but submitting the form is still possible.

Is there any possible way to forbid submitting if the submitted line will create negative stock?

In another step i want to make a stock history, where stock entries and their connected stock withdrawals have to be moved into the history table. Right now i can only see possibilities to copy entries. Is it possible to move entire entries?

This is currently not supported.

The record is written only when you click the submit button. Only once this is done, computations can be run.

Moving is copying and deleting in the orginal place. You can do this with a script. There is no button/automated action “delete row”.

Deleting means manual deleting, or can i do this via script? I have a button for copying the line to my archive/history and settings status to inactive. I do see, that i can start scripts on button-action. How do i have to set this up to delete the active row?

I suggest you use a Python script. You find the documentation at Basic structure - SeaTable Developer Manual.

Thanks to the context object, interacting with the active row is trivial:

Once you have the _id, you can modify, copy, delete it with the methods included in the base object.