Hello,
Is there any way we can make triggers in appgini?
My Issue:
I want to create a stock item table and define stock part number based on the stock type I choose from the dropdown.
Ex:
Stock Type: Raw Stock;;Assembled Stock;; Finished Stock
When I choose Raw Stock from the drop down, the program should give the value as RAW-01 and may be after enteries of other stock items if I choose another Raw Stock Item, then the entry should be RAW-02 and same for other stock Items... ASS01.. 02 or FIN01 .. 02..
Is it possible? if not then please can u suggest an alternative to achieve this.
Trigger
Re: Trigger
Hi Chhavi,
yes that is possible. You need to register for the change of the dropdown and once a change happens, retieve the max index for your stock type.
If none exists, start with 01, and if one existes, use it and increment it. To retrieve the value you should retrieve the value via an AJAX call to the database, passing your stock type and retrieving the index value. You should consider having an index coloum for each stock type, as it makes the SQL easier.
yes that is possible. You need to register for the change of the dropdown and once a change happens, retieve the max index for your stock type.
If none exists, start with 01, and if one existes, use it and increment it. To retrieve the value you should retrieve the value via an AJAX call to the database, passing your stock type and retrieving the index value. You should consider having an index coloum for each stock type, as it makes the SQL easier.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.